[Hardy Regression] cx22702 no longer works

Bug #209971 reported by Albin Tonnerre on 2008-03-31
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Stefan Bader
Stefan Bader

Bug Description

Binary package hint: linux-source-2.6.24


The cx22702 driver has been broken for about the last two weeks here, resulting in the TV card not working (Hauppauge HVR 1300).
The only clue I have about are the messages from dmesg when trying to initialize the card or using it:

[ 63.319425] cx22702_readreg: readreg error (ret == -121)
[ 63.320341] cx22702_writereg: writereg error (reg == 0x0d, val == 0x00, ret == -121)

repeated a large number of times.

I have not had the time to downgrade to an older kernel yet, but will do it if necessary
Please let me know if there's anything I can do to provide more informations about it

cat /proc/version_signature
Ubuntu 2.6.24-12.22-generic

uname -a
Linux pc-ras4041.res.insa 2.6.24-12-generic #1 SMP Wed Mar 12 22:31:43 UTC 2008 x86_64 GNU/Linux

Albin Tonnerre (lutin) wrote :

Hi Albin,

Care to test the latest 2.6.24-14 kernel to verify this issue still exists? If so, can you attach your full dmesg ouput which also captures these errors. Thanks.

Changed in linux:
status: New → Incomplete
Albin Tonnerre (lutin) wrote :

Hi Leann,
I tested with with 2.6.24-15, and this still happens. Besides, a oops now seems to happen.
Attached is the dmesg output


Jean-Louis Dupond (dupondje) wrote :

Doesn't work with any version. Seems like hardy is overwriting the GPIO ... Talked to the developper of the cx22702 driver and it looks like thats the problem.

when u do:

modprobe cx8802 debug=1

u get:

[ 120.714905] cx88[0]/2-mpeg: cx8802_request_release() Post release GPIO=3b

he told me the GPIO value is wrong. I managed after few rmmod's and modprobes to get another GPIO (not 3b). And then my card was working perfect!

He was going to make some patches. Will keep you informed !

Jean-Louis Dupond (dupondje) wrote :

Tried loading modules in the http://godard.b.free.fr/dotclear/index.php?2007/04/04/13-hauppauge-wintv-hvr1300-under-linux following order, and seems like its working ...

Jean-Louis Dupond (dupondje) wrote :


/etc/init.d/hal stop

unload modules
load modules

and everything is fine ...
when u run HAL again, its fucked up again ....

Seems like HAL is doing stopid

Jean-Louis Dupond (dupondje) wrote :


This fixxed it !!! Thx stoth for the support !!!

Frank Haverkamp (f-haverkamp) wrote :

I think what I reported in https://bugs.launchpad.net/ubuntu/+bug/212226 is the same or at least a very similar problem.
I am getting those messages multiple times:
[ 240.344223] cx22702_readreg: readreg error (ret == -121)
[ 240.345198] cx22702_writereg: writereg error (reg == 0x0d, val == 0x00, ret == -121)

Jean-Louis Dupond (dupondje) wrote :

Still occurs in 2.6.24-16 ! Recompiled module with patch, and works perfect again ...

aeneas (aeneascarver) wrote :

Please apply the patch! I've got the HVR-1300 too and I get exactly the same errors!

@Dupond Jean-Louis: Where did you apply the patch? I've downloaded the latest v4l sources, but the modules don't work with 2.6.24 -- there's unresolved symbols. Did you recmpile the ubuntu modules from the source packages? Thanks.

Jean-Louis Dupond (dupondje) wrote :

U can see on http://linuxtv.org/hg/~stoth/v4l-dvb/rev/67b7ef217867 what is changed.
If u download the SOURCE + PATCH, of the kernel u use (http://packages.ubuntu.com). U can add those changes to the ubuntu modules :) compile the thing, copy the compiled module u need. and reboot the banana ;)

Jean-Louis Dupond (dupondje) wrote :

New link for patch: http://linuxtv.org/hg/~stoth/v4l-dvb/rev/e55d97ff8bba


--- a/linux/drivers/media/video/cx88/cx88-cards.c Fri Apr 18 19:29:12 2008 -0300
+++ b/linux/drivers/media/video/cx88/cx88-cards.c Sat Apr 05 12:45:57 2008 -0400
@@ -1410,6 +1410,10 @@ static const struct cx88_board cx88_boar
/* fixme: Add radio support */
+ .radio = {
+ .type = CX88_RADIO,
+ .gpio0 = 0xe780,
+ },
.name = "ADS Tech Instant Video PCI",

Fabian (fsturm) wrote :


I first had the problem with a null pointer dereference and oops in the cx88 kernel module.
This seems to be bug #212271 and the fix from https://launchpad.net/~stefan-bader-canonical/+archive
made the kernel boot again and load the dvb drivers.

Now it seems I am stuck with the cx22702_writereg bug.

From the comment above, how can I unload and reload the modules?
Since they are so many, I seems it does not make sense to do it one by one.

Thanks, Fabian

Jean-Louis Dupond (dupondje) wrote :

Reboot ? :)

