Skip to contentSkip to conversation

IR Receiver on an Tevii S470

DISCUSSION Matthias Fechner 5 participants 28 messages Nov 18, 2009 – Dec 11, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi,

I bought some days ago a Tevii S470 DVB-S2 (PCI-E) card and got it running with the driver from:
http://mercurial.intuxication.org/hg/s2-liplianin

But I was not successfull in got the IR receiver working. It seems that it is not supported yet by the driver.

Is there maybe some code available to get the IR receiver with evdev running?

Thanks a lot,
Matthias

#1 lore raw

Hi,

Quoted 7 lines · Matthias Fechner

I bought some days ago a Tevii S470 DVB-S2 (PCI-E) card and got it running with the driver from:
http://mercurial.intuxication.org/hg/s2-liplianin

But I was not successfull in got the IR receiver working. It seems that it is not supported yet by the driver.

Is there maybe some code available to get the IR receiver with evdev running?

it seems to be not the correct mailing list, could some please suggest where I can ask that question?

Bye
Matthias

Signature · 4 lines
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning." --
Rich Cook
#2 lore raw
Quoted 12 lines · Matthias Fechner

Hi,

Quoted 9 lines · Matthias Fechner

I bought some days ago a Tevii S470 DVB-S2 (PCI-E) card and got it running with the driver from:
http://mercurial.intuxication.org/hg/s2-liplianin

But I was not successfull in got the IR receiver working. It seems that it is not supported yet by the driver.

Is there maybe some code available to get the IR receiver with evdev running?

What bridge chip does the TeVii S470 use: a CX23885, CX23887, or CX23888?

