ivtv-radio cannot find any active radio channels: ./ivtv-radio -vv -s 87.00, 1392: 0 87.06, 1393: 0 87.12, 1394: 0 87.19, 1395: 0 ... 107.81, 1725: 0 107.88, 1726: 0 107.94, 1727: 0 Hardware in question: 01:07.0 Multimedia video controller: Internext Compression Inc iTVC16 (CX23416) MPEG-2 Encoder (rev 01) Subsystem: Device ffad:0600 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 64 (32000ns min, 2000ns max), Cache Line Size: 32 bytes Interrupt: pin A routed to IRQ 17 Region 0: Memory at d8000000 (32-bit, prefetchable) [size=64M] Capabilities: [44] Power Management version 2 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME- Kernel driver in use: ivtv Kernel modules: ivtv Apr 18 04:02:22 localhost kernel: ivtv: Start initialization, version 1.4.1 Apr 18 04:02:22 localhost kernel: ivtv 0000:01:07.0: Non-NULL drvdata on register Apr 18 04:02:22 localhost kernel: ivtv0: Initializing card 0 Apr 18 04:02:22 localhost kernel: ivtv0: Autodetected Yuan PG600-2, GotView PCI DVD Lite card (cx23416 based) Apr 18 04:02:22 localhost kernel: ivtv0: info: base addr: 0xd8000000 Apr 18 04:02:22 localhost kernel: ivtv0: info: Enabling pci device Apr 18 04:02:22 localhost kernel: ivtv 0000:01:07.0: PCI INT A -> Link[APC2] -> GSI 17 (level, low) -> IRQ 17 Apr 18 04:02:22 localhost kernel: ivtv0: info: Attempting to enable Bus Mastering Apr 18 04:02:22 localhost kernel: ivtv0: info: Bus Mastering Enabled. Apr 18 04:02:22 localhost kernel: ivtv0: info: 22 (rev 1) at 01:07.0, irq: 17, latency: 64, memory: 0xd8000000 Apr 18 04:02:22 localhost kernel: ivtv0: info: attempting ioremap at 0xd8000000 len 0x00800000 Apr 18 04:02:22 localhost kernel: ivtv0: info: attempting ioremap at 0xda000000 len 0x00010000 Apr 18 04:02:22 localhost kernel: ivtv0: info: GPIO initial dir: 0000d000 out: 00001000 Apr 18 04:02:22 localhost kernel: ivtv0: info: activating i2c... Apr 18 04:02:22 localhost kernel: cx25840 2-0044: cx25843-24 found @ 0x88 (ivtv i2c driver #0) Apr 18 04:02:22 localhost kernel: ivtv0: info: Allocate DMA encoder MPG stream: 128 x 32768 buffers (4096kB total) Apr 18 04:02:22 localhost kernel: ivtv0: info: Allocate DMA encoder YUV stream: 64 x 32768 buffers (2048kB total) Apr 18 04:02:22 localhost kernel: ivtv0: info: Allocate DMA encoder VBI stream: 61 x 17472 buffers (1040kB total) Apr 18 04:02:22 localhost kernel: ivtv0: info: Allocate DMA encoder PCM stream: 72 x 4608 buffers (324kB total) Apr 18 04:02:22 localhost kernel: ivtv0: Registered device video0 for encoder MPG (4096 kB) Apr 18 04:02:22 localhost kernel: ivtv0: Registered device video32 for encoder YUV (2048 kB) Apr 18 04:02:22 localhost kernel: ivtv0: Registered device vbi0 for encoder VBI (1024 kB) Apr 18 04:02:22 localhost kernel: ivtv0: Registered device video24 for encoder PCM (320 kB) Apr 18 04:02:22 localhost kernel: ivtv0: Registered device radio0 for encoder radio Apr 18 04:02:22 localhost kernel: ivtv0: Initialized card: Yuan PG600-2, GotView PCI DVD Lite Apr 18 04:02:22 localhost kernel: ivtv: End initialization Apr 18 04:02:26 localhost kernel: ivtv0: info: Preparing for firmware halt. Apr 18 04:02:26 localhost kernel: ivtv0: info: Stopping VDM Apr 18 04:02:26 localhost kernel: ivtv0: info: Stopping AO Apr 18 04:02:26 localhost kernel: ivtv0: info: pinging (?) APU Apr 18 04:02:26 localhost kernel: ivtv0: info: Stopping VPU Apr 18 04:02:26 localhost kernel: ivtv0: info: Resetting Hw Blocks Apr 18 04:02:26 localhost kernel: ivtv0: info: Stopping SPU Apr 18 04:02:26 localhost kernel: ivtv0: info: init Encoder SDRAM pre-charge Apr 18 04:02:26 localhost kernel: ivtv0: info: init Encoder SDRAM refresh to 1us Apr 18 04:02:26 localhost kernel: ivtv0: info: Sleeping for 600ms Apr 18 04:02:27 localhost kernel: ivtv0: info: Loading encoder image Apr 18 04:02:27 localhost kernel: ivtv 0000:01:07.0: firmware: requesting v4l-cx2341x-enc.fw Apr 18 04:02:27 localhost kernel: ivtv0: Loaded v4l-cx2341x-enc.fw firmware (376836 bytes) Apr 18 04:02:27 localhost kernel: ivtv0: info: Getting firmware version.. Apr 18 04:02:27 localhost kernel: ivtv0: Encoder revision: 0x02060039 Apr 18 04:02:27 localhost kernel: cx25840 2-0044: firmware: requesting v4l-cx25840.fw Apr 18 04:02:30 localhost kernel: cx25840 2-0044: loaded v4l-cx25840.fw firmware (16382 bytes) Last year's hack suggested by Mauro Carvalho Chehab doesn't help (adding .input1 = 1, to struct xc2028_ctrl of ivtv-driver.c file).
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.