[mythtv-users] My first attempt at PVR-350 TV-out "howto" (very LONG)

IvanK. chepati at yahoo.com
Wed Nov 5 21:28:44 EST 2003


Folks,

It took me some time to figure out how to get PVR350 tv-out, and now that I 
have and I'm enjoying an amazingly high-quality picture, I'd like to share my 
findings with other people still struggling.

NOTE: This is geared towards NTSC users.  Sorry, I don't know how to do PAL, 
but I suspect the following instructions should work with some minor tweaks.

First, a few preliminaries:
I'm running MythTV 0.12
with decoder-alpha-311003A
on a PVR-350

I would suggest you set your default init level to 3 for now until you get 
everything working.

Boot into runlevel 3 with:
init 3

1) get and compile MythTV

Not discussed here, because there is perfectly good documentation on 
http://www.mythtv.org

2) Get the latest decoder-alpha driver from 
http://www.kernel.org/pub/linux/kernel/people/axboe/ivtv/
NOTE: Jens's changes seem to have been merged back into the main cvs as of Oct 
31, 2003 so you can probably just extract the latest cvs.

compile the drivers in drivers/ (possibly you'll need to do from inside 
drivers/ cp ../utils/videodev2.h . ), then make install.  Then move to the 
utils/ directory do another make and copy the four binaries into 
/usr/local/bin (QUESTION: Do they really need to be in the PATH?)

3) /etc/modules.conf

put this block in your /etc/modules.conf

==== START ====

# This is for WinTV PVR-350 IVTV
alias char-major-61 lirc_i2c
alias char-major-81     videodev
alias char-major-81-0   ivtv
alias char-major-81-1   bttv
options ivtv debug=1
options tuner type=2
options saa7127 enable_output=1 output_select=0
options msp3400 once=1 simple=1
add below ivtv msp3400 saa7115 saa7127 tuner
add above ivtv lirc_dev lirc_i2c ivtv-fb
post-install ivtv /usr/local/bin/test_ioctl -d /dev/video0 -u 0x3000
post-install ivtv /usr/local/bin/test_ioctl -d /dev/video16 -u 0x3000
post-install ivtv /usr/local/bin/test_ioctl -d /dev/video32 -u 0x3000
post-install ivtv /usr/local/bin/test_ioctl -d /dev/video224 -u 0x3000

==== END ====

Note: you probably don't need the four post-install lines if you use MythTV, 
because MythTV should probably do that for you anyway.

Also, the alias char-major-81-1   bttv line is not necessary unless you have 
an old Brooktree bt8x8-based card.  If you don't, remove the line.

I suggest you create a user group for people who can run MythTV.  On my system 
I call it video.  I run mythbackend as root, but I have a user mythtv that 
runs mythfrontend.  The user mythtv is member of the video group.

Now that you have changed /etc/modules.conf, run depmod -a `uname -r`

You may need to create some device files.  Run this command (on one line):
for i in 0 1 2 3 16 32 224 ;do if [ !  -f /dev/video$i ]; then echo "Creating 
/dev/video$i" && mknod /dev/video$i c 81 $i && chown :video /dev/video$i && 
chmod 660 /dev/video$i; else echo "/dev/video$i already exists";fi;done

Finaly create a link from /dev/video0 to /dev/video with this:

ln -s video0 /dev/video

If you get a message saying /dev/video exists, you can ignore it if /dev/video 
points to /dev/video0.  If it doesn't, you have to figure out what device the 
PVR-350 input is using.  Normally whatever driver is loaded first, it grabs 
/dev/video0.  So if you load bttv before ivtv, bttv will use /dev/video0, and 
ivtv will use /dev/video1.  If you have multiple of the same cards in the 
system, say a few PVR-x50s, the closer the card is to the AGP slot, the 
lesser the device number it gets assigned -- the PCI slot closest to the AGP 
will be /dev/video0, the next after that (not necessarily the one adjacent) 
will be /dev/video1, etc.

So figure out what device ivtv is using if it's not /dev/video0.

Ok, at this point you can attempt loading the ivtv-fb driver.  Open another 
bash session (I do this from another computer) and do tail -f 
/var/log/messages
Then do:
modprobe ivtv-fb

In the window where you're tailing the messages, look for a line that says 
something like this:

fb1: iTVC15 TV out frame buffer device

Mind you, it can say fb0.  It doesn't matter.  What matters is that this is 
the frame buffer allocated to PVR-350.  Remember this number! You'll need it 
in the next section.

