You are not logged in.

#1 2016-02-09 01:53:39

madmerlyn
Member
Registered: 2016-02-09
Posts: 3

Hauppauge HD PVR 2 Driver

They've finally "released" a driver for the HD PVR 2 (so I can record from my Xbox) but they've only compiled it on Ubuntu and have virtually no support. I've tried to compile it on my system but it keeps erroring out, I was wondering if anyone out there might be able to help me work through these makefiles to get the driver. The source is supposed to build a recording application too, but I'm only interested in the libusb driver to get it working in udev so I can hook it into OBS.

Here's the download for the driver:
http://hauppauge.lightpath.net/software … 210.tar.gz

And here's the compile error I'm getting:
../build-ADV7842/libADV7842.a(FX2Device.o): In function `FX2Device_t::loadFirmware()':
/builds/hauppauge_hdpvr2_driver_ver6b_157210/TestApp/build-ADV7842/../../Common/FX2API/FX2Device.cpp:89: undefined reference to `FX2Device_t::m_firmwareBytesLen'
/builds/hauppauge_hdpvr2_driver_ver6b_157210/TestApp/build-ADV7842/../../Common/FX2API/FX2Device.cpp:91: undefined reference to `FX2Device_t::m_firmwareBytes'
collect2: error: ld returned 1 exit status
Makefile:52: recipe for target 'HDPVR2-testApp' failed
make[1]: *** [HDPVR2-testApp] Error 1
make[1]: Leaving directory '/builds/hauppauge_hdpvr2_driver_ver6b_157210/TestApp/build'
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 2

Offline

#2 2016-02-10 18:15:59

zeezinj
Member
Registered: 2016-02-10
Posts: 2

Re: Hauppauge HD PVR 2 Driver

There is a solution to this problem.  It may or may not be related to Arch Linux building. 

There is another post to this problem, however, the solution does not work, at least not arch linux.  It does have the pack.sh problem detailed/solved.
https://forum.manjaro.org/index.php?topic=18213.0
The problem has to do with the compilation of the FX2Firmware.cpp and the calling application versus the FX2Device.h/cpp files. 

The solution is (if it's wanted to be attempted yourself) is to run manually and hard code the rule.mk file in the FX2API directory. 

FX2API/rules.mk
----------------------
FX2FIRMWARE_VAR = FX2Device_t::m_firmwareBytes

FX2Firmware.o: FX2Firmware.cpp

FX2Firmware.cpp: FX2Firmware.bin
    echo '#include "FX2Device.h"' > $@
    xxd -u -i $^ | sed -E 's/unsigned char [_a-zA-Z0-9]{1,}/const unsigned char $(FX2FIRMWARE_VAR)/' | sed -E 's/unsigned int [_a-zA-Z0-9]{1,}/const unsigned int $(FX2FIRMWARE_VAR)Len/' >> $@

Essentially it uses, xxd (a hex file interpreter / dumper) to output to the FX2Firmware.cpp the contents of firmware.bin.  However, just doing that doesn't seem to completely solve the problem, as it may (in theory) compile against the calling program, it does not, however, compile against FX2Device.h or FX2Device.cpp.

The lines (in FX2Device.h):
    static const unsigned char m_firmwareBytes[];
    static const unsigned int m_firmwareBytesLen;

are in theory linked to in the FX2Firmware.cpp and defined there (however, that file is not define in the FX2Device.h/cpp files and is only linked together with the parent segment of the total solution.  Meaning (as explained below), that the firmware.bin's data and length are defined at compile time, and overplayed to the "static" (global program or scope of FX2Device_t) and in a "const" (meaning unchanging except when compilation is done) definitions in FX2Device.h. 

When FX2Device_t::loadFirmware in FX2Device.cpp is called, the data and length of firmware.bin are available to the linking problem (as defined in FX2Firmware.cpp) but not specifically to the FX2Device.cpp, as it is supposed to be "static const" define, but the actual implementation must be available somewhere in the linking phase (?) of the program (i.e. when FX2Firmware.cpp is linked against FX2Device.h/cpp and the parenting program).  That means when they are overlayed together while linking, the defined memebers (in FX2Device.h) are implemented by a compile time dumping of firmware.bin to FX2Firmware.cpp (this is so that firmware.bin changes, the cpp portion of the program has an updated version of the information for usb interface.

The solution is at least the easiest (but not best) is to manually code those two items into the FX2Device.h.  However, if firmware.bin is changed, then it would not be correct anymore, and the xxd/sed (replacements) must be done again.

This current solution allows compile, and the recorder works.

Also, a line in pack.sh (elsewhere) needs to be modified to change $OS to linux (this is a minor change) (this occurs when 'sudo make install' are attempted).

The solution should be posted this afternoon (see below).

Last edited by zeezinj (2016-02-11 00:23:05)

Offline

#3 2016-02-11 00:24:03

zeezinj
Member
Registered: 2016-02-10
Posts: 2

Re: Hauppauge HD PVR 2 Driver

Here is a link to the updated source:

https://dl.dropboxusercontent.com/u/125 … nux.tar.xz

Offline

#4 2016-02-11 03:43:34

madmerlyn
Member
Registered: 2016-02-09
Posts: 3

Re: Hauppauge HD PVR 2 Driver

Thanks a bunch zeezinj!

Offline

#5 2018-02-10 22:31:55

atinker
Member
Registered: 2018-02-10
Posts: 7

Re: Hauppauge HD PVR 2 Driver

Hello,

I've recently got a HDPVR model 157320 and I am seeing the same errors as described above.

/opt/hdpvr2/hauppauge_hdpvr2_157320_patched_2016-09-26/TestApp/build-ADV7842/../../Common/FX2API/FX2Device.cpp:89: undefined reference to `FX2Device_t::m_firmwareBytesLen'
/opt/hdpvr2/hauppauge_hdpvr2_157320_patched_2016-09-26/TestApp/build-ADV7842/../../Common/FX2API/FX2Device.cpp:89: undefined reference to `FX2Device_t::m_firmwareBytesLen'
/opt/hdpvr2/hauppauge_hdpvr2_157320_patched_2016-09-26/TestApp/build-ADV7842/../../Common/FX2API/FX2Device.cpp:89: undefined reference to `FX2Device_t::m_firmwareBytes'
/opt/hdpvr2/hauppauge_hdpvr2_157320_patched_2016-09-26/TestApp/build-ADV7842/../../Common/FX2API/FX2Device.cpp:91: undefined reference to `FX2Device_t::m_firmwareBytes'
collect2: error: ld returned 1 exit status

I understand the solution is to add the references but I'm not sure where in the file they should be placed. The link to the updated source above no longer works. Please could you explain in a reasonable level of detail what the fix is. I am not a programmer.

Many thanks.

Last edited by atinker (2018-02-11 09:55:51)

Offline

Board footer

Powered by FluxBB