Giter Club home page Giter Club logo

eeprom-tinker's Introduction

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!!!!


===============================================================================
===============================================================================

eeprom-tinker's People

Contributors

b-rad-ndi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eeprom-tinker's Issues

Trouble compiling

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?

No devices detected in VMware VM

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??

wrong bits filled in 461e EEPROM

Hi

I added some extra tags to the sources and recompiled, it looks like there are wrong definitions in EEPROM of PCTV 461e card - tag 0x05 (audio), also linux driver prints AC97 audio codec detected.
This card have no any audio chips onboard

Screenshot from 2021-12-13 06-21-05

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.