[pvrusb2] problems compiling the latest snapshot

Mike Isely isely at isely.net
Wed Jun 10 22:25:46 CDT 2009


Aljaž Prusnik <prusnik at gmail.com> wrote:
>
> Hi!
>
> I have problems compiling the latest snapshot driver. I'm constantly
> hitting on "no such file or directory" despite kernel sources being
> there where they're supposed to be (the log below). But despite
> including all the necessary files in the drivers directory (moving them
> form the source into pvrusb2/driver) I still get errors when compiling.
> Any ideas?
> This is Debian Lenny box, running a custom 2.6.29 or debian stock kernel
> from sid (2.6.29). Compiling against stock kernel 2.6.26 is ok.

Hi,

I actually use Debian as my development target, always building
custom kernels from a vanilla kernel base (i.e. from kernel.org).  It
sounds like you're doing the same thing.  But obviously no problems
here.

First of all, you should not need to move ANY files into the pvrusb2
drivers directory.  The instructions for building the driver don't
require this.  Rather, what you need to do is run "make" from inside
the drivers directory with KDIR pointing to where you have the kernel
source tree living.  And by "kernel source tree", I mean a snapshot of
the SAME source tree that you already used to build your kernel that
you intend to run.  One side effect of the 2.6 kernel build system is
that it generates additional files which are needed when building an
out-of-tree driver.  Thus you need an already-built kernel tree to
work from.

Just for the record, the above is not *strictly* true.  It is possible
to reclaim some disk space from that kernel tree.  Provided you first
preserve include/linux/bounds.h somewhere outside the tree, you can
run a "make clean" on the kernel tree then restore that bounds.h file
and you'll still have a tree that is usable for building an
out-of-tree driver.  You should not have to do that bit of silliness
with bounds.h - that's a bug in the kernel build system, introduced
IIRC some time around 2.6.26.  I filed a bugzilla entry against that
months ago but it seems that nobody cares enough to fix it so in the
mean time I've just saved / restored bounds.h before running a make
clean.  But to be really safe just use an already built tree.

All of the above is definitely true when building from a vanilla
kernel from kernel.org - where you're setting up the source tree
yourself.  However I believe the majority of pvrusb2 driver users out
there tend to stick to distro-supplied kernels, in which case the
procedure for obtaining and installing the corresponding kernel source
tree is distro-specific.  In any case though you definitely need to
have a kernel source tree somewhere that corresponds to the kernel
you're running and it must be already configured so that out-of-tree
drivers such as the pvrusb2 driver can be built from it.  To use that
tree, run "make" inside the pvrusb2 drivers directory with KDIR set to
point to where the kernel tree is located.  The detail for this can be
found here:

http://www.isely.net/pvrusb2/setup.html#Compilation

(It can also be found in the corresponding html file in the doc
directory of the pvrusb2 driver snapshot).

Reading on...


>
>
> Then I chose to compile it on mythbuntu 9.04. It did compile but when I
> connected the device the process stopped when it said it is loading the
> v4l-cx2341x-enc.fw file but tt is never loaded (it stops on the message
> "loading the firmware...". I tried the CD firmware, the beta 4.8a
> drivers. It's all the same.

Actually it probably *is* loaded.  The pvrusb2 driver prints the
message to indicate that the firmware is being loaded but it won't say
anything else beyond that point unless a problem occurs.

With the current pvrusb2 driver, the cx2341x firmware is loaded in a
'lazy' fashion.  That is to say the driver will completely initialize
everything without actually needing to immediately load that
firmware.  The cx2341x firmware corresponds to the mpeg encoder chip
and must be reloaded anyway any time that chip is reset.  The driver
can and will routinely reset that chip during normal operation - on
hybrid devices if you start in digital mode the encoder won't even be
touched unless the driver first has to drop to analog mode.  So seeing
that firmware message 'last' is not a problem.

Once you see a message like this:

pvrusb2: registered device video0 [mpeg]

Then the driver has completed its initialization successfully and is
basically ready to go.


>
> Since a couple of you are already running the latest snapshot, I was
> wondering how you did it. I have a HVR-1900 that still needs a working
> digital tuner, that's why I decided to try again with the new snapshot
> driver to check if the digital tuning indeed is fixed. But anyhow - any
> words on that additional firmware file I talked about a while ago? I
> found the firmware here as well for the HVR-1700 device:
> http://steventoth.net/linux/

Sorry, I haven't done anything here to make it easy to extract that
firmware.  But once you have the firmware file there's really nothing
else that the pvrusb2 driver would need to do anyway.  The loading of
*that* firmware image is something specific to the digital tuner and
so it's really the responsibility of the digital tuner's own driver
(which the pvrusb2 driver pulls in when it initializes) to take care
of loading that firmware image.

As far as loading and running the latest snapshot, AFAIK everything
there should be fine.  The procedure for building the driver,
installing it, and getting it to start has not changed in several
years.


>
>
> make INSTALL_MOD_DIR=pvrusb2 -C /lib/modules/2.6.29.4-custom/source
> M=/share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver
> CONFIG_VIDEO_PVRUSB2=m CONFIG_VIDEO_PVRUSB2_24XXX=y
> CONFIG_VIDEO_PVRUSB2_SYSFS=y CONFIG_VIDEO_PVRUSB2_DVB=y
> CONFIG_VIDEO_PVRUSB2_DEBUGIFC=y CONFIG_VIDEO_ADV_DEBUG=y modules

This is not the procedure I documented.  See earlier.  (However with
that said, what you have above may still work - it's just not what I
do.  I tried to set up the snapshot driver build so that it will
always "play well" with the kernel build system so what you're doing
may very well be fine.)



> make[1]: Entering directory `/home/public/temp/kernel/linux-2.6.29.4'
>   CC
> [M]  /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-ctrl.o
> In file included
> from /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-devattr.h:28,
>
> from /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-hdw-internal.h:58,
>
> from /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-ctrl.c:24:
> /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-dvb.h:5:26: error: dvb_frontend.h: No such file or directory
> /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-dvb.h:6:23: error: dvb_demux.h: No such file or directory
> /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-dvb.h:7:21: error: dvb_net.h: No such file or directory
> /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-dvb.h:8:20: error: dmxdev.h: No such file or directory

Ooo.  I think I can guess this problem - did you configure DVB when
you built your kernel?  The standalone pvrusb2 driver requires the DVB
subsystem when it is being built under 2.6.26 or later - this is
because it has DVB interface and can make use of a few DVB-requiring
devices.  I imagine if you did not configure DVB in your kernel you
might have some compile problems like this.


> In file included
> from /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-devattr.h:28,
>
> from /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-hdw-internal.h:58,
>
> from /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-ctrl.c:24:
> /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-dvb.h:17: error: field â~@~Xdvb_adapâ~@~Y has incomplete type
> /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-dvb.h:18: error: field â~@~Xdmxdevâ~@~Y has incomplete type
> /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-dvb.h:19: error: field â~@~Xdemuxâ~@~Y has incomplete type
> /share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-dvb.h:20: error: field â~@~Xdvb_netâ~@~Y has incomplete type
> make[2]: ***
> [/share/dmz/hardware/Hauppauge/pvrusb2-mci-20090509/driver/pvrusb2-ctrl.o] Error 1

This is probably more "shrapnel" from not having DVB present in the
kernel.

It's been a while since I checked this part of the documentation, but
I need to verify that the pvrusb2 setup documentation points out the
need for DVB to be configured into the kernel...

  -Mike


-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8


More information about the pvrusb2 mailing list