Now just a quick test.  Hook up your TV set to the composite out rca jack of 
your PVR-350 and do this:
rmmod saa7127
insmod saa7127 enable_output=1 output_select=0 test_image=1

Do you see the color pattern on the TV screen?  If yes, good, if not.. hmmm, 
something went wrong.  Don't blame MythTV, because it has nothing to do with 
it.  Don't blame X, because it has nothing to do with it either.  Possibly 
try older/newer ivtv decoder drivers.  Read these instruction again.  Post to 
the list.

If you see the pattern in black and white, try loading saa7127 with option 
output_select set to 1.

If you see the color pattern, that is a very good sign.  Now remove the 
saa7127 module and reload it without the test_image option:
rmmod saa7127
insmod saa7127 enable_output=1 output_select=0

Before you run the next test, you need to set your input, your TV standard, 
etc:

do this with:

/usr/local/bin/test_ioctl -u 0x3000 -p 6

-u 0x3000 is for NTSC
-p 6 is for S-Video input
-p 0 I think was for Television (the coax cable)

Now do this:

cat /dev/video > test.mpg

(assuming /dev/video points to the ivtv device)

After a few seconds, pres Ctrl-C and you should end up with a mpg file.  Copy 
that file to a computer that can play it and verify you're capturing fine.

If yes, proceed to testing tv-out.  If not, read the instructions again.  Try 
a different -p argument to test_ioctl.

If you got a working mpg, try watching TV with:

dd if=/dev/video of=/dev/video16 bs=64k
(substitute /dev/video with whatever device ivtv is using -- it should say in 
/var/log/messages)

If you see picture, congrats.  In order to hear the sound, hook up the RCA 
audio out jack of the PVR-350 to the line-in of your sound card.  You should 
now be enjoying a stunningly clear picture and good sound.  If not, sorry, 
try again.  Watch those /var/log/messages for hints.

Now that tv-out is working, log in as the user who'll be running MytTV and 
repeat the last test to make sure you can still get picture and sound 
working.  Then proceed to the next section -- Xfree.

4)  XFree part

Here are the relevant sections from my /etc/X11/XF86Config-4

Section "ServerLayout"
        Identifier     "XFree86 Configured"
        Screen  0 "TV Screen"
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Monitor"
        Identifier  "NTSC Monitor"
        HorizSync  30-68
        VertRefresh 50-120
        Mode "720x480"
          # D: 34.563 MHz, H: 37.244 kHz, V: 73.897 Hz
          DotClock 34.564
          HTimings 720 752 840 928
          VTimings 480 484 488 504
          Flags    "-HSync" "-VSync"
        EndMode
EndSection

Section "Device"
        Identifier  "Hauppauge PVR 350 iTVC15 Framebuffer"
        Driver      "fbdev"
        Option      "fbdev" "/dev/fb1"
	### change fb1 to whatever number you got in the previous section
        BusID "0:08:0"
	### change the busid to whatever is reported by lspci -v
EndSection

Section "Screen"
        Identifier  "TV Screen"
        Device      "Hauppauge PVR 350 iTVC15 Framebuffer"
        Monitor     "NTSC Monitor"
        DefaultDepth 24
        DefaultFbbpp 32
        Subsection "Display"
          Depth 24
          FbBpp 32
          Modes "720x480"
        EndSubsection
EndSection

Save you XF86Config-4

I am using KDE with kdm set up to login the user mythtv automatically and 
without a password.  In ~mythtv/.kde/Autostart I have a link to 
/usr/local/bin/mythfrontend

What happens when I boot (with runlevel 5 being the default)is this: kdm logs 
mythtv in automatically and starts mythfrontend.  Mind you, this will fail 
unless you start mythbackend as a daemon prior to starting X.

You need to switch to runlevel 5 now.  Do so by running:
init 5

You should see mythfrontend load.  Go to Settings/TV Setting/Playback and on 
the second (I think) screen check the "Use PVR-350" thing.  Make sure it says 
/dev/video16 in the box.

That's it folks.  That was all I needed to do to get my PVR-350 TV out.  Now 
it's just sweet.  Finally I have MythTV in all its glory and what a treat!

Hope this helps.  Sorry for typos and mistakes -- they are unintentional.  
Please correct me when you see me giving wrong instructions.

IvanK.




More information about the mythtv-users mailing list