1

I am developing Qt application for a embedded linux/MIPS device. So far managed to execute my Qt application on the device. Now I need to create overlays on top of video. Hardware provides four overlays windows and does not support OpenGL.

Tried so far:

  1. Tried creating QStackedLayout and QGraphicsView for creating overlays on top of video. But overlay appears black, though widgets on overlay responds to user click.
  2. Tried to access multiple framebuffers directly. I am able to access /dev/fb0 but not /dev/fb1, 2, 3.
  3. Tried creating a simple Qt application with a dialog and a push button on it. I tried executing it on embedded device using this command ./<appname> -display directfb:/dev/fb1:2. But it fails to open /dev/fb1.

Questions:

  • How can I use the overlay windows provided by the LCD controller?
  • Is it possible to use directfb plugin provided by QT and take advantage of its OpenGL support?
  • Do I have to explicitly map /dev/fb1 to user space to be able to use it?

Need urgent help regarding this.

sam-w
  • 7,478
  • 1
  • 47
  • 77
Lata Agrawal
  • 81
  • 1
  • 8

3 Answers3

2

Finally got this working. I could find the interface using which I could access the framebuffers.

  • Then using -display switch I directed output of Qt app to framebuffer meant for overlay window. The exact command used was ./app-name -display Linuxfb:/dev/fb2:enable=1.
  • Also enabled the alpha mode of the framebuffer /dev/fb2 which showed through the video playing below.
Lata Agrawal
  • 81
  • 1
  • 8
0

Before trying to use Qt, you have to understand how the hardware overlays are supported by the Linux kernel, and what userspace interface the kernel provides to use those overlays. In general, only one overlay is accessible as a framebuffer, the other overlays for video are accessible as Video4Linux output devices. But it really depends on what the hardware is and how the Linux support has been done on this hardware.

Thomas Petazzoni
  • 5,636
  • 17
  • 25
  • I am using Alchemy HMP device with Au1250 processor. I am not able to figure out how to access the four overlays windows supported by LCD controller. I think this should be via /dev/fb1,2,3..but not able to so. – Lata Agrawal Nov 19 '11 at 05:43
  • Thanks Thomas for the suggestion. – Lata Agrawal Dec 10 '11 at 09:59
0

My answer actually is not about qt but about hw layer. If your hardware supports overlays so this should mean that the directfb supports multiple hardware layers. Your tries to use fb1,fb2... fails because there is only one fb driver and it's used by directfb and you should use directfb instead of fb directly. First of all I suggest you to check whether hw really supports additional hw layers(surfaces) and not only primary, for that you can for instance write simple directfb app which sets this callback, and after initialization of directfb interface the core will call your callback for every presented hw layer(surface) with it's capabilities as argument. Anyway I don't remember but I guess that Qt always uses primary surface.

Ilay
  • 235
  • 3
  • 11
  • Thanks for your suggestion. I am using Alchemy HMP device with Au1250 processor which has LCD controller with characteristics "The LCD controller provides developers with full 32-bit RGB/alpha capabilities in each of four prioritized overlay windows that require no frame buffer modification to reposition; gamma correction for matching video displays with graphics" From this I understand that each of these overlays windows can be accessed via /dev/fb1,2,3..I just need to direct my app output to these overlay windows. Am i thinking correct. And yes, QT uses primary surface i.e. /dev/fb0 – Lata Agrawal Nov 19 '11 at 05:36
  • I think that there is only one /dev/fb0 device node, and accessing to the hw layers(overlays) is possible through DirectFB. But just for check try to create /dev/fb1,2,3... device nodes by your hands using mknod command with major id as for /dev/fb0 node and minor ids as 1,2,3. Do you have framebuffer device driver sources? – Ilay Nov 21 '11 at 14:19
  • "cat proc/fb" gave:0 AU1200 1 AU1200 2 AU1200 3 AU1200."ls -l /dev/fb*" gave the output:crw-rw---- 1 0 0 29, 0 Jan 1 00:00 /dev/fb0 crw-rw---- 1 0 0 29, 1 Jan 1 00:00 /dev/fb1 crw-rw---- 1 0 0 29, 2 Jan 1 00:00 /dev/fb2 crw-rw---- 1 0 0 29, 3 Jan 1 00:00 /dev/fb3. I think this clearly suggests that device has multiple framebuffers. One of my QT applications uses /dev/fb0 by default.command to run it: ./ -qws --dfb:mode=800*480 --dfb:no-cursor.when i try to use /dev/fb1{2} using fbdev:/dev/fb1 switch,it executes,but i can't see anything.any idea how to make other layers visible. – Lata Agrawal Nov 23 '11 at 09:00
  • Ran out of ideas...please someone help me. – Lata Agrawal Nov 26 '11 at 07:02