Multiple em28xx USB devices not automatically detected by the module 
I got multiple USB devices working with em28xx module.

Usually a module option gives the em28xx module the order of the devices if not automatically detected
(ex. options em28xx card=80,92,9,9).

But the order at boot is every time different (order for module option not usb detection).

The only working solution for me is to manual loading, scan the order from kernel logs, unload and load with the scanned order:

/etc/modprobe.d/em28xx
blacklist em28xx
blacklist em28xx_v4l
blacklist em28xx_dvb
blacklist em28xx_rc


/etc/systemd/system/em28xx.service
[Unit]
Description=em28xx card sequence detection
After=local-fs.target
Before=motion.service vdr.service

[Service]
ExecStart=/usr/local/bin/em28xx_detect.sh
Type=oneshot

[Install]
WantedBy=multi-user.target


/usr/local/bin/em28xx_detect.sh
#!/bin/sh

modprobe em28xx
sleep 1
modprobe -r em28xx_rc
modprobe -r em28xx_v4l
modprobe -r em28xx_dvb
modprobe -r em28xx

IFS="
"
for line in $(dmesg|grep em28xx|grep 'New device'|tail -4)
do
[ -z "$cards" ] || cards="${cards},"
case "$line" in
*eb1a:2821*) cards="${cards}9" ;;
*2013:024c*) cards="${cards}80" ;;
*2013:0258*) cards="${cards}92" ;;
esac
done

modprobe em28xx card=$cards disable_ir=1 disable_usb_speed_check=1

sleep 10


[ view entry ] ( 7892 views )   |  print article

<Back | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next> Last>>