Does the TeVii S470 have a separate microcontroller chip for IR somewhere on the board, or does it not have one? (If you can't tell, just provide a list of the chip markings on the board.)

If the card is using the built in IR controller of the CX23888 than that should be pretty easy to get working, we'll just need you to do some experimentation with a patch.

If the card is using the built in IR controller in the CX23885, then you'll have to wait until I port my CX23888 IR controller changes to work with the IR controller in the CX23885. That should be somewhat straightforward, but will take time. Then we'll still need you to experiment with a patch.

If the card is using a separate IR microcontroller, I'm not sure where to begin.... :P

Regards,
Andy

#3 lore raw
Quoted 35 lines · Andy Walls
Quoted 12 lines · Matthias Fechner

Hi,

Quoted 9 lines · Matthias Fechner

I bought some days ago a Tevii S470 DVB-S2 (PCI-E) card and got it running with the driver from:
http://mercurial.intuxication.org/hg/s2-liplianin

But I was not successfull in got the IR receiver working. It seems that it is not supported yet by the driver.

Is there maybe some code available to get the IR receiver with evdev running?

What bridge chip does the TeVii S470 use: a CX23885, CX23887, or CX23888?

Does the TeVii S470 have a separate microcontroller chip for IR somewhere on the board, or does it not have one? (If you can't tell, just provide a list of the chip markings on the board.)

If the card is using the built in IR controller of the CX23888 than that should be pretty easy to get working, we'll just need you to do some experimentation with a patch.

If the card is using the built in IR controller in the CX23885, then you'll have to wait until I port my CX23888 IR controller changes to work with the IR controller in the CX23885. That should be somewhat straightforward, but will take time. Then we'll still need you to experiment with a patch.

If the card is using a separate IR microcontroller, I'm not sure where to begin.... :P

Quoted 8 lines

Regards,
Andy

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

According to the Wiki it's a cx23885. Looks like the IR is on the chip. It's in the Wiki: http://linuxtv.org/wiki/index.php/TeVii_S470

Tevii is listing the card as supported in Linux with ti's own s2api driver download, its here: http://www.tevii.com/Support.asp

Jonas

#4 lore raw
In reply to Andy Walls
Quoted 35 lines · On 21 ноября 2009 22:41:42 Andy Walls wrote:
Quoted 12 lines · Matthias Fechner

Hi,

Quoted 9 lines · Matthias Fechner

I bought some days ago a Tevii S470 DVB-S2 (PCI-E) card and got it running with the driver from:
http://mercurial.intuxication.org/hg/s2-liplianin

But I was not successfull in got the IR receiver working. It seems that it is not supported yet by the driver.

Is there maybe some code available to get the IR receiver with evdev running?

What bridge chip does the TeVii S470 use: a CX23885, CX23887, or CX23888?

Does the TeVii S470 have a separate microcontroller chip for IR somewhere on the board, or does it not have one? (If you can't tell, just provide a list of the chip markings on the board.)

If the card is using the built in IR controller of the CX23888 than that should be pretty easy to get working, we'll just need you to do some experimentation with a patch.

If the card is using the built in IR controller in the CX23885, then you'll have to wait until I port my CX23888 IR controller changes to work with the IR controller in the CX23885. That should be somewhat straightforward, but will take time. Then we'll still need you to experiment with a patch.

If the card is using a separate IR microcontroller, I'm not sure where to begin.... :P

Quoted 7 lines

Regards,
Andy

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

It's cx23885 definitely.
Remote uses NEC codes.
In any case I can test.

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#5 lore raw
Quoted 33 lines · Igor M. Liplianin
Quoted 32 lines · On 21 ноября 2009 22:41:42 Andy Walls wrote:
Quoted 12 lines · Matthias Fechner

Hi,

Quoted 9 lines · Matthias Fechner

I bought some days ago a Tevii S470 DVB-S2 (PCI-E) card and got it running with the driver from:
http://mercurial.intuxication.org/hg/s2-liplianin

But I was not successfull in got the IR receiver working. It seems that it is not supported yet by the driver.

Is there maybe some code available to get the IR receiver with evdev running?

What bridge chip does the TeVii S470 use: a CX23885, CX23887, or CX23888?

Does the TeVii S470 have a separate microcontroller chip for IR somewhere on the board, or does it not have one? (If you can't tell, just provide a list of the chip markings on the board.)

If the card is using the built in IR controller of the CX23888 than that should be pretty easy to get working, we'll just need you to do some experimentation with a patch.

If the card is using the built in IR controller in the CX23885, then you'll have to wait until I port my CX23888 IR controller changes to work with the IR controller in the CX23885. That should be somewhat straightforward, but will take time. Then we'll still need you to experiment with a patch.

Quoted 8 lines
Quoted 6 lines

If the card is using a separate IR microcontroller, I'm not sure where to begin.... :P

Regards,
Andy

It's cx23885 definitely.
Remote uses NEC codes.

OK. Things I have to do:

1. Add v4l2_subdev_ir_ops for the CX23885 to the cx25840 module. Much of this code will look like the cx23885/cx23888-ir.[ch] code, except a little nicer when accessing I2C bus registers.

2. Add NEC pulse decoding to cx23885/cx23885-input.c. This will be new work, as right now the cx23885 driver only performs RC-5 decoding.

3. Add IR intiialization for the TeVii S470 into the cx23885 driver. This will be easy, except for filling out the v4l2_subdev_ir_parameters in cx23885/cx23885-input.c:cx23885_input_ir_start() ; I will need someone with hardware to experiment.

Quoted 1 line

In any case I can test.

Thank you. I will probably need you for testing when ready.

I was planning to do step 1 above for HVR-1800 IR anyway.

I will estimate that I may have something ready by about Christmas (25 December 2009), unless work becomes very busy.

Regards,
Andy

#6 lore raw

Hi Andy,

Quoted 8 lines · Andy Walls

Thank you. I will probably need you for testing when ready.

I was planning to do step 1 above for HVR-1800 IR anyway.

I will estimate that I may have something ready by about Christmas (25 December 2009), unless work becomes very busy.

thanks a lot for your answer.
I uploaded two pictures I did from the card, you can find it here:
http://fechner.net/tevii-s470/

It is a CX23885.
The driver I use is the ds3000.
lspci says:
02:00.0 Multimedia video controller: Conexant Device 8852 (rev 02)
Subsystem: Device d470:9022
Flags: bus master, fast devsel, latency 0, IRQ 19 Memory at fac00000 (64-bit, non-prefetchable) [size=2M]
Capabilities: [40] Express Endpoint, MSI 00
Capabilities: [80] Power Management version 2
Capabilities: [90] Vital Product Data <?>
Capabilities: [a0] Message Signalled Interrupts: Mask- 64bit+
Count=1/1 Enable-
Capabilities: [100] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq+ ACSVoil-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq- ACSVoil-
UESvrt: DLP+ SDES- TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
RxOF+ MalfTLP+ ECRC- UnsupReq- ACSVoil-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
AERCap: First Error Pointer: 14, GenCap- CGenEn- ChkCap- ChkEn-
Capabilities: [200] Virtual Channel <?>
Kernel driver in use: cx23885
Kernel modules: cx23885

lsmod says:

Module                  Size  Used by
lirc_serial            10740  1
snd_mixer_oss          12428  0
lirc_dev                9512  3 lirc_serial
snd_hda_codec_nvhdmi     3976  1
ds3000                 12820  1
snd_hda_codec_realtek   184292  1
cx23885               105116  9
cx2341x                10784  1 cx23885
v4l2_common            15428  2 cx23885,cx2341x
nvidia               8860344  44
videodev               34080  2 cx23885,v4l2_common
v4l1_compat            11252  1 videodev
videobuf_dma_sg        11176  1 cx23885
videobuf_dvb            6308  1 cx23885
dvb_core               78492  2 cx23885,videobuf_dvb
videobuf_core          16280  3 cx23885,videobuf_dma_sg,videobuf_dvb
snd_hda_intel          22004  1
ir_common              46132  1 cx23885
snd_hda_codec          55908  3 snd_hda_codec_nvhdmi,snd_hda_codec_realtek,snd_hda_intel
btcx_risc               4244  1 cx23885
tveeprom               10652  1 cx23885
snd_pcm                63812  3 snd_hda_intel,snd_hda_codec
snd_timer              17584  1 snd_pcm
ehci_hcd               29628  0
ohci_hcd               19664  0
snd                    49728  7 snd_mixer_oss,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer
usbcore               117380  2 ehci_hcd,ohci_hcd
i2c_nforce2             6092  0
serio_raw               4708  0
soundcore               6276  1 snd
i2c_core               19848  7 ds3000,cx23885,v4l2_common,nvidia,videodev,tveeprom,i2c_nforce2
snd_page_alloc          7952  2 snd_hda_intel,snd_pcm
evdev                   8148  4

I can test any patch when you have one ready, currently I'm using lirc together with a TechnoTrend RemoteControl. Thanks a lot and have a nice week

Best regards,
Matthias

Signature · 1 line
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook
#7 lore raw
Quoted 12 lines · Matthias Fechner

Hi Andy,

Quoted 8 lines · Andy Walls

Thank you. I will probably need you for testing when ready.

I was planning to do step 1 above for HVR-1800 IR anyway.

I will estimate that I may have something ready by about Christmas (25 December 2009), unless work becomes very busy.

Quoted 7 lines

thanks a lot for your answer.
I uploaded two pictures I did from the card, you can find it here:
http://fechner.net/tevii-s470/

It is a CX23885.
The driver I use is the ds3000.
lspci says:

[snip]

Matthias,

Thanks for the pictures. OK so of the two other interesting chips on the S470:

U4 is an I2C connected EEPROM - we don't care about that for IR.

U10 appears to perhaps be a Silicon Labs C8051F300 microcontroller or similar:

http://www.silabs.com/products/mcu/smallmcu/Pages/C8051F30x.aspx

Since the 'F300 has an A/D convertor and has an SMBus interface (compatable with the I2C bus), I suspect this chip could be the IR controller on the TeVii S470.

Could you as root:

# modprobe cx23885
# modprobe i2c-dev
# i2c-detect -l
(to list all the i2c buses, including cx23885 mastered i2c buses)
# i2c-detect -y N
(to show the addresses in use on bus # N: only query the cx23885 buses)

i2c-detect was in the lm-sensors package last I checked. (Jean can correct me if I'm wrong.)

With that information, I should be able to figure out what I2C address that microcontroller is listening to.

Then we can work out how to read and decode it's data and add it to ir-kbd-i2c at least. Depending on how your kernel and LIRC versions LIRC might still work with I2C IR chips too.

All presupposing of course that that 'F300 chip is for IR...

Regards,
Andy

Quoted 6 lines

I can test any patch when you have one ready, currently I'm using lirc together with a TechnoTrend RemoteControl.
Thanks a lot and have a nice week

Best regards,
Matthias

#8 lore raw

Hi Andy,

Quoted 6 lines · Andy Walls
# modprobe cx23885
# modprobe i2c-dev
# i2c-detect -l
(to list all the i2c buses, including cx23885 mastered i2c buses)
i2c-0    smbus         SMBus nForce2 adapter at 4d00       SMBus adapter
i2c-1    i2c           cx23885[0]                          I2C adapter
i2c-2    i2c           cx23885[0]                          I2C adapter
i2c-3    i2c           cx23885[0]                          I2C adapter
i2c-4    i2c           NVIDIA i2c adapter                  I2C adapter
i2c-5    i2c           NVIDIA i2c adapter                  I2C adapter
i2c-6    i2c           NVIDIA i2c adapter                  I2C adapter
Quoted 4 lines
# i2c-detect -y N
(to show the addresses in use on bus # N: only query the cx23885 buses)

vdrhd1 ~ # i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: 30 31 32 33 34 35 36 37 -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- -- vdrhd1 ~ # i2cdetect -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: 30 31 32 33 34 35 36 37 -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- -- vdrhd1 ~ # i2cdetect -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: 30 31 32 33 34 35 36 37 -- -- -- -- -- -- -- -- 40: -- -- -- -- 44 -- -- -- -- -- -- -- 4c -- -- -- 50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --

Quoted 4 lines

i2c-detect was in the lm-sensors package last I checked. (Jean can correct me if I'm wrong.)

ok, it seems that the name of tool is different here, but I think it has the same output.

Quoted 5 lines

Then we can work out how to read and decode it's data and add it to ir-kbd-i2c at least. Depending on how your kernel and LIRC versions LIRC might still work with I2C IR chips too.

I will do my best to help you here.

Bye,
Matthias

Signature · 1 line
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook
#15 lore raw
In reply to Andy Walls

Hi Andy,

Quoted 34 lines · Andy Walls
Quoted 7 lines · Matthias Fechner

thanks a lot for your answer.
I uploaded two pictures I did from the card, you can find it here:
http://fechner.net/tevii-s470/

It is a CX23885.
The driver I use is the ds3000.
lspci says:

[snip]

Thanks for the pictures. OK so of the two other interesting chips on the S470:

U4 is an I2C connected EEPROM - we don't care about that for IR.

U10 appears to perhaps be a Silicon Labs C8051F300 microcontroller or similar:

http://www.silabs.com/products/mcu/smallmcu/Pages/C8051F30x.aspx

Since the 'F300 has an A/D convertor and has an SMBus interface (compatable with the I2C bus), I suspect this chip could be the IR controller on the TeVii S470.

Could you as root:

# modprobe cx23885
# modprobe i2c-dev
# i2c-detect -l
(to list all the i2c buses, including cx23885 mastered i2c buses)
# i2c-detect -y N
(to show the addresses in use on bus # N: only query the cx23885 buses)
Quoted 2 lines

i2c-detect was in the lm-sensors package last I checked. (Jean can correct me if I'm wrong.)

It is actually named "i2cdetect" (no dash). It used to live in the lm-sensors package (up to 2.10.x) but is now in i2c-tools:

http://www.lm-sensors.org/wiki/I2CTools

Quoted 2 lines

With that information, I should be able to figure out what I2C address that microcontroller is listening to.

Signature · 1 line
Jean Delvare
#9 lore raw
In reply to Matthias Fechner
Quoted 43 lines · Matthias Fechner

Hi Andy,

Quoted 6 lines · Andy Walls
# modprobe cx23885
# modprobe i2c-dev
# i2c-detect -l
(to list all the i2c buses, including cx23885 mastered i2c buses)
i2c-0    smbus         SMBus nForce2 adapter at 4d00       SMBus adapter
i2c-1    i2c           cx23885[0]                          I2C adapter
i2c-2    i2c           cx23885[0]                          I2C adapter
i2c-3    i2c           cx23885[0]                          I2C adapter
i2c-4    i2c           NVIDIA i2c adapter                  I2C adapter
i2c-5    i2c           NVIDIA i2c adapter                  I2C adapter
i2c-6    i2c           NVIDIA i2c adapter                  I2C adapter
Quoted 4 lines
# i2c-detect -y N
(to show the addresses in use on bus # N: only query the cx23885 buses)

vdrhd1 ~ # i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: 30 31 32 33 34 35 36 37 -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
vdrhd1 ~ # i2cdetect -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: 30 31 32 33 34 35 36 37 -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
vdrhd1 ~ # i2cdetect -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f

Quoted 8 lines

00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: 30 31 32 33 34 35 36 37 -- -- -- -- -- -- -- -- 40: -- -- -- -- 44 -- -- -- -- -- -- -- 4c -- -- -- 50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --

The fact that 0x30-0x37 and 0x50-0x5f all reply suggest that the bus driver erroneously returns success to "SMBus receive byte" transactions even when no device acks. This is a bug which should get fixed. If you point me to the I2C adapter driver code, I can take a look.

In the meantime, you can try i2cdetect -q to force i2cdetect to use "SMBus quick" commands for all the addresses. Beware though that some chips are known to not like it at all (in particular the infamous AT24RF08... not that I expect to ever see one on a TV adapter but you never know.)

At least the above scan has already found 3 chips.

Signature · 1 line
Jean Delvare
#16 lore raw
In reply to Andy Walls
Quoted 54 lines · On 22 ноября 2009 22:11:47 Andy Walls wrote:
Quoted 11 lines · Matthias Fechner

Hi Andy,

Quoted 7 lines · Andy Walls

Thank you. I will probably need you for testing when ready.

I was planning to do step 1 above for HVR-1800 IR anyway.

I will estimate that I may have something ready by about Christmas (25 December 2009), unless work becomes very busy.

Quoted 7 lines

thanks a lot for your answer.
I uploaded two pictures I did from the card, you can find it here:
http://fechner.net/tevii-s470/

It is a CX23885.
The driver I use is the ds3000.
lspci says:

[snip]

Matthias,

Thanks for the pictures. OK so of the two other interesting chips on the S470:

U4 is an I2C connected EEPROM - we don't care about that for IR.

U10 appears to perhaps be a Silicon Labs C8051F300 microcontroller or similar:

http://www.silabs.com/products/mcu/smallmcu/Pages/C8051F30x.aspx

Since the 'F300 has an A/D convertor and has an SMBus interface (compatable with the I2C bus), I suspect this chip could be the IR controller on the TeVii S470.

Could you as root:

# modprobe cx23885
# modprobe i2c-dev
# i2c-detect -l
(to list all the i2c buses, including cx23885 mastered i2c buses)
# i2c-detect -y N
(to show the addresses in use on bus # N: only query the cx23885 buses)

i2c-detect was in the lm-sensors package last I checked. (Jean can correct me if I'm wrong.)

With that information, I should be able to figure out what I2C address that microcontroller is listening to.

Quoted 6 lines

Then we can work out how to read and decode it's data and add it to ir-kbd-i2c at least. Depending on how your kernel and LIRC versions LIRC might still work with I2C IR chips too.

All presupposing of course that that 'F300 chip is for IR...

Receiver connected to cx23885 IR_RX(pin 106). It is not difficult to track.

F300 is for LNB power control.
It connected to cx23885 GPIO pins:
GPIO0 - data - P0.3 F300
GPIO1 - reset - P0.2 F300
GPIO2 - clk - P0.1 F300
GPIO3 - busy - P0.0 F300

Interface seems not I2C/SMBUS.

Source code from TeVii:
http://mercurial.intuxication.org/hg/s2-
liplianin/file/d0dfe416e0f6/linux/drivers/media/video/cx23885/tevii_pwr.c

BR
Igor

Quoted 10 lines

Regards,
Andy

Quoted 6 lines

I can test any patch when you have one ready, currently I'm using lirc together with a TechnoTrend RemoteControl.
Thanks a lot and have a nice week

Best regards,
Matthias

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#17 lore raw
Quoted 55 lines · Igor M. Liplianin
Quoted 54 lines · On 22 ноября 2009 22:11:47 Andy Walls wrote:
Quoted 11 lines · Matthias Fechner

Hi Andy,

Quoted 7 lines · Andy Walls

Thank you. I will probably need you for testing when ready.

I was planning to do step 1 above for HVR-1800 IR anyway.

I will estimate that I may have something ready by about Christmas (25 December 2009), unless work becomes very busy.

Quoted 7 lines

thanks a lot for your answer.
I uploaded two pictures I did from the card, you can find it here:
http://fechner.net/tevii-s470/

It is a CX23885.
The driver I use is the ds3000.
lspci says:

[snip]

Matthias,

Thanks for the pictures. OK so of the two other interesting chips on the S470:

U4 is an I2C connected EEPROM - we don't care about that for IR.

U10 appears to perhaps be a Silicon Labs C8051F300 microcontroller or similar:

http://www.silabs.com/products/mcu/smallmcu/Pages/C8051F30x.aspx

Since the 'F300 has an A/D convertor and has an SMBus interface (compatable with the I2C bus), I suspect this chip could be the IR controller on the TeVii S470.

Could you as root:

# modprobe cx23885
# modprobe i2c-dev
# i2c-detect -l
(to list all the i2c buses, including cx23885 mastered i2c buses)
# i2c-detect -y N
(to show the addresses in use on bus # N: only query the cx23885 buses)

i2c-detect was in the lm-sensors package last I checked. (Jean can correct me if I'm wrong.)

With that information, I should be able to figure out what I2C address that microcontroller is listening to.

Quoted 7 lines
Quoted 6 lines

Then we can work out how to read and decode it's data and add it to ir-kbd-i2c at least. Depending on how your kernel and LIRC versions LIRC might still work with I2C IR chips too.

All presupposing of course that that 'F300 chip is for IR...

Receiver connected to cx23885 IR_RX(pin 106). It is not difficult to track.

Igor,

Thank you. I did not have a board to trace. I will then stick with my original plan since the F300 doesn't do the IR.

Quoted 7 lines

F300 is for LNB power control.
It connected to cx23885 GPIO pins:
GPIO0 - data - P0.3 F300
GPIO1 - reset - P0.2 F300
GPIO2 - clk - P0.1 F300
GPIO3 - busy - P0.0 F300

Quoted 5 lines

Interface seems not I2C/SMBUS.

Source code from TeVii:
http://mercurial.intuxication.org/hg/s2-
liplianin/file/d0dfe416e0f6/linux/drivers/media/video/cx23885/tevii_pwr.c

Interesting....

static void Delay1mS(void)

   {
	   udelay(800);

}

:D

Regards,
Andy

Quoted 2 lines

BR
Igor

#10 lore raw
In reply to Jean Delvare
Quoted 53 lines · Jean Delvare
Quoted 43 lines · Matthias Fechner

Hi Andy,

Quoted 6 lines · Andy Walls
# modprobe cx23885
# modprobe i2c-dev
# i2c-detect -l
(to list all the i2c buses, including cx23885 mastered i2c buses)
i2c-0    smbus         SMBus nForce2 adapter at 4d00       SMBus adapter
i2c-1    i2c           cx23885[0]                          I2C adapter
i2c-2    i2c           cx23885[0]                          I2C adapter
i2c-3    i2c           cx23885[0]                          I2C adapter
i2c-4    i2c           NVIDIA i2c adapter                  I2C adapter
i2c-5    i2c           NVIDIA i2c adapter                  I2C adapter
i2c-6    i2c           NVIDIA i2c adapter                  I2C adapter
Quoted 4 lines
# i2c-detect -y N
(to show the addresses in use on bus # N: only query the cx23885 buses)

vdrhd1 ~ # i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: 30 31 32 33 34 35 36 37 -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
vdrhd1 ~ # i2cdetect -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: 30 31 32 33 34 35 36 37 -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
vdrhd1 ~ # i2cdetect -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f

Quoted 8 lines

00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: 30 31 32 33 34 35 36 37 -- -- -- -- -- -- -- -- 40: -- -- -- -- 44 -- -- -- -- -- -- -- 4c -- -- -- 50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --

Quoted 4 lines

The fact that 0x30-0x37 and 0x50-0x5f all reply suggest that the bus driver erroneously returns success to "SMBus receive byte" transactions even when no device acks. This is a bug which should get fixed. If you point me to the I2C adapter driver code, I can take a look.

Jean,

Although Igor's information makes the original need for this moot, here is the i2c adapter driver code:

http://linuxtv.org/hg/v4l-dvb/file/8bff7e6c44d4/linux/drivers/media/video/cx23885/cx23885-i2c.c

Note the CX2388[578] chips have 3 I2C masters, 2 for external buses, and 1 internal "on silicon" bus which the driver sets up as the 3rd bus. The internal bus should at least have devices at 0x44 and 0x4c as confirmed above. I'll note the comment in this file, that indicates the "on silicon" I2C bus runs at 1.95 MHz:

http://linuxtv.org/hg/v4l-dvb/file/8bff7e6c44d4/linux/drivers/media/video/cx23885/cx23885-core.c

The TeVii S470 card had what looked like at serial I2C EEPROM with the A0, A1, and A2 pins all grounded, so I assume it is at 0x50 on one of the CX23885's external I2C buses.

Regards,
Andy

Quoted 8 lines

In the meantime, you can try i2cdetect -q to force i2cdetect to use "SMBus quick" commands for all the addresses. Beware though that some chips are known to not like it at all (in particular the infamous AT24RF08... not that I expect to ever see one on a TV adapter but you never know.)

At least the above scan has already found 3 chips.

#11 lore raw
Quoted 10 lines · Andy Walls
Quoted 4 lines · Jean Delvare

The fact that 0x30-0x37 and 0x50-0x5f all reply suggest that the bus driver erroneously returns success to "SMBus receive byte" transactions even when no device acks. This is a bug which should get fixed. If you point me to the I2C adapter driver code, I can take a look.

Although Igor's information makes the original need for this moot, here is the i2c adapter driver code:

http://linuxtv.org/hg/v4l-dvb/file/8bff7e6c44d4/linux/drivers/media/video/cx23885/cx23885-i2c.c

The results are not surprising: i2c_slave_did_ack() is only called for zero-length transactions. For all other transactions, no check is done. This is incorrect.

I have written 3 patches for cx23885-i2c.c, the second one should fix this particular issue. The other two are cleanups. Patches are there if you want to take a look / give them a try:
http://khali.linux-fr.org/devel/misc/cx23885/

These are totally untested, and I don't know anything about the hardware, so they might need some more work. But at least you should get the idea of what's missing.

Quoted 7 lines

Note the CX2388[578] chips have 3 I2C masters, 2 for external buses, and 1 internal "on silicon" bus which the driver sets up as the 3rd bus. The internal bus should at least have devices at 0x44 and 0x4c as confirmed above. I'll note the comment in this file, that indicates the "on silicon" I2C bus runs at 1.95 MHz:

http://linuxtv.org/hg/v4l-dvb/file/8bff7e6c44d4/linux/drivers/media/video/cx23885/cx23885-core.c

This is strange. For one thing, 1.95 MHz wouldn't be standard I2C but high-speed mode I2C. But more importantly, I fail to see how you could reach such speeds with a software-driven, byte-by-byte implementation. You need hardware buffers to reach high speeds on I2C.

Quoted 3 lines

The TeVii S470 card had what looked like at serial I2C EEPROM with the A0, A1, and A2 pins all grounded, so I assume it is at 0x50 on one of the CX23885's external I2C buses.

Probably. Hopefully my patches will show you where it is.

Signature · 1 line
Jean Delvare
#12 lore raw
Quoted 16 lines · Jean Delvare
Quoted 10 lines · Andy Walls
Quoted 4 lines · Jean Delvare

The fact that 0x30-0x37 and 0x50-0x5f all reply suggest that the bus driver erroneously returns success to "SMBus receive byte" transactions even when no device acks. This is a bug which should get fixed. If you point me to the I2C adapter driver code, I can take a look.

Although Igor's information makes the original need for this moot, here is the i2c adapter driver code:

http://linuxtv.org/hg/v4l-dvb/file/8bff7e6c44d4/linux/drivers/media/video/cx23885/cx23885-i2c.c

The results are not surprising: i2c_slave_did_ack() is only called for zero-length transactions. For all other transactions, no check is done. This is incorrect.

Quoted 8 lines

I have written 3 patches for cx23885-i2c.c, the second one should fix this particular issue. The other two are cleanups. Patches are there if you want to take a look / give them a try:
http://khali.linux-fr.org/devel/misc/cx23885/

These are totally untested, and I don't know anything about the hardware, so they might need some more work. But at least you should get the idea of what's missing.

Jean,

(adding Steven Toth to the Cc: list)

Thanks!

I will inspect and test these with my HVR-1850 (CX23888) loaner board this weekend (hopefully).

Regards,
Andy

#13 lore raw

Hi Andy,

Quoted 3 lines · Andy Walls

I will inspect and test these with my HVR-1850 (CX23888) loaner board this weekend (hopefully).

if you want me to test something on the Tevii S470 card, please let me know.

Bye,
Matthias

Signature · 1 line
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook
#14 lore raw
Quoted 8 lines · Matthias Fechner

Hi Andy,

Quoted 3 lines · Andy Walls

I will inspect and test these with my HVR-1850 (CX23888) loaner board this weekend (hopefully).

if you want me to test something on the Tevii S470 card, please let me know.

MAtthias,

Not right now. I'll let you know. If you wish, you can monitor

	http://linuxtv.org/hg/~awalls/cx23885-ir

Right now that repository has Jean's patches which I have minimally tested. They do fix the i2cdetect problems.

There are not TeVii S470 patches there, so I'm not sure how easy it will be for you to test.

In the v4l2_subdev_ir_parameters and cx23888-ir.c, I need to improve a minor point about carrier sense inversion (configuring if a carrier burst means mark or space) and IO pin level inversion. After that, I can port cx23888-ir.c to a cx25840-ir.c implementation.

I also have to implement NEC decoding in cx23885-input.c. I found a remote in my house that implements the NEC protocol with Extended addresses (although its timing is about 100 microseconds short for every mark & space pair and the header pulse is almost 1 ms shorter than it should be :P ). I should be able to get NEC decoding worked out with that remote and the HVR-1850 I have in hand.

Merging TeVii S470 fixes from Igor will then be a final step before I ask you to correct my guess at the v4l2_subdev_ir_parameters setup in cx23885-input.c for your card.

Regards,
Andy

Quoted 2 lines

Bye,
Matthias

#18 lore raw
In reply to Igor M. Liplianin
Quoted 21 lines · Igor M. Liplianin
Quoted 8 lines · On 21 ноября 2009 22:41:42 Andy Walls wrote:
Quoted 8 lines
Quoted 7 lines · Matthias Fechner

I bought some days ago a Tevii S470 DVB-S2 (PCI-E) card and got it running with the driver from:
http://mercurial.intuxication.org/hg/s2-liplianin

But I was not successfull in got the IR receiver working. It seems that it is not supported yet by the driver.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

Is there maybe some code available to get the IR receiver with evdev running?

If the card is using the built in IR controller in the CX23885, then you'll have to wait until I port my CX23888 IR controller changes to work with the IR controller in the CX23885. That should be somewhat straightforward, but will take time. Then we'll still need you to experiment with a patch.

It's cx23885 definitely.
Remote uses NEC codes.
In any case I can test.

Quoted 2 lines · Igor M. Liplianin

Receiver connected to cx23885 IR_RX(pin 106). It is not difficult to track.

Igor,

As I make patches for test, perhaps you can help answer some questions which will save some experimentation:

1. Does the remote for the TeVii S470 use the same codes as

linux/drivers/media/common/ir-keymaps.c : ir_codes_tevii_nec[]

or some other remote code table we have in the kernel?

2. Does the remote for the TeVii S470, like other TeVii remotes, use a standard NEC address of 0x00 (so that Addr'Addr is 0xff00) ? Or does it use another address?

3. When you traced board wiring from the IR receiver to the IR_RX pin on the CX23885, did you notice any external components that might modify the signal? For example, a capacitor that integrates carrier bursts into baseband pulses.

Thanks.

Regards,
Andy

#19 lore raw

Hi Andy,

Quoted 7 lines · Andy Walls

1. Does the remote for the TeVii S470 use the same codes as

linux/drivers/media/common/ir-keymaps.c : ir_codes_tevii_nec[]

or some other remote code table we have in the kernel?

I don't know how it should work with the kernel but I use the remote together with lirc with the attached config files. Maybe that helps you a little bit.

Bye,
Matthias

Signature · 1 line
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook

#

# this config file was automatically generated
# using lirc-0.8.4(default) on Sun Jul 12 12:05:06 2009
#
# contributed by
#
# brand:                      TeVii
# model no. of remote control:
# devices being controlled by this remote: TeVii S650 DVB-S2 USB
#

begin remote

name TeVii_S470

  bits           16
  flags SPACE_ENC|CONST_LENGTH
  eps            30

aeps 100

header 9032 4440

  one           594  1651
  zero          594   527
  ptrail        592

repeat 9032 2212
pre_data_bits 16
pre_data 0xFF
gap 107715
toggle_bit_mask 0x8000

     begin codes
          Power                    0x50AF
          Mute                     0x30CF
          1                        0x8877
          2                        0x48B7
          3                        0xC837
          4                        0x28D7
          5                        0xA857
          6                        0x6897
          7                        0xE817
          8                        0x18E7
          9                        0x9867
          0                        0x08F7
          recall                   0x58A7
          fav                      0xD827
          Vol+                     0x906F
          Vol-                     0xF00F
          Chan+                    0x10EF
          Chan-                    0x609F
          ModeLive                 0xA05F
          ModePlay                 0xE01F
          Up                       0x00FF
          Down                     0x807F
          Left                     0xC03F
          Right                    0x40BF
          Ok                       0xF807
          Menu                     0x38C7
          Back                     0xB847
          Play                     0x02FD
          FastRew                  0x7887
          FastFwd                  0xB24D
          EPG                      0x22DD
          Rec                      0x20DF
          Timer                    0xD02F
          Open                     0x708F
          Info                     0x32CD
          a/b                       0x827D
          Audio                    0xC23D
          subs                     0xA25D
          List                     0x52AD
          F1                       0x629D
          F2                       0xE21D
          F3                       0x7A85
          F4                       0x3AC5
          F5                       0x4AB5
          F6                       0x5AA5
          mom                      0x6A95
          fs                       0x1AE5
      end codes

end remote

#20 lore raw
In reply to Andy Walls
Quoted 23 lines · On 6 декабря 2009 23:40:54 Andy Walls wrote:
Quoted 18 lines · Igor M. Liplianin
Quoted 8 lines · On 21 ноября 2009 22:41:42 Andy Walls wrote:
Quoted 8 lines
Quoted 7 lines · Matthias Fechner

I bought some days ago a Tevii S470 DVB-S2 (PCI-E) card and got it running with the driver from:
http://mercurial.intuxication.org/hg/s2-liplianin

But I was not successfull in got the IR receiver working. It seems that it is not supported yet by the driver.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

Is there maybe some code available to get the IR receiver with evdev running?

If the card is using the built in IR controller in the CX23885, then you'll have to wait until I port my CX23888 IR controller changes to work with the IR controller in the CX23885. That should be somewhat straightforward, but will take time. Then we'll still need you to experiment with a patch.

Quoted 3 lines

It's cx23885 definitely.
Remote uses NEC codes.
In any case I can test.

Quoted 5 lines
Quoted 2 lines · Igor M. Liplianin

Receiver connected to cx23885 IR_RX(pin 106). It is not difficult to track.

Igor,

Hi Andy,

Quoted 8 lines

As I make patches for test, perhaps you can help answer some questions which will save some experimentation:

1. Does the remote for the TeVii S470 use the same codes as

linux/drivers/media/common/ir-keymaps.c : ir_codes_tevii_nec[]

That is correct table for cx88 based TeVii card with the same remote. I believe there is no difference for cx23885.

Quoted 7 lines

or some other remote code table we have in the kernel?

2. Does the remote for the TeVii S470, like other TeVii remotes, use a standard NEC address of 0x00 (so that Addr'Addr is 0xff00) ? Or does it use another address?

Again like in cx88, the address is standard.

Quoted 6 lines

3. When you traced board wiring from the IR receiver to the IR_RX pin on the CX23885, did you notice any external components that might modify the signal? For example, a capacitor that integrates carrier bursts into baseband pulses.

Yet again I believe there is no capacitors.
Very same scheme like in cx88 variants for TeVii and others.

Quoted 6 lines

Thanks.

Regards,
Andy

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#21 lore raw
Quoted 53 lines · Igor M. Liplianin
Quoted 23 lines · On 6 декабря 2009 23:40:54 Andy Walls wrote:
Quoted 18 lines · Igor M. Liplianin
Quoted 8 lines · On 21 ноября 2009 22:41:42 Andy Walls wrote:
Quoted 8 lines
Quoted 7 lines · Matthias Fechner

I bought some days ago a Tevii S470 DVB-S2 (PCI-E) card and got it running with the driver from:
http://mercurial.intuxication.org/hg/s2-liplianin

But I was not successfull in got the IR receiver working. It seems that it is not supported yet by the driver.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

Is there maybe some code available to get the IR receiver with evdev running?

If the card is using the built in IR controller in the CX23885, then you'll have to wait until I port my CX23888 IR controller changes to work with the IR controller in the CX23885. That should be somewhat straightforward, but will take time. Then we'll still need you to experiment with a patch.

Quoted 3 lines

It's cx23885 definitely.
Remote uses NEC codes.
In any case I can test.

Quoted 5 lines
Quoted 2 lines · Igor M. Liplianin

Receiver connected to cx23885 IR_RX(pin 106). It is not difficult to track.

Igor,

Hi Andy,

Quoted 8 lines

As I make patches for test, perhaps you can help answer some questions which will save some experimentation:

1. Does the remote for the TeVii S470 use the same codes as

linux/drivers/media/common/ir-keymaps.c : ir_codes_tevii_nec[]

That is correct table for cx88 based TeVii card with the same remote. I believe there is no difference for cx23885.

Quoted 7 lines

or some other remote code table we have in the kernel?

2. Does the remote for the TeVii S470, like other TeVii remotes, use a standard NEC address of 0x00 (so that Addr'Addr is 0xff00) ? Or does it use another address?

Again like in cx88, the address is standard.

Quoted 2 lines
Quoted 6 lines
Quoted 4 lines

3. When you traced board wiring from the IR receiver to the IR_RX pin on the CX23885, did you notice any external components that might modify the signal? For example, a capacitor that integrates carrier bursts into baseband pulses.

Yet again I believe there is no capacitors.
Very same scheme like in cx88 variants for TeVii and others.

Igor and Matthias,

Please try the changes that I have for the TeVii S470 that are here:

	http://linuxtv.org/hg/~awalls/cx23885-ir

You will want to modprobe the driver modules like this to get debugging information:

	# modprobe cx25840 ir_debug=2
	# modprobe cx23885 ir_input_debug=1

With that debugging you will get output something like this in dmesg or your logs when you press a button on the remote (this is RC-5 using a CX23888 chip not NEC using a CX23885 chip):

cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rto
cx23885[0]/888-ir: IRQ Enables: rse rte roe

cx23885[0]/888-ir: rx read:     817000 ns  mark
cx23885[0]/888-ir: rx read:     838926 ns  space
cx23885[0]/888-ir: rx read:    1572259 ns  mark
cx23885[0]/888-ir: rx read:    1705296 ns  space
[...]
cx23885[0]/888-ir: rx read:     838037 ns  space
cx23885[0]/888-ir: rx read:     746333 ns  mark
cx23885[0]/888-ir: rx read:    1705741 ns  space
cx23885[0]/888-ir: rx read:    1619370 ns  mark

cx23885[0]/888-ir: rx read: end of rx

NEC would actually have this sort of timing:

8257296 ns  mark
4206185 ns  space
 482926 ns  mark
 545296 ns  space
 481296 ns  mark
1572259 ns  space
 481148 ns  mark
 546333 ns  space
[...]
 433593 ns  mark
1618333 ns  space
 454481 ns  mark

end of rx

8255519 ns  mark
2130926 ns  space
 480556 ns  mark

end of rx

The NEC decoder will also log the decoded 32 bits it receives and separate out the address and the command bits.

If you do not see good or many NEC timing measurments in the logs, the first thing to try is to change lines 533-534 of linux/drivers/media/cx23885/cx23885-input.c:

               params.modulation = true;
               params.invert_level = false;

If you see no timing measurements or few timing measurements, change the "modulation" to "false". If the chip is expecting carrier pulses and an external circuit or capacitor is smoothing carrier bursts into baseband pulses, then the hardware won't make measurements properly.

If you see inverted mark and space inverted when "modulation" is set to "false", then set "invert_level" to "true".

Those are the two things I had to really guess at.

BTW, I'm not accessing the CX23885 AV Core registers across the I2C bus in a very conservative way. If you notice some performance problem with an occasionally missed pulse measurement, then I know there is room for improvement by being smarter about I2C bus transactions.

Good Luck.

Regards,
Andy

#22 lore raw
Quoted 149 lines · On 7 декабря 2009 05:35:46 Andy Walls wrote:
Quoted 52 lines · Igor M. Liplianin
Quoted 23 lines · On 6 декабря 2009 23:40:54 Andy Walls wrote:
Quoted 18 lines · Igor M. Liplianin
Quoted 8 lines · On 21 ноября 2009 22:41:42 Andy Walls wrote:
Quoted 8 lines
Quoted 7 lines · Matthias Fechner

I bought some days ago a Tevii S470 DVB-S2 (PCI-E) card and got it running with the driver from:
http://mercurial.intuxication.org/hg/s2-liplianin

But I was not successfull in got the IR receiver working. It seems that it is not supported yet by the driver.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

Is there maybe some code available to get the IR receiver with evdev running?

If the card is using the built in IR controller in the CX23885, then you'll have to wait until I port my CX23888 IR controller changes to work with the IR controller in the CX23885. That should be somewhat straightforward, but will take time. Then we'll still need you to experiment with a patch.

Quoted 3 lines

It's cx23885 definitely.
Remote uses NEC codes.
In any case I can test.

Quoted 5 lines
Quoted 2 lines · Igor M. Liplianin

Receiver connected to cx23885 IR_RX(pin 106). It is not difficult to track.

Igor,

Hi Andy,

Quoted 7 lines

As I make patches for test, perhaps you can help answer some questions which will save some experimentation:

1. Does the remote for the TeVii S470 use the same codes as

linux/drivers/media/common/ir-keymaps.c : ir_codes_tevii_nec[]

That is correct table for cx88 based TeVii card with the same remote. I believe there is no difference for cx23885.

Quoted 6 lines

or some other remote code table we have in the kernel?

2. Does the remote for the TeVii S470, like other TeVii remotes, use a standard NEC address of 0x00 (so that Addr'Addr is 0xff00) ? Or does it use another address?

Again like in cx88, the address is standard.

Quoted 7 lines
Quoted 4 lines

3. When you traced board wiring from the IR receiver to the IR_RX pin on the CX23885, did you notice any external components that might modify the signal? For example, a capacitor that integrates carrier bursts into baseband pulses.

Yet again I believe there is no capacitors.
Very same scheme like in cx88 variants for TeVii and others.

Igor and Matthias,

Please try the changes that I have for the TeVii S470 that are here:

	http://linuxtv.org/hg/~awalls/cx23885-ir

You will want to modprobe the driver modules like this to get debugging information:

	# modprobe cx25840 ir_debug=2
	# modprobe cx23885 ir_input_debug=1

With that debugging you will get output something like this in dmesg or your logs when you press a button on the remote (this is RC-5 using a CX23888 chip not NEC using a CX23885 chip):

cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rto
cx23885[0]/888-ir: IRQ Enables: rse rte roe

cx23885[0]/888-ir: rx read:     817000 ns  mark
cx23885[0]/888-ir: rx read:     838926 ns  space
cx23885[0]/888-ir: rx read:    1572259 ns  mark
cx23885[0]/888-ir: rx read:    1705296 ns  space
[...]
cx23885[0]/888-ir: rx read:     838037 ns  space
cx23885[0]/888-ir: rx read:     746333 ns  mark
cx23885[0]/888-ir: rx read:    1705741 ns  space
cx23885[0]/888-ir: rx read:    1619370 ns  mark

cx23885[0]/888-ir: rx read: end of rx

NEC would actually have this sort of timing:

8257296 ns  mark
4206185 ns  space
 482926 ns  mark
 545296 ns  space
 481296 ns  mark
1572259 ns  space
 481148 ns  mark
 546333 ns  space
[...]
 433593 ns  mark
1618333 ns  space
 454481 ns  mark

end of rx

8255519 ns  mark
2130926 ns  space
 480556 ns  mark

end of rx

The NEC decoder will also log the decoded 32 bits it receives and separate out the address and the command bits.

If you do not see good or many NEC timing measurments in the logs, the first thing to try is to change lines 533-534 of linux/drivers/media/cx23885/cx23885-input.c:

               params.modulation = true;
               params.invert_level = false;

If you see no timing measurements or few timing measurements, change the "modulation" to "false". If the chip is expecting carrier pulses and an external circuit or capacitor is smoothing carrier bursts into baseband pulses, then the hardware won't make measurements properly.

If you see inverted mark and space inverted when "modulation" is set to "false", then set "invert_level" to "true".

Those are the two things I had to really guess at.

BTW, I'm not accessing the CX23885 AV Core registers across the I2C bus in a very conservative way. If you notice some performance problem with an occasionally missed pulse measurement, then I know there is room for improvement by being smarter about I2C bus transactions.

Quoted 4 lines

Good Luck.

Regards,
Andy

No luck :(
Nothing in logs

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#23 lore raw
Quoted 56 lines · Igor M. Liplianin
Quoted 54 lines · On 7 декабря 2009 05:35:46 Andy Walls wrote:

Igor and Matthias,

Please try the changes that I have for the TeVii S470 that are here:

	http://linuxtv.org/hg/~awalls/cx23885-ir

You will want to modprobe the driver modules like this to get debugging information:

	# modprobe cx25840 ir_debug=2
	# modprobe cx23885 ir_input_debug=1

With that debugging you will get output something like this in dmesg or your logs when you press a button on the remote (this is RC-5 using a CX23888 chip not NEC using a CX23885 chip):

cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rto
cx23885[0]/888-ir: IRQ Enables: rse rte roe

cx23885[0]/888-ir: rx read:     817000 ns  mark
cx23885[0]/888-ir: rx read:     838926 ns  space
cx23885[0]/888-ir: rx read:    1572259 ns  mark
cx23885[0]/888-ir: rx read:    1705296 ns  space
[...]
cx23885[0]/888-ir: rx read:     838037 ns  space
cx23885[0]/888-ir: rx read:     746333 ns  mark
cx23885[0]/888-ir: rx read:    1705741 ns  space
cx23885[0]/888-ir: rx read:    1619370 ns  mark

cx23885[0]/888-ir: rx read: end of rx

If you do not see good or many NEC timing measurments in the logs, the first thing to try is to change lines 533-534 of linux/drivers/media/cx23885/cx23885-input.c:

               params.modulation = true;
               params.invert_level = false;

If you see no timing measurements or few timing measurements, change the "modulation" to "false". If the chip is expecting carrier pulses and an external circuit or capacitor is smoothing carrier bursts into baseband pulses, then the hardware won't make measurements properly.

If you see inverted mark and space inverted when "modulation" is set to "false", then set "invert_level" to "true".

Quoted 7 lines
Quoted 4 lines

Those are the two things I had to really guess at.

Regards,
Andy

No luck :(
Nothing in logs

:(

OK.

1. I assume you have the v4l-cx23885-avcore-01.fw file available for the cx25840 module, just so there is no problem initializing the CX23885 AV core.

2. Does dmesg or the logs show the input device being created? Somewhere in the log you should see:

	"cx23885 IR (TeVii S470)"

when the input device is created.

3. With the "debug=7" option to the cx23885 module, do you see any IR interrupts coming in? In dmesg or the log you should see:

	"(PCI_MSK_IR        0x...)"

when an IR interrupt happens.

Tonight I will:

a. Add a guess at HVR-1800 support so maybe Steve can help us debug as well. I know the NEC decoder works; I tested it. What I don't know is if the CX23885 AV IR implementation works (I don't have CX23885 hardware at the moment).

b. Add a temporary patch to add a /dev/videoN node for the TeVii S470 so you can use "v4l2-ctl --log-status" to show the status of the IR controller and v4l2-dbg to dump the cx23885 and cx23885-av-core registers, so I can see if everthying is set right.

c. Review the register settings to make sure interrupts should be enabled for the IR controller.

Regards,
Andy

#24 lore raw
Quoted 81 lines · On 9 декабря 2009 13:47:46 Andy Walls wrote:
Quoted 55 lines · Igor M. Liplianin
Quoted 54 lines · On 7 декабря 2009 05:35:46 Andy Walls wrote:

Igor and Matthias,

Please try the changes that I have for the TeVii S470 that are here:

	http://linuxtv.org/hg/~awalls/cx23885-ir

You will want to modprobe the driver modules like this to get debugging information:

	# modprobe cx25840 ir_debug=2
	# modprobe cx23885 ir_input_debug=1

With that debugging you will get output something like this in dmesg or your logs when you press a button on the remote (this is RC-5 using a CX23888 chip not NEC using a CX23885 chip):

cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rsr rby
cx23885[0]/888-ir: IRQ Enables: rse rte roe
cx23885[0]/888-ir: IRQ Status: tsr rto
cx23885[0]/888-ir: IRQ Enables: rse rte roe

cx23885[0]/888-ir: rx read:     817000 ns  mark
cx23885[0]/888-ir: rx read:     838926 ns  space
cx23885[0]/888-ir: rx read:    1572259 ns  mark
cx23885[0]/888-ir: rx read:    1705296 ns  space
[...]
cx23885[0]/888-ir: rx read:     838037 ns  space
cx23885[0]/888-ir: rx read:     746333 ns  mark
cx23885[0]/888-ir: rx read:    1705741 ns  space
cx23885[0]/888-ir: rx read:    1619370 ns  mark

cx23885[0]/888-ir: rx read: end of rx

If you do not see good or many NEC timing measurments in the logs, the first thing to try is to change lines 533-534 of linux/drivers/media/cx23885/cx23885-input.c:

               params.modulation = true;
               params.invert_level = false;

If you see no timing measurements or few timing measurements, change the "modulation" to "false". If the chip is expecting carrier pulses and an external circuit or capacitor is smoothing carrier bursts into baseband pulses, then the hardware won't make measurements properly.

If you see inverted mark and space inverted when "modulation" is set to "false", then set "invert_level" to "true".

Quoted 8 lines
Quoted 4 lines

Those are the two things I had to really guess at.

Regards,
Andy

No luck :(
Nothing in logs

:(

OK.

1. I assume you have the v4l-cx23885-avcore-01.fw file available for the cx25840 module, just so there is no problem initializing the CX23885 AV core.

2. Does dmesg or the logs show the input device being created? Somewhere in the log you should see:

	"cx23885 IR (TeVii S470)"

when the input device is created.

Quoted 6 lines

3. With the "debug=7" option to the cx23885 module, do you see any IR interrupts coming in? In dmesg or the log you should see:

	"(PCI_MSK_IR        0x...)"

when an IR interrupt happens.

cx25840 3-0044: cx23885 A/V decoder found @ 0x88 (cx23885[0])
cx25840 3-0044: firmware: requesting v4l-cx23885-avcore-01.fw
cx25840 3-0044: loaded v4l-cx23885-avcore-01.fw firmware (16382 bytes) cx23885_dvb_register() allocating 1 frontend(s)
cx23885[0]: cx23885 based dvb card
DS3000 chip version: 0.192 attached.
DVB: registering new adapter (cx23885[0])
dvb_register_frontend
DVB: registering adapter 0 frontend 0 (Montage Technology DS3000/TS2020)... cx23885_dev_checkrevision() Hardware revision = 0xb0
cx23885[0]/0: found at 0000:02:00.0, rev: 2, irq: 16, latency: 0, mmio: 0xfea00000 cx23885 0000:02:00.0: setting latency timer to 64
IRQ 16/cx23885[0]: IRQF_DISABLED is not guaranteed on shared IRQs
input: cx23885 IR (TeVii S470) as /class/input/input5

That's all.

In fact some time ago I was writing some code for cx23885 IR, but not reached IR interrupts to work. Though I used PCI_MSK_AV_CORE (1 << 27), then test register PIN_CTRL for field FLD_IR_IRQ_STAT.

I have Compro E650F with RC6 remote, also have RC5 remote from TV set. I will made little hack to test Compro & RC5.

Quoted 19 lines

Tonight I will:

a. Add a guess at HVR-1800 support so maybe Steve can help us debug as well. I know the NEC decoder works; I tested it. What I don't know is if the CX23885 AV IR implementation works (I don't have CX23885 hardware at the moment).

b. Add a temporary patch to add a /dev/videoN node for the TeVii S470 so you can use "v4l2-ctl --log-status" to show the status of the IR controller and v4l2-dbg to dump the cx23885 and cx23885-av-core registers, so I can see if everthying is set right.

c. Review the register settings to make sure interrupts should be enabled for the IR controller.

Regards,
Andy

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#25 lore raw
Quoted 11 lines · Igor M. Liplianin
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Igor and Matthias,

Please try the changes that I have for the TeVii S470 that are here:

	http://linuxtv.org/hg/~awalls/cx23885-ir

In fact some time ago I was writing some code for cx23885 IR, but not reached IR interrupts to work. Though I used PCI_MSK_AV_CORE (1 << 27), then test register PIN_CTRL for field FLD_IR_IRQ_STAT.

Igor,

You are exactly right on this. I used the wrong interrupt status flag. I have pushed a patch to my repository to use the PCI_MSK_AV_CORE status flag.

Could you please update an test the TeVii S470 again when you have time?

Quoted 2 lines

I have Compro E650F with RC6 remote, also have RC5 remote from TV set. I will made little hack to test Compro & RC5.

OK. Thank you.

Regards,
Andy

#26 lore raw
Quoted 20 lines · On 10 декабря 2009 03:12:39 Andy Walls wrote:
Quoted 10 lines · Igor M. Liplianin
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Igor and Matthias,

Please try the changes that I have for the TeVii S470 that are here:

	http://linuxtv.org/hg/~awalls/cx23885-ir

In fact some time ago I was writing some code for cx23885 IR, but not reached IR interrupts to work. Though I used PCI_MSK_AV_CORE (1 << 27), then test register PIN_CTRL for field FLD_IR_IRQ_STAT.

Igor,

You are exactly right on this. I used the wrong interrupt status flag. I have pushed a patch to my repository to use the PCI_MSK_AV_CORE status flag.

Could you please update an test the TeVii S470 again when you have time?

Quoted 7 lines
Quoted 2 lines

I have Compro E650F with RC6 remote, also have RC5 remote from TV set. I will made little hack to test Compro & RC5.

OK. Thank you.

Regards,
Andy

First try, without pressing IR keys

cx25840 3-0044: IRQ Enables: rse rte roe
cx25840 3-0044: IRQ Status: tsr
cx25840 3-0044: IRQ Enables: rse rte roe
irq 16: nobody cared (try booting with the "irqpoll" option)
Pid: 0, comm: swapper Not tainted 2.6.32 #2

Call Trace:
 [<c1052db0>] ? __report_bad_irq+0x24/0x69
 [<c1052db7>] ? __report_bad_irq+0x2b/0x69
 [<c1052edc>] ? note_interrupt+0xe7/0x13f
 [<c1053416>] ? handle_fasteoi_irq+0x7a/0x97
 [<c1004411>] ? handle_irq+0x38/0x3f
 [<c1003bd1>] ? do_IRQ+0x38/0x89
 [<c1002ea9>] ? common_interrupt+0x29/0x30
 [<c1007a1e>] ? mwait_idle+0x7a/0x7f
 [<c1001b93>] ? cpu_idle+0x37/0x4c

handlers:
[<c13179ad>] (usb_hcd_irq+0x0/0x59) [<f85ba5e7>] (azx_interrupt+0x0/0xe7 [snd_hda_intel]) [<f88b1d2b>] (cx23885_irq+0x0/0x4a5 [cx23885]) Disabling IRQ #16
cx25840 3-0044: IRQ Status: tsr
cx25840 3-0044: IRQ Enables: rse rte roe
cx25840 3-0044: IRQ Status: tsr

Sorry for not speaking to much :)

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#27 lore raw
Quoted 45 lines · Igor M. Liplianin
Quoted 20 lines · On 10 декабря 2009 03:12:39 Andy Walls wrote:
Quoted 10 lines · Igor M. Liplianin
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Igor and Matthias,

Please try the changes that I have for the TeVii S470 that are here:

	http://linuxtv.org/hg/~awalls/cx23885-ir

In fact some time ago I was writing some code for cx23885 IR, but not reached IR interrupts to work. Though I used PCI_MSK_AV_CORE (1 << 27), then test register PIN_CTRL for field FLD_IR_IRQ_STAT.

Igor,

You are exactly right on this. I used the wrong interrupt status flag. I have pushed a patch to my repository to use the PCI_MSK_AV_CORE status flag.

Could you please update an test the TeVii S470 again when you have time?

Quoted 7 lines
Quoted 2 lines

I have Compro E650F with RC6 remote, also have RC5 remote from TV set. I will made little hack to test Compro & RC5.

OK. Thank you.

Regards,
Andy

First try, without pressing IR keys

cx25840 3-0044: IRQ Enables: rse rte roe
cx25840 3-0044: IRQ Status: tsr
cx25840 3-0044: IRQ Enables: rse rte roe
irq 16: nobody cared (try booting with the "irqpoll" option)
Pid: 0, comm: swapper Not tainted 2.6.32 #2

Call Trace:
 [<c1052db0>] ? __report_bad_irq+0x24/0x69
 [<c1052db7>] ? __report_bad_irq+0x2b/0x69
 [<c1052edc>] ? note_interrupt+0xe7/0x13f
 [<c1053416>] ? handle_fasteoi_irq+0x7a/0x97
 [<c1004411>] ? handle_irq+0x38/0x3f
 [<c1003bd1>] ? do_IRQ+0x38/0x89
 [<c1002ea9>] ? common_interrupt+0x29/0x30
 [<c1007a1e>] ? mwait_idle+0x7a/0x7f
 [<c1001b93>] ? cpu_idle+0x37/0x4c
Quoted 8 lines

handlers:
[<c13179ad>] (usb_hcd_irq+0x0/0x59) [<f85ba5e7>] (azx_interrupt+0x0/0xe7 [snd_hda_intel]) [<f88b1d2b>] (cx23885_irq+0x0/0x4a5 [cx23885]) Disabling IRQ #16
cx25840 3-0044: IRQ Status: tsr
cx25840 3-0044: IRQ Enables: rse rte roe
cx25840 3-0044: IRQ Status: tsr

OK. We're getting interrupts from the A/V core, but they are not IR related. They must be audio and video interrupts from the A/V core.

I have checked in new changes:

	http://linuxtv.org/hg/~awalls/cx23885-ir

please try again when you have time.

	# modprobe cx25840 debug=2 ir_debug=2
	# modprobe cx23885 debug=7

My only concern now, is that I have not turned off all the audio interrupts from the A/V core - I could not determine if registers 0x80c-0x80f were improtant to set.

Regards,
Andy