I have discovered a bug today in the saa7134 driver inside the function, “saa7134_i2c_xfer”
In order to communicate with certain i2c clients on the saa713x i2c bus, a quirk was implemented to prevent failures during i2c read transactions.
The quirk forces an i2c write/read to a bogus address that is unlikely to be used by any actual i2c client.
However, this quirk is not functioning properly. The reason for the malfunction is that the i2c address chosen to use as the quirk address was 0xfd.
The address 0xfd is indeed an i2c address unlikely to be used by any real i2c client, however, the address itself is invalid! The address, 0xfd, has the read bit set — this is problematic for the hardware, and causes the quirk workaround to fail.
It’s a wonder that nobody else has complained up to this point.
I am asking for testers, just to make sure that this doesn’t cause any other strange errors to occur as a side effect. I don’t expect any
new problems, but its always better to be safe than sorry 🙂
This change should not fix any of the other issues currently being discussed with the saa7134 driver — all I am asking is for people to test and indicate that the change does not incur any new bugs or unwanted behavior.
Please test the following repository, and send in your feedback:
Hi,
i just tested the saa7134 in the http://kernellabs.com/hg/~mkrufky/hvr1100 repository and i still get i2c errors with my HVR1100:
tda18271_write_regs: ERROR: i2c_transfer returned: -5
tda18271_set_analog_params: error -5 on line 1005
analog tv works using mplayer, but i cant tune any DVB-T channels (Region is Berlin, Germany) having good signal strength.
Kernel Info:
Linux pc 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 19:49:51 UTC 2009 i686 GNU/Linux
DMESG and lspci is attached
Just ask if u need any additional info or testing.
greets
Lars
[ 3250.098525] saa7130/34: v4l2 driver version 0.2.15 loaded
[ 3250.098633] saa7133[0]: found at 0000:01:05.0, rev: 209, irq: 18, latency: 64, mmio: 0xfcfff800
[ 3250.098645] saa7133[0]: subsystem: 0070:6707, board: Hauppauge WinTV-HVR1110r3 DVB-T/Hybrid [card=156,autodetected]
[ 3250.098811] saa7133[0]: board init: gpio is 4440100
[ 3250.272028] saa7133[0]: i2c eeprom 00: 70 00 07 67 54 20 1c 00 43 43 a9 1c 55 d2 b2 92
[ 3250.272048] saa7133[0]: i2c eeprom 10: ff ff ff 0e ff 20 ff ff ff ff ff ff ff ff ff ff
[ 3250.272065] saa7133[0]: i2c eeprom 20: 01 40 01 32 32 01 01 33 88 ff 00 b0 ff ff ff ff
[ 3250.272082] saa7133[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[ 3250.272098] saa7133[0]: i2c eeprom 40: ff 35 00 c0 96 10 06 32 97 04 00 20 00 ff ff ff
[ 3250.272113] saa7133[0]: i2c eeprom 50: ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3250.272129] saa7133[0]: i2c eeprom 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3250.272145] saa7133[0]: i2c eeprom 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3250.272160] saa7133[0]: i2c eeprom 80: 84 09 00 04 20 77 00 40 ff 52 5e f0 73 05 29 00
[ 3250.272176] saa7133[0]: i2c eeprom 90: 84 08 00 06 89 06 01 00 95 19 8d 72 07 70 73 09
[ 3250.272192] saa7133[0]: i2c eeprom a0: 23 5f 73 0a f4 9b 72 0b 2f 72 0e 01 72 0f 01 72
[ 3250.272208] saa7133[0]: i2c eeprom b0: 10 01 72 11 ff 73 13 a2 69 79 4a 00 00 00 00 00
[ 3250.272224] saa7133[0]: i2c eeprom c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3250.272239] saa7133[0]: i2c eeprom d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3250.272255] saa7133[0]: i2c eeprom e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3250.272270] saa7133[0]: i2c eeprom f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ 3250.272292] tveeprom 0-0050: Hauppauge model 67209, rev C1F5, serial# 6181631
[ 3250.272298] tveeprom 0-0050: MAC address is 00-0D-FE-5E-52-FF
[ 3250.272303] tveeprom 0-0050: tuner model is NXP 18271C2 (idx 155, type 54)
[ 3250.272309] tveeprom 0-0050: TV standards PAL(B/G) PAL(I) SECAM(L/L’) PAL(D/D1/K) ATSC/DVB Digital (eeprom 0xf4)
[ 3250.272315] tveeprom 0-0050: audio processor is SAA7131 (idx 41)
[ 3250.272320] tveeprom 0-0050: decoder processor is SAA7131 (idx 35)
[ 3250.272324] tveeprom 0-0050: has radio, has IR receiver, has no IR transmitter
[ 3250.272329] saa7133[0]: hauppauge eeprom: model=67209
[ 3250.312174] tuner 0-004b: chip found @ 0x96 (saa7133[0])
[ 3250.392024] tda829x 0-004b: setting tuner address to 60
[ 3250.432224] tda18271 0-0060: creating new instance
[ 3250.480040] TDA18271HD/C2 detected @ 0-0060
[ 3251.812032] tda18271: performing RF tracking filter calibration
[ 3270.148026] tda18271: RF tracking filter calibration complete
[ 3270.204527] tda829x 0-004b: type set to tda8290+18271
[ 3275.180146] saa7133[0]: registered device video0 [v4l2]
[ 3275.180193] saa7133[0]: registered device vbi0
[ 3275.180234] saa7133[0]: registered device radio0
[ 3275.192698] saa7134 ALSA driver for DMA sound loaded
[ 3275.192759] saa7133[0]/alsa: saa7133[0] at 0xfcfff800 irq 18 registered as card -2
[ 3275.223404] dvb_init() allocating 1 frontend
[ 3275.356053] tda829x 0-004b: type set to tda8290
[ 3275.378489] tda18271 0-0060: attaching existing instance
[ 3275.378502] DVB: registering new adapter (saa7133[0])
[ 3275.378510] DVB: registering adapter 0 frontend 0 (NXP TDA10048HN DVB-T)…
[ 3275.728042] tda10048_firmware_upload: waiting for firmware upload (dvb-fe-tda10048-1.0.fw)…
[ 3275.728057] saa7134 0000:01:05.0: firmware: requesting dvb-fe-tda10048-1.0.fw
[ 3275.737799] tda10048_firmware_upload: firmware read 24878 bytes.
[ 3275.737806] tda10048_firmware_upload: firmware uploading
[ 3280.272029] tda10048_firmware_upload: firmware uploaded
[ 3281.058150] tda18271_write_regs: ERROR: i2c_transfer returned: -5
[ 3282.327874] tda18271_write_regs: ERROR: i2c_transfer returned: -5
[ 3282.327884] tda18271_set_analog_params: error -5 on line 1005
sometimes also the following errors:
[ 43.380017] tda18271_read_regs: ERROR: i2c_transfer returned: -5
[ 43.380021] tda18271_ir_cal_init: error -5 on line 787
[ 43.380023] tda18271_init: error -5 on line 811
[ 43.380025] tda18271_tune: error -5 on line 868
[ 43.380026] tda18271_set_analog_params: error -5 on line 1005
01:05.0 Multimedia controller [0480]: Philips Semiconductors SAA7131/SAA7133/SAA7135 Video Broadcast Decoder [1131:7133] (rev d1)
Subsystem: Hauppauge computer works Inc. Device [0070:6707]
Flags: bus master, medium devsel, latency 64, IRQ 18
Memory at fcfff800 (32-bit, non-prefetchable) [size=2K]
Capabilities: [40] Power Management version 2
Kernel driver in use: saa7134
Kernel modules: saa7134
Lars,
At this point in time, the hvr1100 tree is a bit outdated. Those changes have all been merged into the master repository by now. There have since been a few bugs discovered and fixed.
Can you try again, using the following repository? Please report back whether this issue has been resolved for you.
http://kernellabs.com/hg/v4l-dvb
The errors are still there, but DVB-T is working now 🙂
keep up the good work
Thanks
I hope this is the place to start this?
Initial testing with v4l-dvb kernel:
openSUSE 11.1
Linux Kernel 2.6.27.29-0.1-default
GNOME 2.24.1
Using:
Leadtech WinFast DVT1000S
w_scan:
19:37:45 up 1:27, 3 users, load average: 0.91, 0.94, 0.51
USER TTY LOGIN@ IDLE JCPU PCPU WHAT
dmesg:
Linux video capture interface: v2.00
input: Power Button (FF) as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input3
intel_rng: FWH not detected
sr0: scsi3-mmc drive: 125x/48x writer dvd-ram cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.20
sr 4:0:0:0: Attached scsi CD-ROM sr0
usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x043D pid 0x007B
usbcore: registered new interface driver usblp
ACPI: Power Button (FF) [PWRF]
input: Power Button (CM) as /devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input4
vendor=8086 device=27d4
atl1 0000:03:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
atl1 0000:03:00.0: setting latency timer to 64
atl1 0000:03:00.0: version 2.1.3
rtc_cmos 00:03: rtc core: registered rtc_cmos as rtc0
rtc0: alarms up to one month, hpet irqs
ACPI: Power Button (CM) [PWRB]
gspca: main v2.6.0 registered
i801_smbus 0000:00:1f.3: PCI INT B -> GSI 23 (level, low) -> IRQ 23
ppdev: user-space parallel port driver
vendor=8086 device=244e
ohci1394 0000:01:04.0: PCI INT A -> GSI 23 (level, low) -> IRQ 23
ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[23] MMIO=[e7cff000-e7cff7ff] Max Packet=[2048] IR/IT contexts=[4/8]
iTCO_vendor_support: vendor-support=0
gspca: probing 046d:092f
gspca: probe ok
usbcore: registered new interface driver spca561
spca561: registered
iTCO_wdt: Intel TCO WatchDog Timer Driver v1.03 (30-Apr-2008)
iTCO_wdt: Found a ICH7 or ICH7R TCO device (Version=2, TCOBASE=0x0860)
iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)
saa7130/34: v4l2 driver version 0.2.15 loaded
vendor=8086 device=244e
saa7134 0000:01:0b.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22
saa7130[0]: found at 0000:01:0b.0, rev: 1, irq: 22, latency: 64, mmio: 0xe7cffc00
saa7130[0]: subsystem: 107d:6655, board: Hauppauge WinTV-HVR1110r3 DVB-T/Hybrid [card=156,insmod option]
saa7130[0]: board init: gpio is 2020000
HDA Intel 0000:00:1b.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
HDA Intel 0000:00:1b.0: setting latency timer to 64
saa7130[0]: i2c eeprom 00: 7d 10 55 66 54 20 1c 00 43 43 a9 1c 55 d2 b2 92
saa7130[0]: i2c eeprom 10: 00 ff 82 0e ff 20 ff ff ff ff ff ff ff ff ff ff
saa7130[0]: i2c eeprom 20: 01 40 01 01 01 ff 01 03 08 ff 00 8a ff ff ff ff
saa7130[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7130[0]: i2c eeprom 40: ff 35 00 c0 00 10 03 02 ff 04 ff ff ff ff ff ff
saa7130[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7130[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7130[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7130[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7130[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7130[0]: i2c eeprom a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7130[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7130[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7130[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7130[0]: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7130[0]: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
tveeprom 1-0050: Encountered bad packet header [ff]. Corrupt or not a Hauppauge eeprom.
saa7130[0]: warning: unknown hauppauge model #0
saa7130[0]: hauppauge eeprom: model=0
Chip ID is not zero. It is not a TEA5767
tuner 1-0060: chip found @ 0xc0 (saa7130[0])
tda8290: no gate control were provided!
tuner 1-0060: Tuner has no way to set tv freq
tuner 1-0060: Tuner has no way to set tv freq
saa7130[0]: registered device video1 [v4l2]
saa7130[0]: registered device vbi0
saa7130[0]: registered device radio0
dvb_init() allocating 1 frontend
ieee1394: Host added: ID:BUS[0-00:1023] GUID[0011d8000036427a]
tda18271 1-0060: creating new instance
TDA18271HD/C2 detected @ 1-0060
DVB: registering new adapter (saa7130[0])
DVB: registering adapter 0 frontend 0 (NXP TDA10048HN DVB-T)…
tda10048_firmware_upload: waiting for firmware upload (dvb-fe-tda10048-1.0.fw)…
firmware: requesting dvb-fe-tda10048-1.0.fw
tda10048_firmware_upload: firmware read 24878 bytes.
tda10048_firmware_upload: firmware uploading
tda10048_firmware_upload: firmware uploaded
Adding 21776036k swap on /dev/sda5. Priority:-1 extents:1 across:21776036k
device-mapper: uevent: version 1.0.3
device-mapper: ioctl: 4.14.0-ioctl (2008-04-23) initialised: dm-devel@redhat.com
loop: module loaded
kjournald starting. Commit interval 5 seconds
@Nik, This saa713x test is a moot point now — it’s already merged into the master branch. You have the DTV1000S, which is not supported yet — there is a DTV1000S tree that you can experiment with if you like — I plan to merge that sometime soon.
Mike,
I am still having trouble getting the DTV1000S card working. I have openSUSE 11.2 now, but still no luck. The TVCard config GUI that comes with SUSE can’t find the tuner.
Will you be able to help?
Cheers
OK, I followed this wiki
And this is what dvr-qtgui says:
: 800.00 MHz AMD Phenom(tm) II X4 955 Processor detected
*** WARNING *** : the driver doesn’t provide a correct size for memory mapping. DVR tries to correct this error, but some strange things may happend, you are warned.
Can’t map memory for capture : Invalid argument
I recommend filing a bug with your distro. I don’t use dvr-qtgui.
Dont know anything about how to test the things that are mentioned here , but this is what i get with saa7134_dvb on Ubuntu 10.04:
[ 344.428170] tda18271_init: error -5 on line 826
[ 344.428174] tda18271_tune: error -5 on line 904
[ 344.428178] tda18271_set_params: error -5 on line 985
[ 345.436157] tda18271_write_regs: ERROR: idx = 0x5, len = 1, i2c_transfer returned: -5
[ 345.436165] tda18271_toggle_output: error -5 on line 47
After a rmmod saa7134_dvb and modprobe saa7134_dvb the card is working again.
grtz,
Jan