b-rad-ndi / eeprom-tinker Goto Github PK
View Code? Open in Web Editor NEWA (semi) dangerous utility to decode and (eventually) modify EEPROMs in Hauppauge em28xx devices
License: GNU General Public License v3.0
A (semi) dangerous utility to decode and (eventually) modify EEPROMs in Hauppauge em28xx devices
License: GNU General Public License v3.0
EEPROM Tinker by Brad Love (b-rad) A utility to allow converting various Hauppauge em28xx based devices from USB Isochronous transport mode to bulk transport mode. This dramatically reduces system load, by dramatically increasing the amount of bytes transferred in every USB URB. This is highly beneficial AND/OR required for a variety of embedded platforms (like RPi). This also works around very high bandwidth streams which are too high for ISOC transfers to keep up with. When the bandwidth is too high for ISOC you will experience loss of transport stream packets, leading to corrupted video, due to continuity errors and missing data. This utility should not be dangerous to use, AS LONG AS YOU USE IT SAFELY! ========================================= EEPROM Tinker Welcome to the danger zone Be careful, this utility can harm your system if misused! eeprom-tinker options -d device detection -i print device info -v verbose -t test mode, only output equivalent modification operation -b set i2c bus number (dangerous! be sure this is correct!) -m {pid|bulk|both} fix product id, fix bulk flag, or fix both -h display help =============================================================================== =============================================================================== To compile: $ sudo apt-get install libi2c-dev $ make Note: you require libi2c-dev >= 4.0 - This means Ubuntu Xenial LTS is incompatible, Bionic+ is ok If make reports you are missing i2c/smbus.h your library is too old. =============================================================================== =============================================================================== To use this dangerous utility follow these steps: NOTE: you will require to run these commands via sudo =============================================================================== =============================================================================== Detection of compatible devices: $ eeprom-tinker -d EEPROM Tinker Welcome to the danger zone Be careful, this utility can harm your system if misused! ========================================= Found 2013:0461 - PCTV 461e (3103B) Root i2c bus: i2c-14 <--- use Child bus: i2c-15 ========================================= 1 em28xx devices found ========================================= =============================================================================== =============================================================================== Information about detected device: $ eeprom-tinker -i -b 14 EEPROM Tinker Welcome to the danger zone Be careful, this utility can harm your system if misused! Found tag 0x04 (serial) Found tag 0x06 (model/revision) vid:pid 2013:0461 Board Config: 00 (isoc) serial: d6 42 01 model: 00 03 0d 40 ( 200000 ) revision: 89 8a 19 Found: isoc mode PCTV 461e (3103B) ( 200000 ) Conversion to bulk mode possible: yes Convert device to new PID? OK as is =============================================================================== =============================================================================== Conversion of a compatible device: $ eeprom-tinker -t -b 14 -m bulk EEPROM Tinker Welcome to the danger zone Be careful, this utility can harm your system if misused! Found tag 0x04 (serial) Found tag 0x06 (model/revision) Found: isoc mode PCTV 461e (3103B) ( 200000 ) Conversion to bulk mode possible: yes Convert device to new PID? OK as is ############################################ Update board config to bulk mode Equivalent operation for manual conversion: i2cset -y 14 0x50 0x00 0xa7 0x04 i ############################################ Only execute the above commands if you are absolutely confident =============================================================================== =============================================================================== FINALLY This utility *can* do the modification for you, but this is currently disabled in the source code. Instead it prints out the explicit operation required to do the conversion yourself. For the device being operated on in this README, the following command will convert the 461e from ISOC to bulk mode: $ sudo i2cset -y 14 0x50 0x00 0xa7 0x04 i DO NOT JUST EXECUTE THE ABOVE LINE WITHOUT VERIFYING IT'S CORRECTNESS USING ALL OF THE PREVIOUS STEPS!!!! =============================================================================== =============================================================================== Once the i2cset operation has been executed, wait a few seconds (for your sanity), then you can unplug and reconnect the device. You can then dump device info, with this utility or dmesg to verify the device is now in bulk mode: $ eeprom-tinker -i -b 14 EEPROM Tinker Welcome to the danger zone Be careful, this utility can harm your system if misused! Found tag 0x04 (serial) Found tag 0x06 (model/revision) vid:pid 2013:0461 Board Config: 04 (bulk) serial: d6 42 01 model: 00 03 0d 40 ( 200000 ) revision: 89 8a 19 Found: isoc mode PCTV 461e (3103B) ( 200000 ) Conversion to bulk mode possible: yes Convert device to new PID? OK as is Device PCTV 461e (3103B) has already been converted to bulk mode ========================================= $ dmesg | egrep -i '461|bulk' [70053.597329] usb 3-1: New USB device found, idVendor=2013, idProduct=0461, bcdDevice= 1.00 [70053.597337] usb 3-1: Product: PCTV 461 [70053.598730] em28xx 3-1:1.0: New device PCTV PCTV 461 @ 480 Mbps (2013:0461, interface 0, class 0) [70053.598734] em28xx 3-1:1.0: DVB interface 0 found: bulk [70054.108045] em28xx 3-1:1.0: Identified as PCTV DVB-S2 Stick (461e v2) (card=104) [70054.108051] em28xx 3-1:1.0: dvb set to bulk mode. Did it work? It better have :-D =============================================================================== =============================================================================== USE AT YOUR OWN RISK!!!! USE AT YOUR OWN RISK!!!! USE AT YOUR OWN RISK!!!! USE AT YOUR OWN RISK!!!! USE AT YOUR OWN RISK!!!! =============================================================================== ===============================================================================
Having some trouble compiling this on Ubuntu 18. I've installed the i2c-tools package but still get:
# make
gcc -g -Wall -c eeprom-tinker.c
gcc -g -Wall -c linux-i2c.c
linux-i2c.c:13:10: fatal error: i2c/smbus.h: No such file or directory
#include <i2c/smbus.h>
^~~~~~~~~~~~~
compilation terminated.
Makefile:12: recipe for target 'linux-i2c.o' failed
make: *** [linux-i2c.o] Error 1
If I copy in smbus.h and alter linux-i2c.c it clears the error but then stalls looking for li2c:
# make
gcc -g -Wall -c eeprom-tinker.c
gcc -g -Wall -c linux-i2c.c
gcc -g -Wall -c eeprom-utils.c
gcc -g -Wall -c device-detection.c
gcc -g -o eeprom-tinker eeprom-tinker.o linux-i2c.o eeprom-utils.o device-detection.o -li2c
/usr/bin/ld: cannot find -li2c
collect2: error: ld returned 1 exit status
Makefile:6: recipe for target 'eeprom-tinker' failed
make: *** [eeprom-tinker] Error 1
Am I missing any other dependencies or tooling?
Running Ubuntu 18 LTS in a VM on ESXi 6.7.0 U1, virtual machine HW version 14. The eeprom-tinker tool does not detect any devices:
# ./eeprom-tinker -d -v
EEPROM Tinker
Welcome to the danger zone
Be careful, this utility can harm your system if misused!
=========================================
0 em28xx devices found
=========================================
The device is detected by the system:
# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 004: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 003: ID 2013:025f PCTV Systems
Bus 001 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
sysfs looks like this:
# ls /sys/bus/usb -R
/sys/bus/usb:
devices drivers drivers_autoprobe drivers_probe uevent
/sys/bus/usb/devices:
1-0:1.0 1-1 1-1:1.0 1-2 1-2:1.0 1-3 1-3:1.0 1-4 1-4:1.0 2-0:1.0 usb1 usb2
/sys/bus/usb/drivers:
em28xx hub usb usbfs usbhid
/sys/bus/usb/drivers/em28xx:
1-2:1.0 bind module new_id remove_id uevent unbind
/sys/bus/usb/drivers/hub:
1-0:1.0 1-3:1.0 1-4:1.0 2-0:1.0 bind module new_id remove_id uevent unbind
/sys/bus/usb/drivers/usb:
1-1 1-2 1-3 1-4 bind uevent unbind usb1 usb2
/sys/bus/usb/drivers/usbfs:
bind module new_id remove_id uevent unbind
/sys/bus/usb/drivers/usbhid:
1-1:1.0 bind module new_id remove_id uevent unbind
Any ideas??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.