Fabian (fsturm) wrote :

Okay but the comment said "/etc/init.d hal stop".
But that won't be enough since it will be reloaded on reboot.

I will than have to remove hal completely from the runlevel.
So that's why I asked :-)

Jean-Louis Dupond (dupondje) wrote :

If u patch the kernel with the patch I pasted here, u can just keep using HAL like normal ... stopping HAL is just a workaround when your not using the patch ...

I have the same problem on at least 2 different machines with at least 2 different models of HVR-1300 (five cards in total) using the cx88 driver.

I can confirm that the above patch does fix my instances of the readreg/writereg problem with the current linux-image-2.6.24-16.30.

Is there any extra info that can be of use? I've compiled one too many kernels today :-p

for some reason there's a badly behaved link (at last for me)

Patch available on http://linuxtv.org/hg/~stoth/v4l-dvb/summary article entitled "cx88: enable radio GPIO correctly."

This is a massive showstopper not because the hardware doesn't work, but the malfunctioning hardware barfs [*] cx22702_readreg: readreg error (ret == -121) into /var/log/[syslog,kernel,messages] generating about 1Gb of logfile evey hour.

Fabian (fsturm) wrote :

Just wanted to add that the latest linux modules version from https://launchpad.net/~stefan-bader-canonical/+archive
adds the patch from above and fixes my hvr1300 problems.

Hi All,

Just adding the upstream git commit id and description. This will automatically be included in the Intrepid Ibex 8.10 kernel but I'll also milestone this for Hardy's 8.04.1 point release. Thanks.

commit 6b92b3bd7ac91b7e255541f4be9bfd55b12dae41
Author: Steven Toth <email address hidden>
Date: Sat Apr 5 16:45:57 2008 -0300

    V4L/DVB (7642): cx88: enable radio GPIO correctly

    cx88: enable radio GPIO correctly.

    Signed-off-by: Steven Toth <email address hidden>
    Signed-off-by: Mauro Carvalho Chehab <email address hidden>

Changed in linux:
assignee: nobody → ubuntu-kernel-team
importance: Undecided → Medium
milestone: none → ubuntu-8.04.1
status: Incomplete → Triaged
Frank Haverkamp (f-haverkamp) wrote :

Is there an estimate already when this fix will be available? Thanks.

Michael Krufky (mkrufky) wrote :

Please be aware that the GPIO fix, above, is already queued for, and the review period ends today -- this fix will be merged into the vanilla kernel today or tomorrow, the latest.



Please also be advised that the "fix" is merely a workaround -- the actual bug is in Ubuntu's hald, which is writing GPIOs to this PCI card.

How is hald doing this? WHY is hald doing this? We only see this issue in Ubuntu -- nobody else has reported this issue using other distros.

Tim Gardner (timg-tpi) wrote :

Cherry-pick this patch from stable 2.6.24.y when it becomes available.

Changed in linux:
assignee: ubuntu-kernel-team → stefan-bader-canonical
status: Triaged → In Progress
Michael Krufky (mkrufky) wrote : available now:


I highly recommend that you cherry-pick the ivtv fix as well. I didn't search through Launchpad bug reports to see if Ubuntu users are complaining about this, but it's definitely worth merging:



Stefan Bader (smb) wrote :

SRU Justification:

Impact: Generates huge amount of logdata

