patch for bktr(4): don't reset tuner on open/close

Lluis López cronopiolopez at
Sun Apr 24 08:44:34 PDT 2005

On 4/24/05, Julian Elischer <julian at> wrote:

> Luis López Solé, and Tomomi Suzuki are apparently active in this field
> and Stacey Son has been mentionned similarly.
Answer for alusions. My work (see attach) is a port to Hauppauge
pvr250/350 of work make by Tomomi Suzuki. His work is more card
dependent and only work with YUAN and IO-DATA cards. This cards have
more capabilities don't supported by Hauppauge cards (Ghost reducer
chip, YC/3D audio and support for other devices like saa7173 video
decoder and new two audio chips).
Ported features are:
- complete encoder interface, new (and more completed) video controls
and v4l2 interface. The new controls and all ioctl interface (except
v4l2) are tuned via /dev/cxm0.ctl device.
- A GUI application for control all this (see in
tools/cxm_controler/readme.txt in source), this allows live time
switching channels, inputs or profile encoder types (only between
profiles with the same resolution).
-Some addeds for me: some new profiles in codec_profiles, this are
based in stream types of ivtv.h, but values are me decision and accept
suggestions for correct values. Two new sysctl's for fix tuner and
audio chip, but I think don't work properly (need some help in tuner
and audio loads).
This driver is tested in my home machine. This have a pvr250 rev2 and
pvr350 rev1 in both seems work well.

In v4l2 question. In code (see cxm_ioctl and cxm.c -starts on line
5866-) seems this takes a Mike Son v4l2 interface wtih some addeds.
This have a v4l2 interface mapped on /dev/cxm0.v4l2 device,  you can
enable this via sysctl command:
# sysctl -w hw.cxm0.tuner.v4l2_crtl=1
I don't have time for testing this issues but
# file -s /dev/cxm0.v4l2
/dev/cxm0.v4l2: MPEG system stream data.
The great problem is that all aplications don't enable v4l interface
because don't find apropiate header files in path.

If somebody wants to test this driver follow the next steps:

1. You need a cxm driver working on your machine. For security reason
you want backup your old modules in /boot/kernel.old/ and (if yuo
have) coment lines cxm_iic_load="YES"  cxm_load="YES" in your

2. More warnings. If you have a kernel with:
device          smbus
device          smb
device          iic
device          iicsmb
Coment this lines and recompiles and loads a new kernel (if take this
option backup of modules are automatic). If not, if some of devices
isn't supported expects hangs and dirty reboots. In this case (or if
simple don't work) you can send me a dmesg -a|grep cxm and pciconf -lv
output of the old driver (multimedia/pvr250) and If I can, add support
for you. In this moment only PHILIPS FQ1216ME and Microtune 4049 FM5
are unsupported. Finally if all works you can uncomment this lines and
recompile again.

3. Compile and test:
# cd /tmp
#tar zxvf /path/to/ivtv4bsd-alpha.tar.gz
#cd ivtv4bsd/
#cp modules/cxm/cxm/cxm.ko modules/cxm/cxm_iic/cxm_iic.ko  /boot/kernel/
#kldunload cxm
#kldunload cxm_iic
#kldload cxm_iic
#kldload cxm
And next type dmesg|grep cxm and you see something like this:
cxm0: <Conexant iTVC15 MPEG Coder> mem 0xd8000000-0xdbffffff irq 18 at
device 2.0 on pci2
cxm0: <HAUPPAGE PVR350 Ver.1>
pcib2: device cxm0 requested decoded memory range 0xd8000000-0xdbffffff
cxm_iic0: <Conexant iTVC15 / iTVC16 I2C controller> on cxm0
iicbb0: <I2C bit-banging driver> on cxm_iic0
cxm0: Philips FM1216 tuner
cxm0: SAA7115 rev 1 video decoder
cxm0: MSP4418G-A2 audio decoder
cxm0: IR Remote
cxm0: encoder firmware version 0x2040024
cxm0: decoder firmware version 0x2020023
cxm1: <Conexant iTVC16 MPEG Coder> mem 0xd4000000-0xd7ffffff irq 19 at
device 3.0 on pci2
cxm1: <HAUPPAGE PVR250 Ver.2>
pcib2: device cxm1 requested decoded memory range 0xd4000000-0xd7ffffff
cxm_iic1: <Conexant iTVC15 / iTVC16 I2C controller> on cxm1
iicbb1: <I2C bit-banging driver> on cxm_iic1
cxm1: Philips FM1216 tuner
cxm1: SAA7115 rev 1 video decoder
cxm1: MSP4418G-A2 audio decoder
cxm1: IR Remote

4. Applications.
cd to tools directory and type make. Only cxm_ctl, cxm_show_props and
probe_saa7115 works for Hauppage. After you can cd to cxm_controler
directory and see readme.txt (cxm_controler needs gtk2 libs).

1. Problems with NICAM supports.
I need remove NICAM audio support in cxm_audio.c, if not live switch
between channels don't works properly and all tuner stations don't
have sound. When removes NICAM supports all works properly, but some
channels don't have sound (for exemple 37 in bg pal standard).
2. The Default profile is dvd_s1_pal. You can change this via cxm_ctl
or via cxm_controler. This profile specs: 720x576 res. 4 Mb/s video
bitrate and 384 kb/s Layer II mp2 audio.
3. Number of channels of tuners needs a revision. I put 1 to 125 but
I'm sure this aren't correct values.

And last. I'm not a programmer only a librarian formed via RTFM and
this works for me but i'm not sure if works for you. I only promise my
limitaded help. Test with care.

Luis López Solé.

More information about the freebsd-multimedia mailing list