rkk2025
Posts: 5
Joined: Tue Apr 04, 2017 6:19 pm

Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Thu Oct 31, 2019 8:17 pm

Hi,
To put everything a bit into context. I'm running TvHeadend together with Oscam and using a WinTV-dualHD TV USB receiver (http://www.hauppauge.com/pages/products ... ualhd.html) attached to my RaspberryPi.

In short:
My kernel log is flooded with "em28xx 1-1.3:1.0: write to i2c device at 0xcX failed with unknown error (status=128)" messages, and the USB TV tunner is failing with frequent "poll timeout" errors and is unable to read encrypted channels properly while previously it was able to do so (TvHeadend is unable to discramble the stream properly).

In long:
I had this setup running on a Raspberry Pi 3B+ and everything was running perfectly fine (Even my PayTV card was working fine with Oscam and TvHeadend was descrambling all channels I had access to without any issues). The only downside was that with the kernel version installed, only one of the TV receivers were detected instead of two. I don't remember which exact kernel version it was running, but it was the latest version that was available when the first experimental 4.19 kernel version for the Raspberry got released. I upgraded to the new experimental 4.19 kernel version with 'raspi-update' and both TV receivers were detected correctly this time and both regular TV and descrambling was working perfectly fine. But that experimental kernel version had a memory leak in LXC (Which I was using to host the software) forced me to keep updating the experimental kernel version till at some point the encrypted channels stopped working. At this point free-to-air channels were working but decoding of encrypted channels suddenly stopped working (No errors were shown in DMESG nor anywhere, and the error in TvHeadend was saying that all encrypted streams have some kind of "Invalid start code" errors when trying to discramble them).

At this point I bought a Raspberry Pi 4, same setup on a fresh install (Kernel 4.19 was labelled as stable now), with the same result. Free-to-air TV works fine, and encrypted channels fail to decode. The only difference now is that DMESG is plagued now with "em28xx 1-1.3:1.0: write to i2c device at 0xcX failed with unknown error (status=128)" messages. This messages are shown no matter if watching free-to-air, scanning for channels, or trying to play encrypted channels, as long as the WinTV-dualHD is in use, the messages keep appearing more and more.

I don't know where to follow up anymore on this issue, I tried downloading different versions of the si2168 firmware all having the same result. I tried with every USB port on my RPi4 and made sure that enough power is available for the device in every case. To me this smells like an issue with the Kernel, but I'm not sure if it's upstream or a RPi Kernel issue. Anybody has some idea what could be going on?

I attached the Kernel log in case that would help to find the cause of the issue.
Attachments
kernel-log.zip
Kernel Log (DMESG)
(12.6 KiB) Downloaded 20 times

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8688
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Sat Nov 02, 2019 1:42 pm

As it happens I've just set up my tvheadend server on a Pi4 with a pair of WinTV dualhd dvb-t2 tuners, and I also see these errors but it seems only on one of the tuners.
I'm suspecting an upstream issue as the Raspberry Pi kernel doesn't have any extra patches for these drivers, but it's just possible that it's a USB issue.

I'm about to start on the 5.4 kernel, so I'll see if that helps at all. The other option would be to try building the latest Linux-media driver tree for yourself. See https://www.linuxtv.org/wiki/index.php/ ... ce_Drivers for details on how to do that.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.


6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8688
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Sun Nov 03, 2019 9:29 pm

I haven't checked, but I'm expecting it to be the same firmware as in https://github.com/LibreELEC/dvb-firmware which is what I cloned. Libreelec are very good at keeping up to date on these sorts of things.

The i2c failures don't smell like a firmware issue anyway, I'm more suspicious that there's a driver issue, hence debating taking linux-media's latest. There is a guy from Hauppauge who is actively maintaining and updating their drivers in the mainline kernel.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

rosioara
Posts: 23
Joined: Sun Nov 17, 2019 3:07 am

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Sun Nov 17, 2019 3:12 am

