[vlc-devel] vlc & hauppauge pvr350

Daniel Lawson daniel at wand.net.nz
Mon Aug 23 14:03:43 CEST 2004


Hi,

I'm trying to use vlc to stream (and transcode) off a Hauppauge PVR350. 
I'm using VLC 0.7.2 in linux (debian sarge), although I've grabbed the 
current svn vlc-trunk and it seems to be doing a similar thing.

First of all, I've set the pvr up correctly, I can capture off it via 
vls or by doing 'cat /dev/video0 > test.mpeg'. It doesn't work with vlc.

Digging through modules/access/pvr/pvr.c, and strace()ing the running 
program, I find it is spinning on a select() in the Read function (about 
line 518)

    FD_ZERO( &fds );
    FD_SET( p_sys->i_fd, &fds );
    timeout.tv_sec = 0;
    timeout.tv_usec = 500000;


    while( !( i_ret = select( p_sys->i_fd + 1, &fds,
                              NULL, NULL, &timeout ) ) >= 0  )
    {   
        FD_ZERO( &fds );
        FD_SET( p_sys->i_fd, &fds );
        timeout.tv_sec = 0;
        timeout.tv_usec = 500000;

        if( p_input->b_die || p_input->b_error )
            return 0;
    }

This will spin on the select until it returns 0 - which will only happen 
on a timeout. Because this is reading from a device which is always 
providing data, it will never timeout.

Changing this block of code to read:

    do {
        FD_ZERO( &fds );
        FD_SET( p_sys->i_fd, &fds );
        timeout.tv_sec = 0;
        timeout.tv_usec = 500000;

        if( p_input->b_die || p_input->b_error )
            return 0;
    } while ( (i_ret = select( p_sys->i_fd + 1, &fds,
                                    NULL, NULL, &timeout) ) );


Improves things somewhat, although I'm not 100% sure of what 
p_input->b_die or p_input->b_error are, so this may be an inappropriate 
merger.

After applying this and re-running vlc, I now get data being streamed to 
my remote machine! (running the windows vlc 0.7.2 client).

Output from 'vlc -vvv 
pvr:/dev/video0:norm=pal:size=720x578:bitrate=2000000:maxbitrate=4000000 
--sout udp:10.1.18.163' looks like below:


[00000174] main input debug: looking for mpeg-system module
[00000174] main input debug: probing 1 candidate
[00000091] main module debug: using mpeg-system module "mpeg_system"
[00000093] main module debug: using demux module "ps"
[00000174] main input debug: looking for a subtitle file in /dev/
[00000174] main input debug: starting in synch mode
[00000174] main input debug: selecting ES 0xe0
[00000182] main packetizer debug: looking for packetizer module
[00000182] main packetizer debug: probing 21 candidates
[00000145] main module debug: using packetizer module "packetizer_mpegvideo"
[00000182] main packetizer debug: thread 1129835440 (decoder) created at 
priority 0 (src/input/input_dec.c:161)
[00000174] mpeg_system input warning: garbage (0x1a821805)
[00000182] packetizer_mpegvideo packetizer debug: Size 720x578 fps=25.000
[00000174] mpeg_system input warning: garbage (0x4b68c17a)
[00000174] mpeg_system input warning: garbage (0xa9eab6ab)
[00000174] mpeg_system input warning: garbage (0xa9eab6ab)
[00000174] mpeg_system input warning: garbage (0xa9eab6ab)
[00000175] main stream output debug: adding a new input
[00000179] main private debug: adding a new input
[00000179] mux_ts_dvbpsi private debug: adding input codec=mpgv pid=68
[00000179] mux_ts_dvbpsi private debug: new PCR PID is 68
[00000174] mpeg_system input warning: garbage (0xa9eab6ab)
[00000174] mpeg_system input warning: garbage (0xa9eab6ab)
[00000174] mpeg_system input warning: garbage (0xa9eab6ab)
[00000174] mpeg_system input warning: garbage (0xa9eab6ab)
[00000174] mpeg_system input warning: garbage (0x00058540)
[00000174] mpeg_system input warning: garbage (0x4f46e461)
[00000174] mpeg_system input warning: garbage (0xa9eab6ab)
[00000174] mpeg_system input warning: garbage (0xa9eab6ab)
[00000174] mpeg_system input warning: garbage (0xa9eab6ab)
[00000174] main input debug: selecting ES 0xc0
[00000183] main packetizer debug: looking for packetizer module
[00000183] main packetizer debug: probing 21 candidates
[00000077] main module debug: using packetizer module "mpeg_audio"
[00000183] main packetizer debug: thread 1138224048 (decoder) created at 
priority 0 (src/input/input_dec.c:161)
[00000174] mpeg_system input warning: garbage (0xa9eab6ab)
[00000179] mux_ts_dvbpsi private debug: adjusting rate at 0/834711 (67/167)
[00000179] mux_ts_dvbpsi private debug: adjusting rate at 80000/834711 
(102/65)
[00000179] mux_ts_dvbpsi private debug: adjusting rate at 40000/754711 
(65/0)
[00000183] mpeg_audio packetizer debug: emulated startcode
[00000183] mpeg_audio packetizer debug: emulated startcode


I see a lot of the "garbage" warnings, and the "emulated startcode" 
warnings.


Does anyone have any suggestions?

Does anyone have a Hauppauge PVR350 and have successfully used vlc to 
stream off it?

Who is currently maintaining this part of the vlc codebase? (and would 
you like a diff of my above change)


Thanks,

Daniel

<>--
<>Daniel Lawson
<>WAND Group, Computer Science Department
<>University of Waikato
<>email: daniel at wand.net.nz phone: +64 7 838 4136

<>

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list