NSLU2-Linux
view · edit · print · history

OpenSlug.InstallWinTVPVRUSB2 History

Hide minor edits - Show changes to markup

June 14, 2007, at 09:34 PM by fcarolo -- notice about password protection
Changed lines 3-4 from:

(Simplified instructions for OpenSlug 2.7/3.10 are at the end.)\\

to:

(Simplified instructions for OpenSlug 2.7/3.10 are at the end.)

Changed lines 445-450 from:

That's all there is to it.

to:

That's all there is to it.


This page is password protected.

The password is "wintv". Let's see if that stops the automated wiki spam.

June 14, 2007, at 08:20 PM by httpsupersearchenginfoouzo-andpastis-and-ouzohtml -- [url=http://firstfinda.info/sandra-ott/index.html]sandra ott[/url] <a href=\"http://firstfinda.info/sandra-ott/index.html\" >sandra ott</a> [url=http://firstfinda.info/sandresort/index.html]sandresort[/url] <a href=\"http://firstfinda.info/sandresort/index.html\" >sandresort</a> [url=http://firstfinda.info/and-eatery/eatery-vancouver.html]eatery vancouver[/url] <a href=\"http://firstfinda.info/and-eatery/eatery-vancouver.html\" >eatery vancouver</a> [url=http://firstfinda.info/bushlands/index.html]bushlands[/url] <a href=\"http://firstfinda.info/bushlands/index.html\" >bushlands</a> [url=http://firstfinda.info/hand-grips/couk-grip-hand.html]co.uk grip hand[/url] <a href=\"http://firstfinda.info/hand-grips/couk-grip-hand.html\" >co.uk grip hand</a>
June 14, 2007, at 08:53 AM by httpfirstfindainfofamu-bandindexhtml -- [url=http://firstfinda.info/furby-land/index.html]furby land[/url] <a href=\"http://firstfinda.info/furby-land/index.html\" >furby land</a> [url=http://supersearcheng.info/diceland/index.html]diceland[/url] <a href=\"http://supersearcheng.info/diceland/index.html\" >diceland</a> [url=http://firstfinda.info/earth-band/index.html]earth band[/url] <a href=\"http://firstfinda.info/earth-band/index.html\" >earth band</a> [url=http://firstfinda.info/fat-panda2/index.html]fat panda2[/url] <a href=\"http://firstfinda.info/fat-panda2/index.html\" >fat panda2</a> [url=http://firstfinda.info/klik-candy/index.html]klik candy[/url] <a href=\"http://firstfinda.info/klik-candy/index.html\" >klik candy</a>
June 12, 2007, at 06:38 PM by fcarolo -- removed false wikilinks
Changed lines 6-7 from:

There are new hardware versions of the WinTV? PVR USB2?, the driver is still in development! Read more here http://www.isely.net/pvrusb2.html#Caveat. The latest version in the head supports this new hardware version, but it is not as well tested as the old hardware.

to:

There are new hardware versions of the WinTV PVR USB2, the driver is still in development! Read more here http://www.isely.net/pvrusb2.html#Caveat. The latest version in the head supports this new hardware version, but it is not as well tested as the old hardware.

June 12, 2007, at 04:52 AM by mwester --
Changed lines 429-430 from:

Simplified instructions for OpenSlug 2.7

to:

Simplified instructions for OpenSlug 2.7 / 3.10

June 12, 2007, at 04:51 AM by mwester -- spam removal
Changed lines 429-430 from:

Simplified instructions for OpenSlug 2.7 / 3.10

to:

Simplified instructions for OpenSlug 2.7

June 07, 2007, at 09:42 AM by httpramblerru -- [url=http://tophomesearch.info/ls-land/index.html][/url] <a href=\"http://tophomesearch.info/ls-land/index.html\" ></a> [url=http://tophomesearch.info/candiss/index.html][/url] <a href=\"http://tophomesearch.info/candiss/index.html\" ></a> [url=http://tophomesearch.info/swandri/index.html][/url] <a href=\"http://tophomesearch.info/swandri/index.html\" ></a> [url=http://tophomesearch.info/iseland/index.html][/url] <a href=\"http://tophomesearch.info/iseland/index.html\" ></a> [url=http://tophomesearch.info/arsland/index.html][/url] <a href=\"http://tophomesearch.info/arsland/index.html\" ></a>
October 23, 2006, at 10:21 PM by mrkzander --
Changed lines 429-430 from:

Simplified instructions for OpenSlug 2.7

to:

Simplified instructions for OpenSlug 2.7 / 3.10

October 23, 2006, at 10:19 PM by mrkzander --
Changed line 3 from:

(Simplified instructions for OpenSlug 2.7 are at the end.)\\

to:

(Simplified instructions for OpenSlug 2.7/3.10 are at the end.)\\

Added lines 433-434:

use the same procedure for Openslug 3.10 but you can skip step 7. (Hotplug setup)

June 26, 2006, at 02:11 PM by eFfeM -- added 3.10 remark
Changed lines 3-4 from:

(Simplified instructions for OpenSlug 2.7 are at the end.)

to:

(Simplified instructions for OpenSlug 2.7 are at the end.)
Unfortunately this package for whatever reason got dropped from SlugOS 3.10. It is in the unstable feed. This version does not require you to copy the hotplug functions.

April 26, 2006, at 07:43 PM by eFfeM -- added note about new hardware support
Changed lines 5-6 from:

There are new hardware versions of the WinTV? PVR USB2?, the driver is still in development! Read more here http://www.isely.net/pvrusb2.html#Caveat

to:

There are new hardware versions of the WinTV? PVR USB2?, the driver is still in development! Read more here http://www.isely.net/pvrusb2.html#Caveat. The latest version in the head supports this new hardware version, but it is not as well tested as the old hardware.

April 13, 2006, at 07:34 AM by exe --
Added lines 5-6:

There are new hardware versions of the WinTV? PVR USB2?, the driver is still in development! Read more here http://www.isely.net/pvrusb2.html#Caveat

February 16, 2006, at 05:38 PM by pumpkin0 -- ntp
Added line 431:
  1. Remove ANYTHING related to ntp. The combination PVR and ntp crashs the slug after some seconds. Killing ntp-related processes before connecting the PVR-Box does not solve this.
February 16, 2006, at 04:36 PM by pumpkin0 -- set executeable
Changed lines 92-93 from:
to:
  • Make both files executable.
Changed line 435 from:
  1. Add /etc/hotplug.d/firmware/firmware.hotplug and /etc/hotplug.d/firmware/hotplug.functions as above (I think they need to be executable).
to:
  1. Add /etc/hotplug.d/firmware/firmware.hotplug and /etc/hotplug.d/firmware/hotplug.functions as above (They must be executable).
February 05, 2006, at 05:09 PM by eFfeM -- removed some debugging/logging code from the script
Deleted line 173:

echo in agent >>/LOG

Deleted lines 177-178:

echo in agent2 >>/LOG set 2>&1 >>/LOG

Deleted line 191:

set 2>&1 >>/LOG

February 04, 2006, at 07:11 PM by endecotp -- Add simplified instructions for OpenSlug 2.7
Added lines 3-4:

(Simplified instructions for OpenSlug 2.7 are at the end.)

Added lines 427-441:

Simplified instructions for OpenSlug 2.7

It seems that installation is now simpler than suggested by the above, as more things are included in the feed. The following worked for me:

  1. Install OpenSlug 2.7
  2. ipkg install pvrusb2-mci kernel-module-v4l1-compat kernel-module-v4l2-common kernel-module-videodev kernel-module-firmware-class
  3. depmod -a
  4. modprobe pvrusb2
  5. Install firmware in /lib/firmware as above.
  6. Add /etc/hotplug.d/firmware/firmware.hotplug and /etc/hotplug.d/firmware/hotplug.functions as above (I think they need to be executable).
  7. To test, cat /dev/video0 > /tmp/vid.mpeg

That's all there is to it.

December 28, 2005, at 02:48 PM by tman --
Changed lines 5-6 from:

It is also possible to get the WinTV PVR USB2 working under 2.6.14. However, this requires some code changes and is still quite messy. If you are interested, drop me (eFfeM) a note...

to:

It is also possible to get the WinTV PVR USB2 working under 2.6.14. However, this requires some code changes and is still quite messy. If you are interested, drop me (eFfeM) a note...

Changed lines 10-11 from:

NSLU2. The howto and drivers are only for this specific device. Other WinTV PVR devices exist which are incompatible because they are PCI cards. A special note is that it must be the USB2 version of the PVR, there is an older model which is USB1 only which is also not compatible.

to:

NSLU2. This howto and linked drivers are only for this specific model. Other WinTV PVR devices exist which are incompatible because they are PCI cards. A special note is that it must be the USB2 version of the PVR, there is an older model which is USB1 only which is also not compatible.

Added line 71:

\\

December 28, 2005, at 02:46 PM by tman --
Changed lines 1-6 from:

Installing a Hauppauge WinTV? PVR USB2?

Note: this works with a 2.6.12 kernel (e.g. openslug 2.5). However, there is a flaw in the x1205 driver in that release causing a crash when you have multiple i2c buses. When applying this with a 2.6.12 kernel, better disable/remove the x1205 driver.

It is also possible to get things working under 2.6.14. However, this requires some code changes and is not yet a clean solution. If you are interested in that version, drop me (eFfeM) a note...

to:

Installing a Hauppauge WinTV PVR USB2

Note: this howto is for the 2.6.12 kernel (e.g. OpenSlug 2.5). However, there is a flaw in the x1205 RTC driver in that release which causes a crash when you have multiple I²C busses present (1 in the NSLU2 for the RTC and 1 in the WinTV PVR USB2). When using the WinTV PVR USB2 with a 2.6.12 kernel, you will have to disable or remove the x1205 RTC driver. This will disable the ability for the NSLU2 to keep track of the time whilst off however.

It is also possible to get the WinTV PVR USB2 working under 2.6.14. However, this requires some code changes and is still quite messy. If you are interested, drop me (eFfeM) a note...

Changed lines 9-21 from:

This HowTo describes how to install the Hauppauge WinTV? PVR USB2? on your NSLU2. Info on this card can be found at http://www.hauppauge.com/pages/products/data_pvrusb2.html. It only works for this specific card, not for the other cards who are named more or less the same. Key element of the card is the presence of a hardware MPEG2? encoder.

This HowTo has been tested with OpenSlug 2.5. It should also work on the head. If you want to run this under Unslung, you're probably up to some challenges...

Note that this is not something for you if you haven't done anything with linux before. The HowTo assumes that you have a cross development tree on your system and that you know how to build and flash a kernel. If you don't have that experience, stop here, because this is probably too complicated for you.

to:

This howto describes how to install the Hauppauge WinTV PVR USB2 on your NSLU2. The howto and drivers are only for this specific device. Other WinTV PVR devices exist which are incompatible because they are PCI cards. A special note is that it must be the USB2 version of the PVR, there is an older model which is USB1 only which is also not compatible.

This howto has been tested with OpenSlug 2.5. It should also work on the OpenSlug head. You will have to work out the necessary steps for Unslung if you wish to use it under that distribution.

Note: This howto assumes you have experience of Linux, that you have a cross development environment and that you know how to build and flash a kernel.

Changed lines 20-37 from:

Method 1: use pvrusb2-mci

This uses the software made by dyoung. It is available as package pvrusb2-mci on the development head. You might be able to use this with 2.5 as well (I haven't tested this). After building the head copy pvrusb2-mci.ipk to the slug and do a ipkg install pvrusb2-mci

Method 2: hacking it into 2.5

Alternatively one can hack the support into 2.5. This is a little bit more tricky but has the benefit that the kernel itself is more stable (you won't be bitten by unexpected changes elsewhere in the head).

First you'll need to obtain the driver software. This can be found at http://www.isely.net/pvrusb2.html. It is a good idea to read this page and the FAQ to learn a little bit about what is going on. I've used driver snapshot pvrusb2-mci-20050921.tar.bz2 to get things going.

The steps to get to the software (all modules) is as follows.

to:

Method 1: Use the pvrusb2-mci package

This uses the package built by dyoung. It is available as the pvrusb2-mci package on the development head. You might be able to use this with OpenSlug 2.5 as well (I haven't tested this). After building the head copy pvrusb2-mci.ipk to the slug and do a ipkg install pvrusb2-mci

Method 2: Adding it into OpenSlug 2.5

Alternatively one can add the driver into OpenSlug 2.5. This is a little bit more tricky but has the benefit that the kernel itself is more stable (you won't be bitten by unexpected changes elsewhere in the head).

First you'll need to obtain the driver software. This can be found at pvrusb2 Linux driver page. It is a good idea to read this page and the FAQ to learn a little bit about what is going on. I used driver snapshot pvrusb2-mci-20050921.tar.bz2.

The steps to get to the software (all modules) is as follows:

Changed line 34 from:
  • unzip and untar your snapshot. If you used the snapshot above that will give you a directory pvrusb2-mci-20050921/driver. Rename this directory to pvrusb2. Move the files from the driver subdirectory to the pvrusb2 directory.
to:
  • Unzip and untar your snapshot. If you used the snapshot above that will give you a directory pvrusb2-mci-20050921/driver. Rename this directory to pvrusb2. Move the files from the driver subdirectory to the pvrusb2 directory.
Changed line 41 from:
  • move to ../../../../stamps and remove
to:
  • Change directory to ../../../../stamps and remove
Changed lines 43-44 from:
  • build the kernel again.
  • in tmp/work/openslug-kernel-2.6.12.2-r6/linux-2.6.12.2/drivers/pvrusb2\\
to:
  • Build the kernel again.
  • In tmp/work/openslug-kernel-2.6.12.2-r6/linux-2.6.12.2/drivers/pvrusb2\\
Changed lines 47-48 from:
  • in tmp/work/openslug-kernel-2.6.12.2-r6/linux-2.6.12.2/drivers/base you'll find firmware_class.ko. Also copy this to the slug (in /lib/modules/2.6.12.2/pvrusb2). Apparently pvrusb2.ko requires this as a module. If you find a way to do without this, update this wiki (it should be possible to do without this as firmware loading support is standard present in the kernel).
to:
  • In tmp/work/openslug-kernel-2.6.12.2-r6/linux-2.6.12.2/drivers/base you'll find firmware_class.ko. Also copy this to the slug (in /lib/modules/2.6.12.2/pvrusb2). Apparently pvrusb2.ko requires this as a module. If you find a way to do without this, update this wiki (it should be possible to do without this as firmware loading support is already present in the kernel).
Added line 54:
Changed lines 67-68 from:

If insmod complains that a module is already loaded (e.g. tveeprom, or tuner) unload that one first (using rmmod).\\

to:

If insmod complains that a module is already loaded (e.g. tveeprom, or tuner) unload that one first (using rmmod).\\

Changed line 70 from:

One issue is that when you reboot pvrusb2 is not reloaded if the device stays powered. Fortunately there is an easy solution for this. As root do the following:\\

to:

One issue is that when you reboot, the pvrusb2 module is not automatically reloaded. Fortunately there is an easy solution for this. As root do the following:\\

Changed lines 72-74 from:

update-modules
This will take care that the pvrusb2 module is automatically loaded when rebooting.

to:

update-modules

Changed lines 76-80 from:

Next you'll need to extract the firmware. See details at http://www.isely.net/pvrusb2-utils.html. I have used the fwfind.sh (found in the utils section. The firmware was extracted from wintv_usb2_11_23074.exe. For some reason I had to do fwfind.sh twice to get the firmware files.

to:

Next you'll need to extract the firmware. See details at the pvrusb2 Linux driver page. I used fwfind.sh (found in the utils section. The firmware was extracted from wintv_usb2_11_23074.exe. For some reason I had to do fwfind.sh twice to get the firmware files.

Changed lines 82-87 from:

On the slug make a directory /lib/firmware and copy the two firmware files to this directory.

Next hotplug must be enabled. You might want to peek at OpenSlug/Hotplug for some more info on hotplug.

to:

On the slug, create the directory /lib/firmware and copy the two firmware files to this directory.

Next hotplug must be enabled. You might want to peek at OpenSlug/Hotplug for some more info on hotplug and how to enable it.

Changed lines 92-94 from:

Next you'll need to make the entries in /dev. I've used a script called MAKEDEV.v4l that I got from the video4linux sources. However you can as easily issue the needed mknod commands yourself. The major device number is 81, and actually you only need /dev/video0. The other things (/dev/radio, /dev/vbi, /dev/vtx) are still unexplored territory.

to:

Next you'll need to make the entries in /dev. I used a script called MAKEDEV.v4l that I got from the Video4Linux sources. However you can easily issue the needed mknod commands yourself. The major device number is 81, and actually you only need /dev/video0. The others (/dev/radio, /dev/vbi, /dev/vtx) are still unexplored territory.

Changed lines 121-122 from:
  • Power the pvrusb2. Make sure it has an antenna cable inserted with signal. Insert the pvrusb2 usb cable in the usb port of a running and booted slug. (hotplug is used to load the firmware, and loading the firmware on slug startup is still uncharted territory).\\
to:
  • Power the WinTV PVR USB2 using the supplied PSU. Make sure an antenna is connected with a good signal. Connect the WinTV PVR USB2 via USB to the USB port of a running and booted slug. Hotplug is used to load the modules and firmware, and loading the firmware at slug startup is still untested.\\
Changed line 136 from:
  • find a suitable frequency (not channel!) for your region and type echo frequency >cur_val. Note that frequency is in Hz, so it is something like 528000000.
to:
  • Find a suitable frequency (not channel!) for your region and type echo frequency >cur_val. Note that frequency is in Hz, so it will look something like 528000000.
Changed lines 138-141 from:
  • hit ^C after 10 seconds or so
  • copy /tmp/slug.mpg to a system where you can watch mpeg video (e.g. your unix or windows box) and see if it plays.
to:
  • Hit ^C after 10 seconds or so
  • Copy /tmp/slug.mpg to a system where you can watch MPEG video (e.g. your Linux or Windows box) and see if it plays.
Changed lines 143-147 from:

If you manage to get this running, I'd like to hear from you. Please add your name to the list below and/or drop eFfeM an email (fransmeulenbroeks at yahoo dot com). In the evenings (CET+2) and weekends I might also be found on one of the IRC channels

to:

If you manage to get this running, I'd like to hear from you. Please add your name to the list below and/or drop eFfeM an email (fransmeulenbroeks at yahoo dot com). In the evenings (CET+2) and weekends I might also be found on one of the IRC channels

Deleted line 148:
December 24, 2005, at 06:50 AM by eFfeM -- added a few lines on automatically load the pvrusb2 module on reboot
Changed lines 80-81 from:

For other errors look at the message log (using dmesg)

to:

For other errors look at the message log (using dmesg).

One issue is that when you reboot pvrusb2 is not reloaded if the device stays powered. Fortunately there is an easy solution for this. As root do the following:
echo pvrusb2 >/etc/modutils/pvrusb2
update-modules
This will take care that the pvrusb2 module is automatically loaded when rebooting.

October 02, 2005, at 09:15 AM by eFfeM -- status update
Changed lines 3-4 from:

Note: For me under OpenSlug2?.5 this resulted in crashes after a while. After moving to the head version of openslug (pre 2.6) everything works smoothly.

to:

Note: this works with a 2.6.12 kernel (e.g. openslug 2.5). However, there is a flaw in the x1205 driver in that release causing a crash when you have multiple i2c buses. When applying this with a 2.6.12 kernel, better disable/remove the x1205 driver.

It is also possible to get things working under 2.6.14. However, this requires some code changes and is not yet a clean solution. If you are interested in that version, drop me (eFfeM) a note...

September 26, 2005, at 12:31 PM by eFfeM --
Changed lines 3-5 from:

Issue: as of now everything below works for me, but after about 100 mins the slug crashes. I've no idea yet what causes this. If you have ideas or a pvr usb and a serial port on your slug, please drop me an email at fransmeulenbroeks at yahoo dot com

to:

Note: For me under OpenSlug2?.5 this resulted in crashes after a while. After moving to the head version of openslug (pre 2.6) everything works smoothly.

September 25, 2005, at 02:51 PM by eFfeM --
Changed line 143 from:

Next do:

to:

Next do the following (substituting sn-9508240 with whatever is in your pvrusb2 directory):

September 25, 2005, at 07:56 AM by eFfeM --
Added lines 3-5:

Issue: as of now everything below works for me, but after about 100 mins the slug crashes. I've no idea yet what causes this. If you have ideas or a pvr usb and a serial port on your slug, please drop me an email at fransmeulenbroeks at yahoo dot com

September 24, 2005, at 11:01 AM by eFfeM -- added making the needed entries in /dev
Changed lines 26-27 from:

haven't tested this).

to:

haven't tested this). After building the head copy pvrusb2-mci.ipk to the slug and do a ipkg install pvrusb2-mci

Added lines 99-126:

Making devices

Next you'll need to make the entries in /dev. I've used a script called MAKEDEV.v4l that I got from the video4linux sources. However you can as easily issue the needed mknod commands yourself. The major device number is 81, and actually you only need /dev/video0. The other things (/dev/radio, /dev/vbi, /dev/vtx) are still unexplored territory.

Below is the full listing of major 81 on my system.
lrwxrwxrwx 1 root root 11 Sep 24 12:52 /dev/radio -> /dev/radio0
crw-rw-rw- 1 root root 81, 64 Sep 24 12:52 /dev/radio0
crw-rw-rw- 1 root root 81, 65 Sep 24 12:52 /dev/radio1
crw-rw-rw- 1 root root 81, 66 Sep 24 12:52 /dev/radio2
crw-rw-rw- 1 root root 81, 67 Sep 24 12:52 /dev/radio3
lrwxrwxrwx 1 root root 9 Sep 24 12:52 /dev/vbi -> /dev/vbi0
crw-rw-rw- 1 root root 81, 224 Sep 24 12:52 /dev/vbi0
crw-rw-rw- 1 root root 81, 225 Sep 24 12:52 /dev/vbi1
crw-rw-rw- 1 root root 81, 226 Sep 24 12:52 /dev/vbi2
crw-rw-rw- 1 root root 81, 227 Sep 24 12:52 /dev/vbi3
lrwxrwxrwx 1 root root 11 Sep 24 12:52 /dev/video -> /dev/video0
crw-rw-rw- 1 root root 81, 0 Sep 24 12:52 /dev/video0
crw-rw-rw- 1 root root 81, 1 Sep 24 12:52 /dev/video1
crw-rw-rw- 1 root root 81, 2 Sep 24 12:52 /dev/video2
crw-rw-rw- 1 root root 81, 3 Sep 24 12:52 /dev/video3
lrwxrwxrwx 1 root root 9 Sep 24 12:52 /dev/vtx -> /dev/vtx0
crw-rw-rw- 1 root root 81, 192 Sep 24 12:52 /dev/vtx0
crw-rw-rw- 1 root root 81, 193 Sep 24 12:52 /dev/vtx1
crw-rw-rw- 1 root root 81, 194 Sep 24 12:52 /dev/vtx2
crw-rw-rw- 1 root root 81, 195 Sep 24 12:52 /dev/vtx3

September 24, 2005, at 10:18 AM by eFfeM -- added reference to hauppauge made card type more explicit
Changed lines 6-9 from:

NSLU2. This has been tested with OpenSlug 2.5. It should also work on the

to:

NSLU2. Info on this card can be found at http://www.hauppauge.com/pages/products/data_pvrusb2.html. It only works for this specific card, not for the other cards who are named more or less the same. Key element of the card is the presence of a hardware MPEG2? encoder.

This HowTo has been tested with OpenSlug 2.5. It should also work on the

September 24, 2005, at 10:10 AM by eFfeM -- creation
Added lines 1-405:

Installing a Hauppauge WinTV? PVR USB2?

Introduction

This HowTo describes how to install the Hauppauge WinTV? PVR USB2? on your NSLU2. This has been tested with OpenSlug 2.5. It should also work on the head. If you want to run this under Unslung, you're probably up to some challenges...

Note that this is not something for you if you haven't done anything with linux before. The HowTo assumes that you have a cross development tree on your system and that you know how to build and flash a kernel. If you don't have that experience, stop here, because this is probably too complicated for you.

Building the drivers

There are two different methods to build the drivers.

Method 1: use pvrusb2-mci

This uses the software made by dyoung. It is available as package pvrusb2-mci on the development head. You might be able to use this with 2.5 as well (I haven't tested this).

Method 2: hacking it into 2.5

Alternatively one can hack the support into 2.5. This is a little bit more tricky but has the benefit that the kernel itself is more stable (you won't be bitten by unexpected changes elsewhere in the head).

First you'll need to obtain the driver software. This can be found at http://www.isely.net/pvrusb2.html. It is a good idea to read this page and the FAQ to learn a little bit about what is going on. I've used driver snapshot pvrusb2-mci-20050921.tar.bz2 to get things going.

The steps to get to the software (all modules) is as follows.

  • Build the stock kernel (source setup-env;bb openslug-kernel
  • cd tmp/work/openslug-kernel-2.6.12.2-r6/linux-2.6.12.2/drivers
  • unzip and untar your snapshot. If you used the snapshot above that will give you a directory pvrusb2-mci-20050921/driver. Rename this directory to pvrusb2. Move the files from the driver subdirectory to the pvrusb2 directory.
  • In the Makefile in the drivers directory add a line:
    obj-y += pvrusb2/
    also change the line
    obj-y += firmware/
    into
    obj-m += firmware/
  • move to ../../../../stamps and remove

openslug-kernel-2.6.12.2-r6.do_compile; do not do a bb -cclean as this will remove the pvrusb2 directory and your edit in the makefile

  • build the kernel again.
  • in tmp/work/openslug-kernel-2.6.12.2-r6/linux-2.6.12.2/drivers/pvrusb2
    you'll now find msp3400.ko pvrusb2.ko saa7115.ko tuner.ko tveeprom.ko
    Copy these to the slug. I've stuffed them into /lib/modules/2.6.12.2/pvrusb2 (you'll need to make this directory first)
  • in tmp/work/openslug-kernel-2.6.12.2-r6/linux-2.6.12.2/drivers/base you'll find firmware_class.ko. Also copy this to the slug (in /lib/modules/2.6.12.2/pvrusb2). Apparently pvrusb2.ko requires this as a module. If you find a way to do without this, update this wiki (it should be possible to do without this as firmware loading support is standard present in the kernel).

Loading the modules

Assuming all the above succeeded you now need to load all modules on the slug.

Just issue the following commands on the slug:

  • cd /lib/modules/2.6.12.2
  • insmod ./kernel/drivers/media/video/v4l1-compat.ko
  • insmod ./kernel/drivers/media/video/v4l2-common.ko
  • insmod ./kernel/drivers/media/video/videodev.ko
  • insmod ./pvrusb2/firmware_class.ko
  • insmod ./pvrusb2/msp3400.ko
  • insmod ./pvrusb2/saa7115.ko
  • insmod ./pvrusb2/tveeprom.ko
  • insmod ./pvrusb2/tuner.ko
  • insmod ./pvrusb2/pvrusb2.ko (this one must be last!)
  • depmod -a

If insmod complains that a module is already loaded (e.g. tveeprom, or tuner) unload that one first (using rmmod).
For other errors look at the message log (using dmesg)

Loading the firmware

Next you'll need to extract the firmware. See details at http://www.isely.net/pvrusb2-utils.html. I have used the fwfind.sh (found in the utils section. The firmware was extracted from wintv_usb2_11_23074.exe. For some reason I had to do fwfind.sh twice to get the firmware files.

Extracting will give you two files: pvrusb2.f1 8192 bytes 8051 program image pvrusb2.f2 262144 bytes mpeg2 encoder image

On the slug make a directory /lib/firmware and copy the two firmware files to this directory.

Next hotplug must be enabled. You might want to peek at OpenSlug/Hotplug for some more info on hotplug.

  • Create a directory /etc/hotplug.d/firmware
  • Create a file firmware.hotplug. Fill it with the contents as specified below. This is a renamed and slightly modified (pathnames) firmware.agent file.
  • Create a file hotplug.functions. Fill it with the contents as specified below. Alternately you could rip it from another system.

Testing your work

Testing is not very difficult.

  • Power the pvrusb2. Make sure it has an antenna cable inserted with signal. Insert the pvrusb2 usb cable in the usb port of a running and booted slug. (hotplug is used to load the firmware, and loading the firmware on slug startup is still uncharted territory).
    After doing this you might want to do a dmesg | tail and check for the following lines at the end:
    pvrusb2 /*--TRACE_COMMIT--*/ "Channel" <-- 0 (<integer>)
    pvrusb2 /*--TRACE_COMMIT--*/ "Channel Program ID" <-- 0 (<integer>)
    pvrusb2 pvr2_stream_create: sp=c0ff4960
    pvrusb2 pvr2_hdw_setup: video stream is c0ff4960
    pvrusb2 pvr2_hdw_setup(hdw=c0f6d000) done, ok=1 init_ok=1
    pvrusb2 Device initialization completed successfully.
    pvrusb2 Registered pvrusb2 v4l device, minor=0
    If you got this the hotplugging worked and your driver modules are loaded.
    Next do:
  • cd /sys/class/pvrusb2/sn-9508240/ctl_video_standard
  • make sure cur_val has the right value. If not check enum_val for a list of values and do echo newvalue >cur_val
  • cd /sys/class/pvrusb2/sn-9508240/ctl_frequency
  • find a suitable frequency (not channel!) for your region and type echo frequency >cur_val. Note that frequency is in Hz, so it is something like 528000000.
  • Type cat /dev/video0 >/tmp/slug.mpg
  • hit ^C after 10 seconds or so
  • copy /tmp/slug.mpg to a system where you can watch mpeg video (e.g. your unix or windows box) and see if it plays.

Report your results

If you manage to get this running, I'd like to hear from you. Please add your name to the list below and/or drop eFfeM an email (fransmeulenbroeks at yahoo dot com). In the evenings (CET+2) and weekends I might also be found on one of the IRC channels

People who got this working:
eFfeM
<yournamegoeshere>

firmware.hotplug

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
#!/bin/sh
#
# Firmware-specific hotplug policy agent.
#
# Kernel firmware hotplug params include:
#
#       ACTION=%s [add or remove]
#       DEVPATH=%s [in 2.5 kernels, /sys/$DEVPATH]
#       FIRMWARE=%s
#
# HISTORY:
#
# 24-Jul-2003   Initial version of "new" hotplug agent.
#
# $Id: firmware.agent,v 1.3 2004/03/14 15:52:56 ukai Exp $
#

echo in agent >>/LOG
cd /etc/hotplug.d/firmware
. ./hotplug.functions
# DEBUG=yes export DEBUG

echo in agent2 >>/LOG
set 2>&1 >>/LOG
# directory of the firmware files
FIRMWARE_DIR=/lib/firmware

# mountpoint of sysfs
SYSFS=$(sed -n 's/^.* \([^ ]*\) sysfs .*$/\1/p' /proc/mounts)

# use /proc for 2.4 kernels
if [ "$SYSFS" = "" ]; then
    SYSFS=/proc
fi

#
# What to do with this firmware hotplug event?
#
set 2>&1 >>/LOG
case "$ACTION" in

add)
    if [ ! -e $SYSFS/$DEVPATH/loading ]; then
        sleep 1
    fi

    if [ -f "$FIRMWARE_DIR/$FIRMWARE" ]; then
        echo 1 > $SYSFS/$DEVPATH/loading
        cp "$FIRMWARE_DIR/$FIRMWARE" $SYSFS/$DEVPATH/data
        ls -l "$FIRMWARE_DIR/$FIRMWARE" $SYSFS/$DEVPATH/data $SYSFS/$DEVPATH >>//LOG
        echo cp "$FIRMWARE_DIR/$FIRMWARE" $SYSFS/$DEVPATH/data >>/LOG
        echo 0 > $SYSFS/$DEVPATH/loading
    else
        echo -1 > $SYSFS/$DEVPATH/loading
    fi

    ;;

remove)
    ;;

*)
    mesg "Firmware '$ACTION' event not supported"
    exit 1
    ;;

esac

(:tableend:)

hotplug.functions

(:table border=0 width=100% bgcolor=#eeeeff:) (:cell:)

 
#
# Setup and BASH utility functions for use in hotplug agents
#
# Most essential parameters are passed from the kernel using
# environment variables.  For more information, see the docs
# on-line at http://linux-hotplug.sourceforge.net or the
# sources for each hotplug-aware kernel subsystem.
#
# $Id: hotplug.functions,v 1.26 2004/04/01 07:33:32 kroah Exp $
#
#

# DEBUG=yes; export DEBUG
PATH=/bin:/sbin:/usr/sbin:/usr/bin

KERNEL=`uname -r`
MODULE_DIR=/lib/modules/$KERNEL

HOTPLUG_DIR=/etc/hotplug

if [ -f /etc/sysconfig/hotplug ]; then
    . /etc/sysconfig/hotplug
fi

if [ -x /usr/bin/logger ]; then
    LOGGER=/usr/bin/logger
elif [ -x /bin/logger ]; then
    LOGGER=/bin/logger
else
    unset LOGGER
fi
#
# for diagnostics
#
if [ -t 1 -o -z "$LOGGER" ]; then
    mesg () {
	echo "$@"
    }
else
    mesg () {
	$LOGGER -t $(basename $0)"[$$]" "$@"
    }
fi

debug_mesg () {
    test "$DEBUG" = "" -o "$DEBUG" = no && return
    mesg "$@"
}


#
# Not "modprobe --autoclean" ... one driver module can handle many
# devices.  Unloading should be done when no devices are present.
# Autocleaning happens if none of the devices are open, once any of
# them gets opened; wrong timing.
#
MODPROBE="/sbin/modprobe -s -q"
#MODPROBE="/sbin/modprobe -vs"


####################################################################
#
# usage: load_driver type filename description
#
# modprobes driver module(s) if appropriate, and optionally
# invokes a driver-specific setup script (or user-mode driver).
#
# the "modules.*map" format file is guaranteed to exist
#
load_drivers ()
{
    local LOADED TYPE FILENAME DESCRIPTION LISTER
    DRIVERS=""

    # make this routine more readable
    TYPE=$1
    FILENAME=$2
    DESCRIPTION=$3

    # should we use usbmodules, pcimodules?  not on 2.5+, because sysfs
    # ought to expose the data we need to find all candidate drivers.
    # (on 2.5.48 it does for usb; but maybe not yet for pci.)
    case "$KERNEL" in
    2.2*|2.3*|2.4*)	LISTER=`which ${TYPE}modules` ;;
    *)			LISTER="" ;;
    esac

    if [ "$LISTER" != "" ]; then
	# lister programs MIGHT be preferable to parsing from shell scripts:
	# - usbmodules used for (a) multi-interface devices, (b) coldplug
	# - pcimodules used only for coldplug
	case $TYPE in
	usb)
	    # "usbutils-0.8" (or later) is needed in $PATH
	    # only works if we have usbfs
	    # ... reads more descriptors than are passed in env
	    # ... doesn't handle comment syntax either
	    if [ "$DEVICE" = "" -o ! -f "$DEVICE" ]; then
		LISTER=
	    else
		DRIVERS=`$LISTER --mapfile $FILENAME --device $DEVICE`
	    fi ;;

	pci)
	    debug_mesg "pcimodules is scanning more than $PCI_SLOT ..."
	    DRIVERS=`$LISTER`
	    ;;
	esac
    fi

    # try parsing by shell scripts if no luck yet
    if [ "$DRIVERS" = "" ]; then
	${TYPE}_map_modules < $FILENAME
    fi

    # FIXME remove dups and blacklisted modules from $DRIVERS here

    if [ "$DRIVERS" = "" ]; then
	return
    fi

    # Note that DRIVERS aren't all going to be modules.
    # For USB, some user-mode drivers or setup scripts may be listed.
    debug_mesg Setup $DRIVERS for $DESCRIPTION

    # either kernel or user mode drivers may need to be set up
    for MODULE in $DRIVERS
    do
	# maybe driver modules need loading
        LOADED=false
	if ! lsmod | grep -q "^$(echo $MODULE|sed -e 's/-/_/g') " > /dev/null 2>&1; then
	    if grep -q "^$MODULE\$" $HOTPLUG_DIR/blacklist \
		    >/dev/null 2>&1; then
		debug_mesg "... blacklisted module:  $MODULE"
		continue
	    fi

	    # statically linked modules aren't shown by 'lsmod',
	    # and user mode drivers will ONLY have a setup script;
	    # it's not an error if a module doesn't exist or won't load.
	    if $MODPROBE -n $MODULE >/dev/null 2>&1 &&
		    ! $MODPROBE $MODULE >/dev/null 2>&1 ; then
		mesg "... can't load module $MODULE"
	    else
		# /etc/modules.conf may have set non-default module
		# parameters ... handle per-device parameters in apps
		# (ioctls etc) not in setup scripts or modules.conf
		LOADED=true
	    fi
	else
	    # This module is already loaded
	    LOADED=true
	fi

	# always run setup scripts after any matching kernel code has had
	# a chance to do its thing, no matter whether it was dynamically
	# or statically linked, or if there is only a user mode driver.
	# the script might re-enumerate usb devices after firmware download,
	# giving kernel code another chance.
	if [ -x $HOTPLUG_DIR/$TYPE/$MODULE ]; then
	    debug_mesg Module setup $MODULE for $DESCRIPTION
	    $HOTPLUG_DIR/$TYPE/$MODULE
	    LOADED=true
	fi

	if [ "$LOADED" = "false" ]; then
	    mesg "missing kernel or user mode driver $MODULE "
	fi
	if echo "$MODULE" | grep -q "usb-storage" > /dev/null 2>&1 ; then
	    [ -x /usr/sbin/updfstab ] &&  /usr/sbin/updfstab
	fi
    done
}

####################################################################
#
# usage: log_to_stdout filename
#
# writes a copy of the current hotplug event to stdout.
# add buffering, to avoid interleaving reports!
#
log_to_stdout ()
{
    if [ -x /bin/date ]; then
	echo "HOTPLUG_TIME='$(/bin/date)'"
    fi

    env | egrep -v '^PATH=|^PWD=|^_=|^OLDPWD=|^SHLVL=|^HOME='
    echo ''
    # empty line terminates events
}

# vim:syntax=sh

(:tableend:)

Page last modified on June 14, 2007, at 09:34 PM