Digital Video Broadcasting: Pinnacle 330e

After a long month of hard work, I am finally able to drop a few lines about my last computer results. Not much, considering how busy i was with my regular job, but anyway something.

Pinnacle Hybrid PCTV USB Stick (aka 330e)
[ID 2304:0226 Pinnacle Systems, Inc.] as for lsusb

I bought this device almost 18 months ago (if i remember well) and I managed to let it work in the DVB-T mode. The main problem was not the Empia chip this stick is based on, but rather the Micronas DRX3975d DVB-T demodulator. This chip was not yet supported by any kernelspace driver. A really smart German guy, Markus (www.mcentral.de) managed to get the specs for this demodulator directly from Micronas and finally managed to write a working driver.

The story for tis driver is rather long, and includes a long debacle on the linuxtv mailing list: the topic was the choice Markus adopted of writing an userspace driver rather than a kernelspace one. I don’t have the competences to understand the real differences in these two points of view, but in fact Markus, right or wring in his decision, is the only one who managed to write a driver for this device. Finally, thus, I managed to compile the driver for my USB TV stick and watch digital video broadcasting television.

I followed few easy steps to install it on my Gentoo box, posted by Markus on the mcentral.de mailing list. Up to this point i was using the v4l-dvb-experimental kernel module Markus himself wrote and that can be found on the mercurial repository at mcentral.de

$ hg clone http://mcentral.de/hg/~mrec/v4l-dvb-experimental
$ cd v4l-dvb-experimental
$ make
(as root) # make install

This code works well for the analog receiver and actually i was able to see television via tvtime, with the only remarks that tvtime does not use alsa and to hear something i had to bridge the audio from the stick to the audio board via sox.

# sox -r 48000 -w -c 2 -t ossdsp /dev/dsp1 -t ossdsp /dev/dsp

This way, however, the audio device was locked and no other application could use it. Now, with the new userspace driver AND with Markus hacked tvtime version (that uses finally ALSA) there is no need to the sox bridge

Kernel configuration

The userspace driver needs a different v4l kernel configuration as the one I used with the v4l-dbv-experimental.

At the moment I compiled it, my kernel version was 2.6.24-gentoo-r2.

In fact, I had to activate this options in the kernel config:

Device Drivers:
   <*> I2C Support --->
    < *>   I2C device interface
  
  Multimedia Devices --->
    < *> Video For Linux
    [*]   Enable Video For Linux API 1 (DEPRECATED) (NEW)
    -*-   Enable Video For Linux API 1 compatible Layer
    [*] Video capture adapters --->
      [*]   V4L USB devices:
      <M>   Empia EM2800/2820/2840 USB video capture support
    < *> DVB for Linux

It is really important to compile the Empia driver as a module, as after compiling the kernel and having installed the modules, copied the kernel image and the system map (as usual) and rebooted the system, you have to delete the Empia module.

This are the original instructions by Markus:

Be sure, that you compile the Empia drivers as a module!
We just compile them to set dependent kernel options like CONFIG_VIDEO_IR and
CONFIG_VIDEO_IR_I2C
and delete them after compiling

Then compile the kernel by doing the usual:
# make
# make modules_install

Now copy the new kernel image on your boot partition and reboot
# mount /boot
# cp arch/i386/boot/bzImage /boot/kernel-2.6.24-gentoo
# cp System.map /boot/
# reboot

Now delete the previous built Empia driver:
# rm `find /lib/modules/ | grep em28xx.ko`

Driver Installation

be sure to have mercurial installed (emerge mercurial, for Gentoo users…) then follow these easy steps (alway by Markus):

# cd ~
# mkdir em28xx
# cd em28xx
# hg clone http://mcentral.de/hg/~mrec/userspace-drivers
# cd userspace-drivers
# sh build.sh

# cd ..
# hg clone http://mcentral.de/hg/~mrec/em28xx-userspace2
# cd em28xx-userspace2
# sh build.sh

If all went fine, install the new driver:
# make install

Load the media-stub module:
# modprobe media-stub

Now check if the media-daemon is started:
# /etc/init.d/media-daemon status
* status: started

or start it the usual way:
/etc/init.d/media-demon start

Then load the driver (if not already there, see the usual lsmod):
# modprobe em28xx-dvb

If the device seems to be not available after a reboot, just reload the
driver:
# modprobe -r em28xx-dvb
# modprobe -r em28xx-audio
# modprobe em28xx-dvb

At this point you should be ready for watching Digital Television: it worked fine for me with Kaffeine.

Analog TV: tvtime, the way of Markus

What about analog tv? If you try to fire up the “vanilla” tvtime that comes along with the gentoo repository, you’ll get some troubles with the audio, and even the trick i mentioned above won’t help with th userspace drivers (at least, so it happened to me…). We need tvtime from Markus’ mercurial repository.

$ hg clone http://mcentral.de/hg/~mrec/tvtime
$ cd tvtime
$ ./configure --prefix=/usr
$ make
(as root) # make install

The trick is done! Feel free to drop a line in case of trouble! 🙂