Trouble getting modified src to make into my active directory

Trying to modify the cx231xx-cards.c file to add an idProduct for a Hauppage device sold under a different brand. I am running into issues when trying to get it to make and roll into my /lib/modules/package/osmc/package/drivers directories. I am running a Rbp 3 B+ and OSMC 4.14.34-6. I am a bit of a linux noob, but I try to do as much research as I can with the limited knowledge bases I know about.

this is what I am doing so far (all with sudo)

apt-get update
apt-get install build-essential git
git clone https://github.com/osmc/osmc #from my Home directory
cd /osmc/package/kernel-osmc
make rbp2

The make of the will work, and get all the sources and compile the *.ko files.
But when I do

make modules_install

I get an error

make: *** No rule to make target ā€˜modules_installā€™. Stop.

Doing some research I find that I need to in the linux folder.
So I go to

/osmc/package/kernel-osmc/src/linux-4.14.34

and then run make modules_install again, it runs through this time without error.
From the linux-4.14.34 directory, if I run

make install

I get the error

Aborting due to one or more missing device tree overlays.
run-parts: /etc/kernel/postinst.d/process-vmlinuz-rbp exited with return code 1
arch/arm/boot/Makefile:96: recipe for target 'install' failed
make[1]: *** [install] Error 1
arch/arm/Makefile:340: recipe for target 'install' failed
make: *** [install] Error 2

I am at a loss. I have not even gotten to the point of modifying the .c file, but I need help. So many guides I have tried after doing a fresh install over and over again, and the are all out dated or just donā€™t work in this application. Any help would be appreciated.

Run make rbp2; wait for compile to finish.
When it does, cp your .c file, to .c.old, make changes and diff -u original new.c and create a patch which you can put under patches/rbp/999-fix-something.patch.

Sam

1 Like

Forgot to mention: if the patch is beneficial for other users; weā€™d be happy to accept a PR for this.

Sam

Thanks! It might be beneficial if I can get it working. It is for an Airtv ATSC/QAM tuner that has all the hardware that is the same as the Hauppauge WinTv-HDV-955Q, and in windows it comes up as a HDV-955Q. The Vid is the same of 2040, but the Pid is different as the Airtv is b124 and the 955Q is b123.
I have made a udev .rules file that adds in the new_id for the device, but I am having trouble getting it to register enough to work with TvHeadend. I have the LED lights on the device now lighting up. I will keep at it, and maybe some who read this will have more insight to getting it to work if possible. I think on of the main problems is that it is not grabbing the card=/n that I want it to.

You can force a match on the VID/PID temporarily via sysfs to see if it helps.
Poor manā€™s solution would be to add it to rc.local if it does.

Sam

yeah, that is what my udev .rules file I made is doing, and it just is not linking for some reason.

This is the output from journalctl -f after adding the new_id.

osmc kernel: cx231xx 1-1.1.3:1.1: New device Hauppauge Hauppauge Device @ 480 Mbps (2040:b124) with 7 interfaces
osmc kernel: cx231xx 1-1.1.3:1.1: Identified as Unknown CX231xx video grabber (card=0)
osmc kernel: i2c i2c-4: Added multiplexed i2c bus 6
osmc kernel: i2c i2c-4: Added multiplexed i2c bus 7
osmc kernel: cx231xx 1-1.1.3:1.1: v4l2 driver version 0.0.3
osmc kernel: cx231xx 1-1.1.3:1.1: Unknown tuner type configuring SIF
osmc kernel: cx231xx 1-1.1.3:1.1: Registered video device video0 [v4l2]
osmc kernel: cx231xx 1-1.1.3:1.1: Registered VBI device vbi0
osmc kernel: cx231xx 1-1.1.3:1.1: audio EndPoint Addr 0x83, Alternate settings: 3
osmc kernel: cx231xx 1-1.1.3:1.1: video EndPoint Addr 0x84, Alternate settings: 5
osmc kernel: cx231xx 1-1.1.3:1.1: VBI EndPoint Addr 0x85, Alternate settings: 2
osmc kernel: cx231xx 1-1.1.3:1.1: sliced CC EndPoint Addr 0x86, Alternate settings: 2
osmc kernel: cx231xx 1-1.1.3:1.1: TS EndPoint Addr 0x81, Alternate settings: 6
osmc kernel: cx231xx 1-1.1.3:1.1: V4L2 device vbi0 deregistered
osmc kernel: cx231xx 1-1.1.3:1.1: V4L2 device video0 deregistered
osmc kernel: cx231xx: probe of 1-1.1.3:1.1 failed with error -22

