Bug 13131
Summary: | FM tuner works but `ivtv-radio` cannot find any active radio channels on GotView PCI DVD Lite card | ||
---|---|---|---|
Product: | v4l-dvb | Reporter: | Artem S. Tashkinov (aros) |
Component: | radio | Assignee: | Hans Verkuil (hverkuil) |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | alan, hverkuil, v4l-dvb_v4l-core |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | GIT | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
dmesg
tuner-xc2028.c.diff by Hans Verkuil |
Description
Artem S. Tashkinov
2009-04-17 22:08:02 UTC
It's not a regression, FM radio on this TV/FM tuner has never worked in Linux. I may be mistaken, but I don't believe anyone managed to get radio working on a xceive 2028 + cx25840 card. Are there any chances that this device will work on Linux? Try this: in ivtv-cards.c in the ivtv_card_pg600v2 card definition there is this line: .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO5 }, Try to test the radio using values CX25840_AUDIO4, AUDIO6, 7, 8 and CX25840_AUDIO_SERIAL. Perhaps they wired the radio sound differently. It's unlikely, but nevertheless worth testing. If this doesn't work, then the chances are pretty slim. Created attachment 21885 [details]
dmesg
Wow!
I've just downloaded and installed v4l-dvb-bff77ec33116 and radio indeed works without any hacks!!
The attachment is dmesg output for vanilla kernel 2.6.30. At first vanilla ivtv driver is automatically loaded, then I manually rmmod'ed it and installed ivtv bff77ec33116 hg snapshot.
Thank you very much for your hard work, but, please, don't break tuner_xc2028 driver in the future :) As a side note I should mention that ivtv-radio utility doesn't work correctly: for both -s and -a modes it cannot detect a single FM radio station, but as soon as I manually run it with a frequency of my choice (like ./ivtv-radio -f 100.0), I can hear the radio station clearly. ./ivtv-radio -vv -a 65.00, 1040000: 0 65.06, 1041000: 0 65.12, 1042000: 0 ... 100.00, 1600000: 0 (a working radio station but it's not reported as working) ... Hmm, looking at the code I think that the signal strength detection is broken. Can you try this: Edit drivers/media/common/tuners/tuner-xc2028.c, go to function xc2028_signal and replace this code: /* Frequency is locked */ if (frq_lock == 1) signal = 32768; /* Get SNR of the video signal */ rc = xc2028_get_reg(priv, 0x0040, &signal); if (rc < 0) goto ret; /* Use both frq_lock and signal to generate the result */ signal = signal || ((signal & 0x07) << 12); with this code: /* Frequency is locked */ if (frq_lock == 1) { signal = 32768; } else { /* Get SNR of the video signal */ rc = xc2028_get_reg(priv, 0x0040, &signal); if (rc < 0) goto ret; signal = (signal & 0x07) << 12; } Let me know if you now get a correct signal strength. Reopened to investigate the signal strength issue. Created attachment 22020 [details] tuner-xc2028.c.diff by Hans Verkuil (In reply to comment #7) > Hmm, looking at the code I think that the signal strength detection is > broken. > > Can you try this: > > Edit drivers/media/common/tuners/tuner-xc2028.c, go to function xc2028_signal > and replace this code: If I got your code right, it still doesn't produce meaningful results. ivtv-radio works but it's unable to show working radio stations. I was testing against hg snapshot v4l-dvb-bff77ec33116. Just a quick update: I verified that the old code was indeed wrong. Whether the new code works or not is hard to tell for me at the moment as I do not have a proper cable for the radio antenna. I won't be able to get hold of that until 3 weeks from now. When I have it I can do some more testing. It would not surprise me if this signal strength register only works with TV and not with radio signals. This brings an idea that you probably have to add a remark to ivtv-radio manual and say that some fm tuners do not report signal strength thus looking for radio stations is futile. Or probably you have to rework a signal strength detection code of ivtv-radio so that it actually "listens" (detects actual signal/noise ratio) to the frequencies it's turning/switching to. |