PAL PVR 350 under Debian GNU/Linux

This is what I did to get my Hauppage PVR 350, PAL version working under Ubuntu. I got the latest ivtv kernel module from ivtv.sf.net. This kernel requires firmware to be loaded at the time of module-loading. Getting this firmware is cumbersome, mainly because recent Win32 drivers on the CDROM keep changing. To save you from these troubles, you can download the firmware files I extracted from the win32 driver. You need to download ivtv-fw-dec.bin and ivtv-fw-enc.bin and store them in the /lib/modules directory. After downloading, you may want to check the md5sums:
bram@lambiek:/lib/modules$ md5sum ivtv-fw-*
305dba74bbe5905447add8883f3ecb68  ivtv-fw-dec.bin
ab75947ef1b086e26f9b08e628baa02e  ivtv-fw-enc.bin
  

The PVR350 I have, came with a Philips FM1216 ME Mk3 tuner. I could not get the tuner to find any stations, unless I added an option to the module loading:

modprobe ivtv tda9887=0

To test the card, you should use the utility that comes with ivty, called ivtvctl. First check if the settings are OK with

  $ ./ivtvctl -FUP
  ioctl: VIDIOC_G_FMT
          Type   : Video Capture
          Width  : 720
          Height : 576
  ioctl: VIDIOC_G_INPUT
  Input = 4
  ioctl: VIDIOC_G_STD
  Standard = 0x000000ff
  
0xff means PAL, and Input 4 is the tuner input. If correct, grab some video with
  cat /dev/video0 > /tmp/foo.mpeg
  Ctrl-C
  ls -al /tmp/foo.mpeg
  mplayer /tmp/foo.mpeg
  

To scan for stations on your network, you can use the scantv utility. To select channels, you can use the perl scripts in the util dir of ivtv. You can play back the video using the onboard MPEG decoder, by copying it to the /dev/video16 device.

You can use PVR software called MythTV. MythTV is available in the 'multiverse' section of Ubuntu. You need to add this to your /etc/apt/sources.list file, as Ubuntu does not use multiverse by default.

For using the remote control, you need to build the lirc package from source, and use the lirc-i2c kernel module. The ir-kbd-i2c did not work properly for me. Although I saw key presses in my x terminal, the mapping was all mixed up, and most keys were designated as 'unknown'.

I could not find a complete .lircrc for this remote, to work with mplayer, so I wrote my own. First, I established which keys are available on the pvr 350 remote. These are the keys:

#
0
1
2
3
4
5
6
7
8
9
Asterix
Back/Exit
Blue
Ch-
Ch+
Down
Forward
Go
Green
Guide
Left
Menu/i
Music
Mute
OK
Pause
Pictures
Play
Power
Prev.Ch
Radio
Record
Red
Replay/SkipBackward
Rewind
Right
SkipForward
Stop
TV
Up
Videos
Vol-
Vol+
Yellow
    
These keys can be mapped to the folowing commands, known to my mplayer:
seek                 Float [Integer]
edl_mark
audio_delay          Float
speed_incr           Float
speed_mult           Float
speed_set            Float
quit                 [Integer]
pause
frame_step
grab_frames
pt_step              Integer [Integer]
pt_up_step           Integer [Integer]
alt_src_step         Integer
sub_delay            Float [Integer]
sub_step             Integer [Integer]
osd                  [Integer]
osd_show_text        String
volume               Integer [Integer]
use_master
mute
contrast             Integer [Integer]
gamma                Integer [Integer]
brightness           Integer [Integer]
hue                  Integer [Integer]
saturation           Integer [Integer]
frame_drop           [Integer]
sub_pos              Integer [Integer]
sub_alignment        [Integer]
sub_visibility
vobsub_lang          [Integer]
sub_select           [Integer]
sub_log
get_percent_pos
get_time_length
switch_audio
tv_step_channel      Integer
tv_step_norm
tv_step_chanlist
tv_set_channel       String
tv_last_channel
tv_set_freq          Float
tv_set_norm          String
tv_set_brightness    Integer
tv_set_contrast      Integer
tv_set_hue           Integer
tv_set_saturation    Integer
forced_subs_only
dvb_set_channel      Integer Integer
switch_ratio         [Float]
vo_fullscreen
vo_ontop
vo_rootwin
screenshot
panscan              Float [Integer]
switch_vsync         [Integer]
loadfile             String
loadlist             String
run                  String
change_rectangle     Integer Integer
gui_loadfile
gui_loadsubtitle
gui_about
gui_play
gui_stop
gui_playlist
gui_preferences
gui_skinbrowser
menu                 String
set_menu             String [String]
help
exit
hide                 [Integer]
get_vo_fullscreen
get_sub_visibility
    

To get TV-Out working, you need to follow an approach, different from that outlined in the README.ivtvfb documentation. Instead of using the fbdev driver, you need the special purpose ivtvdev driver. The driver is distributed with ivtv source, as a binary X server module. You need to copy this driver to the /usr/X11R6/lib/modules/drivers/ivtvdev_drv.o file. The X driver works with both X flavours: XFree and Xorg. Unfortunately, using a dual screen (radeon + pvr tvout) gives me a hard crash with a frozen kernel.

Pitfalls:

Things to do:

  1. Get analog audio output from PVR 350 card
  2. Get digital output from SPDIF from PVR 350 card
  3. Install MythTV