Fix description: The fix adds code to assign the correct values to enable the radio GPIO. Without this the driver (or HAL) is generating a hoge amount of log error message data (see https://bugs.edge.launchpad.net/ubuntu/+source/linux/+bug/209971/comments/18). The patch itself is straight forward and is verified to fix the problem.

Patch: http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.24.y.git;a=commitdiff;h=dcd8f5bca3782f180c028446710edc16ebce73f6

Testcase: Load the driver modules on a system with the hardware and check the system logs. Has been verified through PPA build (see https://bugs.edge.launchpad.net/ubuntu/+source/linux/+bug/209971/comments/19)

Fabian (fsturm) wrote :

I did the following upgrade yesterday: linux-ubuntu-modules-2.6.24-16-generic (2.6.24-16.23ubuntu3) to 2.6.24-16.23ubuntu4 and now I have the readreg/writereg error again. So my hvr 1300 does no longer work :-(

Was the patch https://bugs.launchpad.net/ubuntu/+source/linux/+bug/209971/comments/12 included in the ubuntu3 version omitted in the ubuntu4 version?

Cio (tuomo-aro) wrote :

I have this same issue with HVR-1300 running under Hardy kernel After boot, the DVB channels are not tuned in MythTV. No channels are not found for my DBV card setup in the Myth backend channel scan either. However, if I use create a temporary V4L card entry and try to scan the channels for it, I still don't find any at that point but then scanning the channels for the DVB card entry miraculously starts working and I see no more readreg/writereg errors in logs.

Please consider this just as related information, not a workaround! I don't want to go through this long and awkward process after every boot.

Stefan Bader (smb) wrote :

Initially I had the patch in LUM. But the DVB modules are now (based on another request) again build only in the kernel package. The patch has been included there but still has to be released (in hardy-proposed). But this is the reason I did not include it in the latest ppa lum. You would have to wait for a kernel -17-32. Or might use the ppa -18-31 (this has some more code for regression testing, so it might help to evaluate two things).

Stefan Bader (smb) wrote :

310636e0ae1942b760354fafc10e179be40b1d1c in hardy

Changed in linux:
status: In Progress → Fix Committed

> You would have to wait for a kernel -17-32

Is that a typo or is 2.6.24-17.31 unfixed?

Carles Casas (carles-casas) wrote :

Tested in kernel 2.6.24-18.32 and is not working yet

.Ulli (ulli) wrote :

same problem here

Martin Pitt (pitti) wrote :

Accepted into -proposed, please test and give feedback here

Changed in linux:
status: New → Fix Committed
.Ulli (ulli) wrote :

Now the boot is possible without this error, but the error still persists.

The line 541 within the attached dmesg is the start of a channel-scan using MythTV 0.21.0+fixes16838-0ubuntu3.1 (hardy-proposed).

aeneas (aeneascarver) wrote :

No, this does not work with 2.6.24-18.20 -- I still get the readreg error:
[ 1950.480335] cx22702_readreg: readreg error (ret == -121)

It worked with the -18 PPA from Stefan though....

aeneas (aeneascarver) wrote :

Sorry, I meant: It does not work with linux-image-2.6.24-18-generic, version: 2.6.24-18.32

Steve Langasek (vorlon) wrote :

According to the changelog, this bug is fixed only in linux 2.6.24-19.33 or later (the kernel currently available in hardy-proposed). Please try that kernel and report any results here.

Steve Langasek (vorlon) on 2008-06-06
Changed in linux:
milestone: none → ubuntu-8.04.1
milestone: ubuntu-8.04.1 → none
Carles Casas (carles-casas) wrote :

Tested with last kernel 2.6.24-19-generic at hardy-proposed.

Strange, dmesg shows a couple of cx22702_readreg errors, but the card is working perfectly using me-tv.

And the good news is that the analog driver also works out of the box without unloading and loading the modules in a different order again.
tested with tvviewer.

Thanks for solving this issue.

aeneas (aeneascarver) wrote :

Tested with the latest kernel: 2.6.24-19.33 : everything works again!

Thanks a lot.

Martin Pitt (pitti) wrote :

Copied to hardy-updates.

Changed in linux:
status: Fix Committed → Fix Released

This is "Fix Released" for Intrepid.

Changed in linux:
status: Fix Committed → Fix Released
Tim Swait (timswait) wrote :

This bug seems to have returned. I have just upgraded a Mythbuntu system from Intrepid to Karmic (kernel and the HVR-1300 card has stopped working. The symptoms sound similar to above, can't tune in to any of the channels in it's channel list and unable to find anything when scanning. The signal to noise ratio never varies from exactly 50% when it's scanning, which seems odd. I've tried removing a reinstalling the modules listed here: http://godard.b.free.fr/dotclear/index.php?2007/04/04/13-hauppauge-wintv-hvr1300-under-linux, but half of them I can't remove as they are apparently in use, how can I reload these modules in the right order and is this likely to help if I did?

Tim Swait (timswait) wrote :

Whoops, I meant I ugraded from Jaunty (not intrepid) to Karmic.

Marco il Serio (marco-ernst) wrote :

Confirmed, HVR1300 not scanning (tried Me-TV and w_scan) or tuning in to know channels after upgrading to Karmic. Tried V4L-Update, No Success. dmesg shows no Readreg errors.

ERROR: Sorry - i couldn't get any working frequency/transponder
 Nothing to scan!!

DFdario (dfdario) wrote :

Those having problem with Karmic should have a loot to Bug #439163

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers