PCTV / em28xx driver/module

I have a old Pinnacle usb dongle that used to work with kaffine on CentOS8 but I dont see the module for em28xx.ko anywhere in Rocky9.6.

Bus 001 Device 050: ID 2304:0227 Pinnacle Systems, Inc. PCTV for Mac, HD Stick

Kernel seems to have a place holder for the module still.

[ em28xx]# pwd
/usr/src/kernels/5.14.0-570.23.1.el9_6.x86_64/drivers/media/usb/em28xx
[ em28xx]# ls
Kconfig Makefile

Does anyone know if this is in a package somewhere (didn’t find it searching) ?

Example from ‘kernel-5.14.0-570.18.1.el9_6.src.rpm’

linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/Kconfig
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/Makefile
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/em28xx-audio.c
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/em28xx-camera.c
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/em28xx-cards.c
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/em28xx-core.c
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/em28xx-dvb.c
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/em28xx-i2c.c
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/em28xx-input.c
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/em28xx-reg.h
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/em28xx-v4l.h
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/em28xx-vbi.c
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/em28xx-video.c
linux-5.14.0-570.18.1.el9_6/drivers/media/usb/em28xx/em28xx.h

I suggest you file a request to ELRepo and ask for a kmod package for the em28xx driver.

In the meantime, you can install ELRepo’s kernel-ml or kernel-lt. The both have this driver enabled.

1 Like

Thanks that may be the best option.

I tried building the module from source for my current kernel and hit the dreaded

insmod ./em28xx.ko
insmod: ERROR: could not insert module ./em28xx.ko: Invalid module format

kernel: module em28xx: .gnu.linkonce.this_module section size must match the kernel’s built struct module size at run time

So apparently things have changed somewhat I can no longer do this myself.

Make sure all kernel packages are matching, including the headers and the src rpm

Yes I think I have all the right files

$ uname -r
5.14.0-570.32.1.el9_6.x86_64

https://dl.rockylinux.org/vault/rocky/9.6/BaseOS/source/tree/Packages/k/kernel-5.14.0-570.32.1.el9_6.src.rpm

Using Current kernel-devel and kernel-headers

Copied the config and mod symbols files of running kernel to the source. Edited the Source Makefile to set the version to match.

It builds but clearly I not doing something correctly.

name: em28xx
vermagic: 5.14.0-570.32.1.el9_6.x86_64 SMP preempt mod_unload modversions

I expect my process for trying to build a kernel module for the currently running kernel is the issue. I have not found any clear examples of how to do it on current kernels so have used info from older examples which must not be correct for this one.

I think the far easiest is as @toracat already mentioned:

  1. Submit a request to elrepo so that they build the module and have it available for all the 5.x EL kernels.
  2. Enable elrepo and install either kernel-lt or kernel-ml - you will have the module active in literally a couple of minutes and you can use this while waiting for elrepo to build the module for 5.x kernels.

Sounds like you did everything carefully with the versions.

I’m not sure about this part, who told you to copy “mod symbols”?

I’ll see if I can simulate the build on my own box…

I was able to build the module and install it to the kernel without error, but it’s hard to test without the hardware.

There are two options; “in tree” and “out of tree”, “in tree” when the module is being included in a big kernel with everything else, and “out of tree” when you want to build just these few modules.

identify the card (guessing from the lscpi output above)
EM2880_BOARD_PINNACLE_PCTV_HD_PRO, Pinnacle PCTV HD Pro Stick, 0x2304:0x0227, Analog/DVB

As standard user
extract source code from linux-5.14.0-570.32.1.el9_6 to

/data/build
find media_build_em28xx/ -type d
media_build_em28xx/
media_build_em28xx/linux
media_build_em28xx/linux/drivers
media_build_em28xx/linux/drivers/media
media_build_em28xx/linux/drivers/media/usb
media_build_em28xx/linux/drivers/media/usb/em28xx
media_build_em28xx/linux/drivers/media/dvb-core
media_build_em28xx/linux/drivers/media/dvb-frontends
media_build_em28xx/linux/drivers/media/dvb-frontends/cxd2880
media_build_em28xx/linux/drivers/media/dvb-frontends/drx39xyj
media_build_em28xx/linux/drivers/media/tuners

delete all Kconfig and Makefiles
create the Makefiles using these symbols

CONFIG_DVB_CORE := m
CONFIG_VIDEO_EM28XX := m
CONFIG_VIDEO_EM28XX_ALSA := m
CONFIG_VIDEO_EM28XX_DVB := m
CONFIG_DVB_ZL10353 := m
CONFIG_MEDIA_TUNER_XC2028 := m

(very messy makefiles created by me that somehow work)

find media_build_em28xx/ -type f -iname 'Makefile'
media_build_em28xx/linux/drivers/media/usb/em28xx/Makefile
media_build_em28xx/linux/drivers/media/dvb-core/Makefile
media_build_em28xx/linux/drivers/media/dvb-frontends/Makefile
media_build_em28xx/linux/drivers/media/tuners/Makefile
media_build_em28xx/linux/Makefile

start the build
make -C media_build_em28xx/linux
I end up with six modules

find media_build_em28xx/ -type f -iname '*.ko'
media_build_em28xx/linux/drivers/media/usb/em28xx/em28xx-alsa.ko
media_build_em28xx/linux/drivers/media/usb/em28xx/em28xx-dvb.ko
media_build_em28xx/linux/drivers/media/usb/em28xx/em28xx.ko
media_build_em28xx/linux/drivers/media/dvb-core/dvb-core.ko
media_build_em28xx/linux/drivers/media/dvb-frontends/zl10353.ko
media_build_em28xx/linux/drivers/media/tuners/xc2028.ko

sign the modules if you’re on secure boot
get info about the em28xx module

modinfo media_build_em28xx/linux/drivers/media/usb/em28xx/em28xx.ko
srcversion:     4B27FD1111F47F8DAAC9A78
depends:        mc,videodev,tveeprom

load two dependencies

modprobe tveeprom
modprobe videodev

now load the new module into the kernel
sudo insmod media_build_em28xx/linux/drivers/media/usb/em28xx/em28xx.ko
we see all three modules loaded

lsmod
em28xx                114688  0
videodev              385024  1 em28xx
tveeprom               28672  1 em28xx

in real life, we’d install all six modules, and use depmod

thanks I will play with this.

Were you able to spot anything that would explain why your original build was giving an error trying to use ‘insmod’?

If anyone is still interested, we have the package “kmod-media” available in the elrepo-testing repo.

Feedback is appreciated.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.