Can you upload the whole log?

osmc@osmc:~$ journalctl -f
-- Logs begin at Thu 2016-11-03 10:16:42 PDT. --
Oct 21 21:57:22 osmc systemd[773]: Reached target Timers.
Oct 21 21:57:22 osmc systemd[773]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Oct 21 21:57:22 osmc systemd[773]: Reached target Sockets.
Oct 21 21:57:22 osmc systemd[773]: Reached target Basic System.
Oct 21 21:57:22 osmc systemd[773]: Reached target Default.
Oct 21 21:57:22 osmc systemd[773]: Startup finished in 52ms.
Oct 21 21:57:22 osmc systemd[1]: Started User Manager for UID 1000.
Oct 21 21:57:22 osmc sudo[789]:     osmc : TTY=pts/0 ; PWD=/home/osmc ; USER=root ; COMMAND=/bin/grep -q osmc:$1$P.ZH6EFu$L08/1ZYI6FdHu3aw0us.u0:17569:0:99999:7::: /etc/shadow
Oct 21 21:57:22 osmc sudo[789]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
Oct 21 21:57:22 osmc sudo[789]: pam_unix(sudo:session): session closed for user root
Oct 21 21:57:58 osmc kernel: usb 1-1.1.3: new high-speed USB device number 6 using dwc_otg
Oct 21 21:57:58 osmc kernel: usb 1-1.1.3: New USB device found, idVendor=2040, idProduct=b124
Oct 21 21:57:58 osmc kernel: usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct 21 21:57:58 osmc kernel: usb 1-1.1.3: Product: Hauppauge Device
Oct 21 21:57:58 osmc kernel: usb 1-1.1.3: Manufacturer: Hauppauge
Oct 21 21:57:58 osmc kernel: usb 1-1.1.3: SerialNumber: 4035920121
Oct 21 21:57:58 osmc kernel: media: Linux media interface: v0.10
Oct 21 21:57:58 osmc kernel: Linux video capture interface: v2.00
Oct 21 21:57:58 osmc kernel: usbcore: registered new interface driver cx231xx
Oct 21 21:57:58 osmc kernel: cx231xx 1-1.1.3:1.1: New device Hauppauge Hauppauge Device @ 480 Mbps (2040:b124) with 7 interfaces
Oct 21 21:57:58 osmc kernel: cx231xx 1-1.1.3:1.1: Identified as Unknown CX231xx video grabber (card=0)
Oct 21 21:57:58 osmc kernel: i2c i2c-4: Added multiplexed i2c bus 6
Oct 21 21:57:58 osmc kernel: i2c i2c-4: Added multiplexed i2c bus 7
Oct 21 21:57:58 osmc kernel: cx231xx 1-1.1.3:1.1: v4l2 driver version 0.0.3
Oct 21 21:57:58 osmc kernel: cx231xx 1-1.1.3:1.1: Unknown tuner type configuring SIF
Oct 21 21:57:58 osmc kernel: cx231xx 1-1.1.3:1.1: Registered video device video0 [v4l2]
Oct 21 21:57:58 osmc kernel: cx231xx 1-1.1.3:1.1: Registered VBI device vbi0
Oct 21 21:57:58 osmc kernel: cx231xx 1-1.1.3:1.1: video EndPoint Addr 0x84, Alternate settings: 5
Oct 21 21:57:58 osmc kernel: cx231xx 1-1.1.3:1.1: VBI EndPoint Addr 0x85, Alternate settings: 2
Oct 21 21:57:58 osmc kernel: cx231xx 1-1.1.3:1.1: sliced CC EndPoint Addr 0x86, Alternate settings: 2
Oct 21 21:57:58 osmc kernel: cx231xx 1-1.1.3:1.1: TS EndPoint Addr 0x81, Alternate settings: 6
Oct 21 21:57:58 osmc kernel: cx231xx 1-1.1.3:1.1: V4L2 device vbi0 deregistered
Oct 21 21:57:58 osmc kernel: cx231xx 1-1.1.3:1.1: V4L2 device video0 deregistered
Oct 21 21:57:58 osmc kernel: cx231xx: probe of 1-1.1.3:1.1 failed with error -22
Oct 21 22:01:53 osmc systemd[1]: Starting Report anonymous OSMC install statistics...
Oct 21 22:01:54 osmc systemd[1]: Started Report anonymous OSMC install statistics.
Oct 21 22:06:54 osmc ntpd[469]: 208.67.72.43 local addr 192.168.0.171 -> <null>
Oct 21 22:07:27 osmc ntpd[469]: 216.229.0.49 local addr 192.168.0.171 -> <null>
Oct 21 22:12:13 osmc systemd[1]: Starting Cleanup of Temporary Directories...
Oct 21 22:12:13 osmc systemd[1]: Started Cleanup of Temporary Directories.
Oct 21 22:13:03 osmc ntpd[469]: 207.244.103.95 local addr 192.168.0.171 -> <null>
Oct 21 22:13:32 osmc ntpd[469]: 192.73.243.97 local addr 192.168.0.171 -> <null>
Oct 21 22:14:39 osmc sshd[1154]: rexec line 18: Deprecated option KeyRegenerationInterval
Oct 21 22:14:39 osmc sshd[1154]: rexec line 19: Deprecated option ServerKeyBits
Oct 21 22:14:39 osmc sshd[1154]: rexec line 30: Deprecated option RSAAuthentication
Oct 21 22:14:39 osmc sshd[1154]: rexec line 42: Deprecated option RhostsRSAAuthentication
Oct 21 22:14:43 osmc sshd[1154]: reprocess config line 30: Deprecated option RSAAuthentication
Oct 21 22:14:43 osmc sshd[1154]: reprocess config line 42: Deprecated option RhostsRSAAuthentication
Oct 21 22:14:43 osmc sshd[1154]: Accepted password for osmc from 192.168.0.173 port 39623 ssh2
Oct 21 22:14:43 osmc sshd[1154]: pam_unix(sshd:session): session opened for user osmc by (uid=0)
Oct 21 22:14:43 osmc systemd-logind[255]: New session c2 of user osmc.
Oct 21 22:14:43 osmc systemd[1]: Started Session c2 of user osmc.
Oct 21 22:14:44 osmc sudo[1169]:     osmc : TTY=pts/1 ; PWD=/home/osmc ; USER=root ; COMMAND=/bin/grep -q osmc:$1$P.ZH6EFu$L08/1ZYI6FdHu3aw0us.u0:17569:0:99999:7::: /etc/shadow
Oct 21 22:14:44 osmc sudo[1169]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
Oct 21 22:14:44 osmc sudo[1169]: pam_unix(sudo:session): session closed for user root
Oct 21 22:15:25 osmc sudo[1181]:     osmc : TTY=pts/1 ; PWD=/home/osmc ; USER=root ; COMMAND=/bin/bash
Oct 21 22:15:25 osmc sudo[1181]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
Oct 21 22:15:49 osmc sshd[1192]: rexec line 18: Deprecated option KeyRegenerationInterval
Oct 21 22:15:49 osmc sshd[1192]: rexec line 19: Deprecated option ServerKeyBits
Oct 21 22:15:49 osmc sshd[1192]: rexec line 30: Deprecated option RSAAuthentication
Oct 21 22:15:49 osmc sshd[1192]: rexec line 42: Deprecated option RhostsRSAAuthentication
Oct 21 22:15:50 osmc sshd[1192]: reprocess config line 30: Deprecated option RSAAuthentication
Oct 21 22:15:50 osmc sshd[1192]: reprocess config line 42: Deprecated option RhostsRSAAuthentication
Oct 21 22:15:50 osmc sshd[1192]: Accepted password for osmc from 192.168.0.173 port 39725 ssh2
Oct 21 22:15:50 osmc sshd[1192]: pam_unix(sshd:session): session opened for user osmc by (uid=0)
Oct 21 22:15:50 osmc systemd-logind[255]: New session c3 of user osmc.
Oct 21 22:15:50 osmc systemd[1]: Started Session c3 of user osmc.
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: New device Hauppauge Hauppauge Device @ 480 Mbps (2040:b124) with 7 interfaces
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: Identified as Unknown CX231xx video grabber (card=0)
Oct 21 22:18:20 osmc kernel: i2c i2c-4: Added multiplexed i2c bus 6
Oct 21 22:18:20 osmc kernel: i2c i2c-4: Added multiplexed i2c bus 7
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: v4l2 driver version 0.0.3
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: Unknown tuner type configuring SIF
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: Registered video device video0 [v4l2]
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: Registered VBI device vbi0
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: audio EndPoint Addr 0x83, Alternate settings: 3
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: video EndPoint Addr 0x84, Alternate settings: 5
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: VBI EndPoint Addr 0x85, Alternate settings: 2
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: sliced CC EndPoint Addr 0x86, Alternate settings: 2
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: TS EndPoint Addr 0x81, Alternate settings: 6
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: V4L2 device vbi0 deregistered
Oct 21 22:18:20 osmc kernel: cx231xx 1-1.1.3:1.1: V4L2 device video0 deregistered
Oct 21 22:18:20 osmc kernel: cx231xx: probe of 1-1.1.3:1.1 failed with error -22
Oct 21 22:20:47 osmc ntpd[469]: 138.236.128.112 local addr 192.168.0.171 -> <null>

