LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   framebuffer confusion with Hauppauge PVR 350 framebuffer /dev/fb0 (http://www.linuxquestions.org/questions/linux-general-1/framebuffer-confusion-with-hauppauge-pvr-350-framebuffer-dev-fb0-666869/)

tofino_surfer 09-01-2008 12:17 PM

framebuffer confusion with Hauppauge PVR 350 framebuffer /dev/fb0
 
Hello,

I am trying to set up a temporary Myth TV installation on my sole Fedora 8 desktop with a Hauppauge PVR 350 as a one card solution as my video card doesn't have TV-Out. The problem I am having is in trying to configure the TV-Out on my PVR 350 both for X-Windows and for hardware accelerated Mpeg2 playback using the ivtvfb module. This module creates a framebuffer at /dev/fbx which can be used to run X-Windows for the MythTV GUI.

Linux is confusing the PVR 350 framebuffer at /dev/fb0 with its own framebuffer for text output. This is happening as unlike every ivtv example I have seen I don't have an existing /dev/fb0 framebuffer for my regular NVidia video card. Most if not all ivtv/MythTV users have their PVR 350 framebuffer at /dev/fb1. Once the PVR 350 card is recognized during the boot process, the ivtvfb driver is loaded, the /dev/fb0 framebuffer is created for the PVR 350 card, to which Linux then transfers all text output, recognizing it as a framebuffer console for its own output. All bootup messages after udev are displayed on the TV out. All text VTs Ctrl_Alt F1-F6 display on the TV out. All shutdown messages display on the TV out. Only the X-Windows VT 7 is active on my regular monitor. Ctrl-Alt F1-F6 switches the text VTs on the TV screen but shows a frozen screen on the monitor consisting of the early boot messages up to the udev: line, at which output was transferred.

This of course interferes with any use of the card for watching video or running X for the MythTV GUI. X_Windows can't start on this PVR 350 framebuffer as its already occupied. Cat file.mpg > /dev/video16 (the internal MPEG decoder port)results in the sound of the video heard on the TV with the Linux text screen overlaid on the center of the picture. There are vertical bands on the left and right of the screen where parts of the video can be seen.

Will simply creating a framebuffer at /dev/fb0 for my NVidia video card solve this conflict ? What is the technique for installing a framebuffer driver for a video card ?

Alternatively are there any settings that would disable the kernel from attempting to use this framebuffer for a console so that Myth TV and mplayer etc would have exclusive use of it ?

Thank you for your help.

JonnerR 09-02-2008 09:39 PM

Disable console on a framebuffer
 
Quote:

Originally Posted by tofino_surfer (Post 3266220)
Hello,

I am trying to set up a temporary Myth TV installation on my sole Fedora 8 desktop with a Hauppauge PVR 350 as a one card solution as my video card doesn't have TV-Out. The problem I am having is in trying to configure the TV-Out on my PVR 350 both for X-Windows and for hardware accelerated Mpeg2 playback using the ivtvfb module. This module creates a framebuffer at /dev/fbx which can be used to run X-Windows for the MythTV GUI.

Linux is confusing the PVR 350 framebuffer at /dev/fb0 with its own framebuffer for text output. This is happening as unlike every ivtv example I have seen I don't have an existing /dev/fb0 framebuffer for my regular NVidia video card. Most if not all ivtv/MythTV users have their PVR 350 framebuffer at /dev/fb1. Once the PVR 350 card is recognized during the boot process, the ivtvfb driver is loaded, the /dev/fb0 framebuffer is created for the PVR 350 card, to which Linux then transfers all text output, recognizing it as a framebuffer console for its own output. All bootup messages after udev are displayed on the TV out. All text VTs Ctrl_Alt F1-F6 display on the TV out. All shutdown messages display on the TV out. Only the X-Windows VT 7 is active on my regular monitor. Ctrl-Alt F1-F6 switches the text VTs on the TV screen but shows a frozen screen on the monitor consisting of the early boot messages up to the udev: line, at which output was transferred.

This of course interferes with any use of the card for watching video or running X for the MythTV GUI. X_Windows can't start on this PVR 350 framebuffer as its already occupied. Cat file.mpg > /dev/video16 (the internal MPEG decoder port)results in the sound of the video heard on the TV with the Linux text screen overlaid on the center of the picture. There are vertical bands on the left and right of the screen where parts of the video can be seen.

Will simply creating a framebuffer at /dev/fb0 for my NVidia video card solve this conflict ? What is the technique for installing a framebuffer driver for a video card ?

Alternatively are there any settings that would disable the kernel from attempting to use this framebuffer for a console so that Myth TV and mplayer etc would have exclusive use of it ?

Thank you for your help.

I have a MythTV machine that has no ordinary video card at all, but only a PVR-350. Neither the BIOS nor bootloader displays anywhere, but when the ivtv-fb module loads, it uses /dev/fb0 and the fbcon module attaches itself to /dev/fb0 to display the Linux console on the PVR-350's output. Currently, this works fine. Linux console, X, and the PVR-350's MPEG decoder all share the display. I can even switch virtual consoles with Ctrl-Alt Fx. While the MPEG decoder is in use, it covers up everything else, which can be a problem if mythfrontend exits unexpectedly, but otherwise, everything works as a normal display.

Linux isn't confusing the ivtv framebuffer with "its own" because the ivtv one is one of its own. The framebuffer device provided by ivtv-fb should have the same basic capabilities as any other, but I wasn't always able to use the PVR-350 for the Linux console, apparently due to a bug in ivtv or ivtv-fb. I can't remember exactly which version of Linux and ivtv fixed this, but currently, I'm running Ubuntu 7.04 (Feisty) with Linux 2.6.20-17-generic and IVTV 0.10.1. Which version of IVTV are you using? What exactly does X say when you try to start it using /dev/fb0?

I'm not sure if you're trying to use only the PVR-350 to display everything or if you plan to continue to use another monitor connected to a VGA card. To avoid problems with the console on a framebuffer device, you can disable fbcon entirely, which should keep the console in VGA text mode, which can't interfere with the PVR-350, as it is not a VGA device. You can add "fbcon=map:9" to the kernel boot parameters which tells fbcon to use fb9, which should never exist. Alternatively, you could tell it to map to a different fb device, such as the one on your Nvidia card. The man page of fbcon has more details: http://www.mjmwired.net/kernel/Docum...n/fb/fbcon.txt.

tofino_surfer 09-04-2008 01:32 PM

Hello,

Thanks JonnerR for responding. I have posted messages to three different forums ( including MythTV ) and this is the first response so far. Your suggestion for disabling the framebuffer worked perfectly. I used fbcon=map:1 as a kernel parameter and the console is back on my regular monitor, as well as boot and shutdown messages. The only downside is that I have to lug my 19" CRT monitor down the hall to the living room at least until I get X working and autostarted on the Tv out. It would be nice to have all three working on the 350 as you do but I need something that doesn't cause problems with my regular computer use. In the future once I get my problems solved I may try creating an NVidia framebuffer and switching dynamically.

However my other problems remain. There is still an empty black square at the center of the display when trying cat file.mpg > /dev/video16. The only difference now is that there is no linux console running inside this area, it's just an empty black square. Also X-Windows won't start on the 350 TV out as I now know I was confusing kernel modules with video drivers in xorg directories. I am now trying to install the ivtv xorg driver, old name ivtvdev.

More information : fbset -i output

mode "640x400-60"
# D: 23.831 MHz, H: 29.788 kHz, V: 59.936 Hz
geometry 640 400 640 400 8
timings 41963 41 95 41 54 24 2
rgba 8/16,8/8,8/0,8/24
endmode

Frame buffer device information:
Name : cx23415 TV out
Address : 0xd9510000
Size : 1704960
Type : PACKED PIXELS
Visual : PSEUDOCOLOR
XPanStep : 1
YPanStep : 1
YWrapStep : 0
LineLength : 640
Accelerator : No

Of note here is the buffer size of 640X400 much smaller than the needed 720X480. The black square is about 640X400 in size. The edges of the video are visible outside this square and the sound is heard. In your case the MPEG decoder covers up everything else. I don't know how to override this framebuffer. Perhaps fixing the size will help. There are sections in the ivtv xorg driver documentation about custom resolutions for ivtvfb. What resolution do you have for your framebuffer ?

Once i get this problem solved I don't know how to get mplayer to use the /dev/video16 port. Before I disabled the framebuffer mplayer would play as root user only on the TV out using fbcon module and 100% software playback. There was no sound and the quality was horrible. The lack of sound may be expected as the 350 outputs sound only for MPEG 2 which probably means using the decoder. Will using the ivtv xorg driver with mplayer -vo ivtv solve this problem ? I am using ivtv 1.1.0.

I am still working on the X-Windows output with the ivtv xorg driver.

Thank you for your help

Andrew

JonnerR 09-05-2008 12:49 PM

Here's what "fbset -i" gives me:
Code:

mode "720x480-60"
    # D: 23.831 MHz, H: 29.788 kHz, V: 59.936 Hz
    geometry 720 480 720 480 32
    timings 41963 1 55 1 14 24 2
    rgba 8/16,8/8,8/0,8/24
endmode

Frame buffer device information:
    Name        : cx23415 TV out
    Address    : 0xe1510000
    Size        : 1704960
    Type        : PACKED PIXELS
    Visual      : TRUECOLOR
    XPanStep    : 1
    YPanStep    : 1
    YWrapStep  : 0
    LineLength  : 2880
    Accelerator : No

I see there are several differences from yours, such as mode "720x480-60" instead of mode "640x400-60" and "Visual : TRUECOLOR" instead of "Visual : PSEUDOCOLOR". However, I have no memory of setting any of those values directly. As far as I know, the framebuffer device was configured completely automatically on my system simply by loading the modules "ivtv" and "ivtv-fb". The former seems to be loaded without any user input when udev sees the card and I put "ivtv-fb" into my /etc/modules, which causes it to be loaded during boot on Debian and Ubuntu systems at least.

This is what I see in my kernel log when ivtv-fb loads:
Code:

Aug 30 18:44:29 rygel kernel: [  44.323552] ivtv0-fb: Framebuffer at 0xe1510000, mapped to 0xdf810000, size 1665k
Aug 30 18:44:29 rygel kernel: [  44.409667] ivtv0-fb: === Validated display mode  ===
Aug 30 18:44:29 rygel kernel: [  44.414735] ivtv0-fb: Display size 720x480 (720x480 Virtual) @ 32bpp
Aug 30 18:44:29 rygel kernel: [  44.421080] ivtv0-fb: Display position 1,1
Aug 30 18:44:29 rygel kernel: [  44.425172] ivtv0-fb: Display filter : on
Aug 30 18:44:29 rygel kernel: [  44.429177] ivtv0-fb: Color space : RGB
Aug 30 18:44:29 rygel kernel: [  44.487361] ivtv0-fb: === Display mode change ===
Aug 30 18:44:29 rygel kernel: [  44.487374] ivtv0-fb: Display size 720x480 (720x480 Virtual) @ 32bpp
Aug 30 18:44:29 rygel kernel: [  44.487378] ivtv0-fb: Display position 1,1
Aug 30 18:44:29 rygel kernel: [  44.487380] ivtv0-fb: Display filter : on
Aug 30 18:44:29 rygel kernel: [  44.487383] ivtv0-fb: Color space : RGB
Aug 30 18:44:29 rygel kernel: [  44.560365] Console: switching to colour frame buffer device 90x30
Aug 30 18:44:29 rygel kernel: [  44.679055] ivtv0-fb: === Display mode change ===
Aug 30 18:44:29 rygel kernel: [  44.683779] ivtv0-fb: Display size 720x480 (720x480 Virtual) @ 32bpp
Aug 30 18:44:29 rygel kernel: [  44.690124] ivtv0-fb: Display position 1,1
Aug 30 18:44:29 rygel kernel: [  44.694218] ivtv0-fb: Display filter : on
Aug 30 18:44:29 rygel kernel: [  44.698223] ivtv0-fb: Color space : RGB
Aug 30 18:44:29 rygel kernel: [  44.702145] ivtv0-fb: Running in compatibility mode. Display resize & mode change disabled
Aug 30 18:44:29 rygel kernel: [  44.715132] ivtv0-fb: Framebuffer registered on ivtv card id 0

I just noticed that I had added the line "options ivtv_fb osd_compat=1" to my /etc/modprobe.d/options file, which means ivtv-fb is given the option "osd_compat=1" when it's loaded. I must have added that to make something with Xorg or MythTV work better, but I can't remember what exactly. You should try that to see if it makes any difference.

According to "modinfo ivtv-fb":
Code:

parm:          osd_compat:Compatibility mode - Display size is locked (use for old X drivers)
                        0=off
                        1=on
                        default off (bool)

Alternatively, you might want to try the newest xf86-video-ivtv if you aren't using it already. According to the ChangeLog there have been some signficant improvements in recent versions. I'm still using 0.10.6; maybe I need to upgrade too.

tofino_surfer 09-19-2008 12:36 AM

I have got X-Windows running on the 350 with the xf86-video-ivtv driver. I increased the size to 720X480 with module options. Mplayer runs with good performance using the xv video extensions with mplayer -vo xv. The decoder must be used as performance is similar to using cat file.mpg > /dev/video16. I have also learned to override the framebuffer with v4l2-ctl --overlay=0.

The driver and firmware package I am using is much different than yours. First the module is ivtvfb ( no dash ) and the default resolution is 640X400. This may cause problems later on as in order to increase the size to 720X480 I can't use osd_compat mode which MythTV supposedly needs.

I an issue at the moment. The card has frozen at times. The picture on screen freezes up while sound continues. Once it affected recording as well. This may be due to the card overheating which its known to do. It has happened when the computer was running for many hours. Has this happened to you and if so how did you deal with it ?

Thank you for your help.


All times are GMT -5. The time now is 01:10 PM.