mplayer pvr support

I just barely got pvr support working on my mplayer installation at home working … on my lunch break. 🙂 Man, it is cool.

That’s a piccie of me having two mplayer windows open playing TV on both tuners on the Hauppauge PVR-500 with different channels. It’s kind of hard to see, I know.

To get it working, you have to do a few crazy things, to which even the most extreme of ricers might give a second thought. You’ve got to be running the 2.6.18 kernel headers along with a recent MPlayer dev snapshot, and the 0.8.0 branch of IVTV. All of them are in portage (and keyworded) except the first one, so I’ll leave it to the reader to guess how much they want to put their system in possible jeopardy just to watch television.

I haven’t had much time to play with it, but from reading the man page it comes with a few cool options, like setting the audio bitrate and the MPEG stream format. For instance, you can record straight to the DVD MPEG2 standard. Muwahahahahaha. >-D

I’ll post some more details once I get time. Right now, I’m just supah-stoked. Just think — one more mythtv-only option ripped out of the way. It feels glorious.

9 comments on “mplayer pvr support

  1. Infirit

    Something to add is that it uses the new enopder api from the kernel. So any card that uses the api will work with mplayer pvr://

    Hans Verkuil can be thanked for this as he designed the api and afaik coded the whole thing.

    Reply
  2. Luke

    Just running a compile with the 2.6.18 headers now – I haven’t bootstrapped glibc / gcc on those headers, but we’ll see if it works in due course.

    I bought my PVR when I was in Korea and live in a PAL country so it will be fun to get an IR blaster to control my DVD player to use as an external tuner.

    I’m also running ivtv-svn .. I’ll post my success / failure shortly!

    Reply
  3. Luke

    vo_ivtv.c:82: error: ‘struct ivtv_cfg_stop_decode’ has no member named ‘hide_last’

    I think it is an ivtv 0.9.1 / svn problem?

    Reply
  4. Luke

    struct ivtv_cfg_stop_decode {
    int flags; /* bit 0: 1 = hide last frame (go to black frame) after stop,
    0 = show last frame
    bit 1: 1 = wait until PTS is reached or
    until all pending buffers are processed
    0 = stop immediately

    It shouldn’t be too hard to make a patch to fix this?

    Reply
  5. GitRDone

    The quick patch for the above issue is in libvo/vo_ivtv.c (line 82):

    // sd.hide_last = blank_screen;
    //sd.pts_stop = 0;
    sd.flags=(sd.flags|1);
    sd.pts=0;

    Reply
  6. ariu

    Hi
    I followed GitRDone patch above and it complies and works with /dev/video0. However pvr:// repeats the following error and terminates after a while. Any help is greatly appreciated.

    Thanks
    Umesh

    [pvr] Using device /dev/video0
    [pvr] Detected Hauppauge WinTV PVR-250
    [v4l2] Available video inputs: ‘#0, Tuner 1’ ‘#1, S-Video 1’ ‘#2, Composite 1’ ‘#3, S-Video 2’ ‘#4, Composite 2’ ‘#5, Composite 3’
    [v4l2] Available audio inputs: ‘#0, Tuner 1’ ‘#1, Line In 1’ ‘#2, Line In 2’
    [v4l2] Available norms: ‘#0, PAL-BGH’ ‘#1, PAL-DK’ ‘#2, PAL-I’ ‘#3, PAL-M’ ‘#4, PAL-N’ ‘#5, PAL-Nc’ ‘#6, SECAM-BGH’ ‘#7, SECAM-DK’ ‘#8, SECAM-L’ ‘#9, SECAM-L” ‘#10, NTSC-M’ ‘#11, NTSC-J’ ‘#12, NTSC-K’
    [v4l2] Video input: Tuner 1
    [v4l2] Audio input: Tuner 1
    [v4l2] Norm: NTSC-M.
    [pvr] failed with errno 22 when reading 2048 bytes
    [pvr] read 0 bytes
    [pvr] failed with errno 22 when reading 2048 bytes
    [pvr] read 0 bytes ……..

    Reply
  7. Dawning

    I get the same problem with my PVR-150 (Ubuntu 7.04 – kernel 2.6.20)

    I also would really like to know how to change the video input sources. Seems this is something that should be do-able from mplayer, however perhaps I have to use some other control for v4l2 or ivtv to make that change?

    Also, when I first boot my machine and run mplayer /dev/video0 – get a window of static.. After awhile (not sure what triggers it) that ceases to work. All I get is mplayer seemingly hanging with the message “Playing /dev/video0.”

    help would be deeply appreciated.

    Reply
  8. Dawning

    Okay, I’ve at least figured out how to change the input sources for the PVR-150.

    I used v4l2-ctl, it’s actually pretty easy. I wanted the Composite 1 input selected, so for me, I just ran:

    v4l2-ctl -i 2

    Just run the v4l2-ctl –help command and you’ll see your options. The highlights to me are:

    -n -> Displays video input sources
    -i -> sets video input source
    -I -> shows current video input source
    –get-audio-input
    –set-audio-input

    So now when I run mplayer pvr:// I get:

    Playing pvr://.
    [pvr] Using device /dev/video0
    [pvr] Detected Hauppauge WinTV PVR-150
    [v4l2] Available video inputs: ‘#0, Tuner 1’ ‘#1, S-Video 1’ ‘#2, Composite 1’ ‘#3, S-Video 2’ ‘#4, Composite 2’
    [v4l2] Available audio inputs: ‘#0, Tuner 1’ ‘#1, Line In 1’ ‘#2, Line In 2’
    [v4l2] Available norms: ‘#0, PAL-BGH’ ‘#1, PAL-DK’ ‘#2, PAL-I’ ‘#3, PAL-M’ ‘#4, PAL-N’ ‘#5, PAL-Nc’ ‘#6, SECAM-BGH’ ‘#7, SECAM-DK’ ‘#8, SECAM-L’ ‘#9, SECAM-L” ‘#10, NTSC-M’ ‘#11, NTSC-J’ ‘#12, NTSC-K’
    [v4l2] Video input: Composite 1
    [v4l2] Audio input: Line In 1
    [v4l2] Norm: NTSC-M.
    [pvr] failed with errno 22 when reading 2048 bytes
    [pvr] read 0 bytes

    Still have that failure, but at least it’s using the sources I wanted.

    Reply
  9. Dawning

    More progress – the problem I mentioned about mplayer eventually ceasing to play from /dev/video0 after some unknown case – this can be resolved by reloading the ivtv kernel module.

    So run: rmmod ivtv
    and then: modprobe ivtv

    Also, it seems that the case where mplayer would stop playing from /dev/video0 was when I attempted to execute: mplayer pvr://

    And as you’d expect, upon reloading ivtv – the input settings are reset to defaults.

    Reply

Leave a Reply to DawningCancel reply