I think the device may not use this driver.

Sam

I think I am coming to that conclusion. it is odd that hauppauge has their windows driver listing it as a 955Q, but I guess since it is a manufacture made driver they can make it say whatever they want.

Maybe a different demod etc which needs bringing up differently.
It is not uncommon for devices to look visually similar but have different chips.

What is linuxtv saying about it?

There is zero information on linuxtv about this adapter, but I just did find a great utility on Hauppageā€™s site, and this is the info straight from the device with their utility.

Model 111421 Rev. E5I6
Serial #4035920121
Tuner Model/Formats: Silicon Labs Si2157  //  (M/N) / ATSC
Tuner Audio: Stereo (CX23102)
Video Formats: NTSC ( M 443 ) PAL ( B G H I D K M N NCOMBO ) SECAM ( L L' )
Audio Outputs: None
External Inputs: 1
S-Video Inputs: 1
Teletext:  
Radio: None
Decoder: CX23102
IR: CIR Receive
MAC Address: 00-0D-FE-8F-40-F9
BuildNo: 34210

EEprom Contents: 
40 20 24 b1 aa 00 00 01 10 00 50 00 30 00 ff ff 14 03 48 00 61 00 75 00 70 00 70 00 61 00 75 00 67 00 65 00 00 00 00 00 00 00 00 00 00 00 00 00 16 03 34 00 30 00 33 00 35 00 39 00 32 00 30 00 31 00 32 00 31 00 00 00 ff ff ff ff ff ff ff ff 22 03 48 00 61 00 75 00 70 00 70 00 61 00 75 00 67 00 65 00 20 00 44 00 65 00 76 00 69 00 63 00 65 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
========
84 09 00 04 20 77 00 40 f9 40 8f f0 
73 05 2f 00 
84 08 00 06 3d b3 01 00 56 5a 95 
72 07 70 
73 09 2e 7f 
73 0a 88 ba 
72 0b 13 
72 0f 05 
72 10 01 
72 11 1f 
73 13 a2 85 
79 3f 

No DLL Version Data Available

And I also can visually see a LGDT3306 package on the PCB.

So I made my own osmc fork on github, and I have identified all of the files that i need to modify along with the code segments that need modification. It seems with the newer Hauppage cards that the way they are initialized made it so the new_id method was not going to work. Unless the eeprom is different (have not gotten that far yet), I think we should have a driver working for this $19.99 USD card!

I spoke too soon! on compiling with my patch, it seems that in cx231xx-cards.c there is a integer assignment for the number of cards supportedā€¦ I think. I am much a Linux and C noob!
const unsigned int cx231xx_bcount = ARRAY_SIZE(cx231xx_boards); around line 900 or so.

This is what I am getting when make fails:

Makefile:1040: recipe for target 'drivers' failed
make[1]: *** [drivers] Error 2
make[1]: Leaving directory '/mnt/package/kernel-osmc/src/linux-4.14.34'
debian/ruleset/targets/common.mk:295: recipe for target 'debian/stamp/build/kernel' failed
make: *** [debian/stamp/build/kernel] Error 2
Building kernel headers package failed
Makefile:8: recipe for target 'rbp2' failed
make: *** [rbp2] Error 1
make: Leaving directory '/mnt/package/kernel-osmc'
Makefile:8: recipe for target 'rbp2' failed
make: *** [rbp2] Error 2

Along with this a little earlier in the output:

drivers/media/usb/cx231xx/cx231xx-cards.c:818:3: error: 'CX231XX_BOARD_AIRTV_955Q' undeclared here (not in a function)
  [CX231XX_BOARD_AIRTV_955Q] = {
   ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/usb/cx231xx/cx231xx-cards.c:818:3: error: array index in initializer not of integer type
drivers/media/usb/cx231xx/cx231xx-cards.c:818:3: note: (near initialization for 'cx231xx_boards')
scripts/Makefile.build:328: recipe for target 'drivers/media/usb/cx231xx/cx231xx-cards.o' failed
make[5]: *** [drivers/media/usb/cx231xx/cx231xx-cards.o] Error 1
scripts/Makefile.build:587: recipe for target 'drivers/media/usb/cx231xx' failed
make[4]: *** [drivers/media/usb/cx231xx] Error 2
make[4]: *** Waiting for unfinished jobs....

That is the line where i Ctr+C on the orig 955Q definition and Ctr+V it in after and modified it for the airtv device.

I think i might have figured out a lot of my problems! it seems cx231xx-417.c had #define CX231xx FIRM_IMAGE_NAME set to "v4l-cx23885-enc.fw" instead of the required "v4l-cx231xx-avcore-01.fw" I am in the process of compiling the kernel after the last set of changes when I found the def. Fingers crossed.

1 Like

Well I am successful on the Pi 3 running Raspbianā€¦ it seems with osmc when I would place a .patch in the patched directory, and the terminal when running make rbp2 would show the patch executing fine along with the cx231xx-cards.c file showing the changesā€¦but alas the cx231xx-cards.o file I found does not reflect the changes. There is a small section I found with human readable text, and it so happens to be the Pid and Vidsā€¦and my changes were not reflected there. All this fighting for the fix on raspbian to be one of my first initial tries on osmcā€¦

So how the heck do I build from my modified *.c files with OSMC not scrubbing them?

In order to have any chance of answering your question, weā€™d need to see the build log and the patch file.

As long as the build log is under (I think) 10 MB, you can upload it to the OSMC pastebin: paste-log <build.log>. Let us know the URL.

If the patch is large, also send it to the pastebin, otherwise you can copy/paste here (and ideally format with the </> button).

the log ended up being way too big, and the several times I ran make, and checked the log before it clipped, there was nothing that stood out.
Here are my patches:

    diff -u 
    --- a/drivers/media/usb/cx231xx/cx231xx-cards.c	
    +++ b/drivers/media/usb/cx231xx/cx231xx-cards.c	
    @@ -926,6 +926,9 @@
     	 .driver_info = CX231XX_BOARD_HAUPPAUGE_EXETER},
     	{USB_DEVICE(0x2040, 0xb123),
     	 .driver_info = CX231XX_BOARD_HAUPPAUGE_955Q},
    +	/* AirTv Single ATSC QAM Tuner */
    +	{USB_DEVICE(0x2040, 0xb124),
    +	 .driver_info = CX231XX_BOARD_HAUPPAUGE_955Q},
     	{USB_DEVICE(0x2040, 0xb130),
     	 .driver_info = CX231XX_BOARD_HAUPPAUGE_930C_HD_1113xx},
     	{USB_DEVICE(0x2040, 0xb131),

    --- a/drivers/media/usb/cx231xx/cx231xx-417.c	
    +++ b/drivers/media/usb/cx231xx/cx231xx-417.c
    @@ -37,7 +37,7 @@
     #include <media/tuner.h>
     
     #define CX231xx_FIRM_IMAGE_SIZE 376836
    -#define CX231xx_FIRM_IMAGE_NAME "v4l-cx23885-enc.fw"
    +#define CX231xx_FIRM_IMAGE_NAME "v4l-cx231xx-avcore-01.fw"
     
     /* for polaris ITVC */
     #define ITVC_WRITE_DIR          0x03FDFC00

What did you call the patch file?