I have exactly the same issue, while everything worked perfectly on an older PI (I am not 100% sure if it's 3). Now on Pi 4b with Hauppauge DualHD the device behaves very strange, seems laggy and when handling two tuners it goes very bad.

Dmesg output while for example performing a scan in tvheadend:

[ 221.126103] em28xx 1-1.4:1.0: write to i2c device at 0xce failed with unknown error (status=128)
[ 228.223791] em28xx 1-1.4:1.0: write to i2c device at 0xce failed with unknown error (status=128)
[ 228.235836] em28xx 1-1.4:1.0: write to i2c device at 0xc8 failed with unknown error (status=128)
[ 232.224397] em28xx 1-1.4:1.0: write to i2c device at 0xce failed with unknown error (status=128)
[ 294.440150] em28xx 1-1.4:1.0: write to i2c device at 0xce failed with unknown error (status=128)
[ 1055.583926] em28xx 1-1.4:1.0: write to i2c device at 0xce failed with unknown error (status=128)
[ 1056.584025] em28xx 1-1.4:1.0: write to i2c device at 0xce failed with unknown error (status=128)

Where to start looking at?

rkk2025
Posts: 5
Joined: Tue Apr 04, 2017 6:19 pm

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Mon Nov 25, 2019 10:37 pm

I tested with every single firmware I could find for both the demod and silabs (There are different versions), all of them with the exact same result.

@6by9, I haven't yet had time to build the kernel with the latest media drivers. Were you able to test if anything changed with the 5.x kernel?

Would it make any sense to open a bug in GitHub (https://github.com/raspberrypi/linux) regarding this issue? Or does it make no difference?

rosioara
Posts: 23
Joined: Sun Nov 17, 2019 3:07 am

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Sat Nov 30, 2019 10:34 am

I personally switched back to the config with the Raspberry 2 that I was previously using and it works perfectly fine. I will stick with the old Pi 2 until the issue will be fixed for the 4b.

If it helps, the working setup I have: Raspberry Pi 2 1.1, Raspbian Buster Lite (end of September downloaded then apt upgraded) tvheadend 4.2.8.-36, firmware 4.0.25. Works perfectly with both tuners, can handle perfectly two connections simultaneously.

With the 4b I spent quite some time to understand the issues. I noticed that if I plug the tuner into a USB 3.0 port the dmesg errors stop. However, the tuner is still 'laggy'. If I disable the second tuner it seems to work in a way, but as said very laggy, slow tuning etc. With the second tuner enabled it is awful.

User avatar
ledow
Posts: 40
Joined: Thu Feb 02, 2012 12:55 pm

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Fri Dec 06, 2019 12:24 pm

I've seeing this on a PCTV 460e - same errors in the logs, very unexpectedly poor performance of the device.

The same RPI4 can handle several DVB-T sticks / hats and stream no problem but the above USB2.0 stick doesn't seem to be doing what it should and throwing lots of errors.

I have an RPi3 which I'll try it on, but I suspect there's something not right here.

usbtop shows that the device is streaming data over the USB bus at 7000kbps, so it's way within the bounds of its USB2 interface but something's not right.

User avatar
ledow
Posts: 40
Joined: Thu Feb 02, 2012 12:55 pm

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Sun Dec 15, 2019 8:45 pm

Still no joy - I downgraded the EEPROM for the USB3 controller, I tried increasing the PCIe etc. values.
Still just errors with the same write error.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8688
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Mon Dec 16, 2019 8:26 am

This looks to be an issue in the 4.19 kernel only.
I have now pushed 5.4.3 onto my system with 2 DualHD tuners (and a DVB-S2, and , and so far I've had one

Code: Select all

em28xx 1-1.2.4.3:1.0: failed to get i2c transfer status from bridge register (error=-5)
but no other errors so far.
5.4 is seeming to be fairly stable, so I'll ask if we can bring "BRANCH=next rpi-update" onto it. Alternatively I think LibreElec is going to be switching to it imminently, or you can build it for yourself. It may even be that building the latest media-tree drivers would bring the correct functionality to 4.19.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

stefan9717
Posts: 14
Joined: Mon Nov 16, 2015 11:27 am

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Sun Dec 22, 2019 9:16 pm

Hi,
I have the same errors here on pi4b with raspbian buster, kernel 4.19.88, hauppauge wintv dual hd, and tvheadend.
The tv stream is there, but not fluent.
When I ran the same software on a pi3b+, it worked fine.
Strange thing is, when the tv adapter is plugged in, network transfers slow down significantly. I thought of problems with a ground loop/humming loop, but adding a tv ground loop isolater to the tv cable didn't make it better. So it really seems to be a driver issue??

em28xx 1-1.4:1.0: write to i2c device at 0xc8 failed with unknown error (status=128)

Is there anything I can do besides of waiting for ne next software updates and go back to the pi3b+?

Thank you,
Stefan

rosioara
Posts: 23
Joined: Sun Nov 17, 2019 3:07 am

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Fri Jan 10, 2020 6:30 pm

Hi,

I ran a test with kernel 5.4.3 and the issue is not (entirely) solved. I will try to explain:

After updating the kernel to 5.4 the dmesg errors are gone. However, in tvheadend the tuners response is very slow.

If I scan the DVB-C network around half of the frequencies fail if both tuners are enabled. With one single tuner the scanning works fine, however is veeeery slow.

The same DVB-C network scan with Raspberry Pi 2b, kernel 4.19 works perfectly with both tuners enabled, so smooth.

My feeling is something is wrong on how the USB device is managed by RP4...

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8688
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Fri Jan 10, 2020 6:44 pm

rosioara wrote:
Fri Jan 10, 2020 6:30 pm
Hi,

I ran a test with kernel 5.4.3 and the issue is not (entirely) solved. I will try to explain:

After updating the kernel to 5.4 the dmesg errors are gone. However, in tvheadend the tuners response is very slow.

If I scan the DVB-C network around half of the frequencies fail if both tuners are enabled. With one single tuner the scanning works fine, however is veeeery slow.

The same DVB-C network scan with Raspberry Pi 2b, kernel 4.19 works perfectly with both tuners enabled, so smooth.

My feeling is something is wrong on how the USB device is managed by RP4...
I'm not at home to check which 5.4 kernel I'm on.
I've a pair of Haupauge DualHD tuners, and 2 DVB-S2 tuners, and hadn't noticed tuning to have any issues. I'm using DVB-T2 though, so that may make the difference.

It'd be interesting to know how 5.4 performed on the 2B.
The other thought is that there is a new VLI firmware to solve issues with isochronous transfers (which I think DVB tends to use). https://www.raspberrypi.org/forums/view ... 9&t=260879

*edit*: I'm running 5.4.3.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

rosioara
Posts: 23
Joined: Sun Nov 17, 2019 3:07 am

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Tue Apr 28, 2020 9:15 pm

I had some time to revisit the rpi4 combination with the tuner. Unfortunately something is still wrong both with 4.19 and 5.4 kernels. Under tvheadend if I enable both tuners (it's a dual tuner) and perform a DVB-C scan many frequencies fail. I tried even the ubuntu 20.04 lts and it's exactly the same behaviour.

The funny part is a rpi2 v1.1 works very well.

dmesg does not return anything strange, with one exception where I got 2-3 errors like the following

em28xx 1-1.4:1.0: write to i2c device at 0xce failed with unknown error (status=128)

I would really want to make the tuner work properly with rpi4, what is to be done?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8688
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Wed Apr 29, 2020 10:35 am

Sorry I don't have DVB-C available to test against. For DVB-T2 it works fine on 5.4 with tvheadend.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

rosioara
Posts: 23
Joined: Sun Nov 17, 2019 3:07 am

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Wed Apr 29, 2020 7:03 pm

Do you enable both tuners?

I noticed with only one tuner enabled the scanning and tuning are fine, however with both tuners enabled it becomes strange.

I assume it's noticeable on DVB-C because there are more frequencies to be scanned.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8688
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Wed Apr 29, 2020 8:04 pm

rosioara wrote:
Wed Apr 29, 2020 7:03 pm
Do you enable both tuners?

I noticed with only one tuner enabled the scanning and tuning are fine, however with both tuners enabled it becomes strange.

I assume it's noticeable on DVB-C because there are more frequencies to be scanned.
Yes, I have both tuners active, and 2 DualHD's, so 4 tuners total.

It is curious that you say it works OK on a Pi2. I may ping our USB expert to see if there is anything funny in the USB config of the tuners. He is in communication with the company who make the USB chipset, so it may be there is something funny going on.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8688
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Sun May 03, 2020 8:21 am

One thought - I have an external USB3 hub into which all my tuners are plugged, and that's plugged into one of the USB3 sockets on the Pi4. (The other USB3 socket has a USB3 HDD connected).
The PI4 only has a single speed converter from USB3 to USB2 which will serve all USB2 devices connected directly to the Pi, but I'm effectively only using the one in the hub. I wonder if that has an impact on whether the DualHD plays nicely or not.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

stubright
Posts: 117
Joined: Sat Dec 24, 2011 11:12 pm

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Mon May 04, 2020 12:26 am

6by9 wrote:
Sun May 03, 2020 8:21 am
One thought - I have an external USB3 hub into which all my tuners are plugged, and that's plugged into one of the USB3 sockets on the Pi4. (The other USB3 socket has a USB3 HDD connected).
The PI4 only has a single speed converter from USB3 to USB2 which will serve all USB2 devices connected directly to the Pi, but I'm effectively only using the one in the hub. I wonder if that has an impact on whether the DualHD plays nicely or not.
@6by9
I don't know how much this will help (unfortunately, it's no help to rosioara) but I had the same kernel errors using the 4.9 kernel on my pi4 4GB Raspbian MythTV backend. I compiled and upgraded the kernel to 5.4.22-v7l+ #1 SMP a couple of months ago and haven't noticed any errors since.
I don't have a hub, I have the DualHD (both UK dvb-t2 tuners are working) in a USB 2.0 port with an HDPVR in the second USB 2.0 port and a USB3 HDD (with / partition) in a USB 3.0 port. I haven't tried the DualHD in a USB 3 port.
Stu

rosioara
Posts: 23
Joined: Sun Nov 17, 2019 3:07 am

Re: Haupauge DualHD (em28xx) driver broken. Kernel spam "write to i2c device at 0xcX failed with unknown error" on RPi4

Thu May 14, 2020 10:48 pm

There might be some hope with the USB controller firmware update here: viewtopic.php?f=29&t=273027

I cannot test for the moment

Return to “Troubleshooting”