Re: cx231xx IR remote control protocol

2017-10-28 Thread Oleh Kravchenko
Hi Devin and Sean!

It was very easy, suddenly IR is fully supported by mceusb!
Required only correct USB ID.

Thank you!

On 23.10.17 16:12, Devin Heitmueller wrote:
> Hi Oleh,
> 
> On Mon, Oct 23, 2017 at 5:37 AM, Sean Young  wrote:
>> Hi Oleh,
>>
>> On Sun, Oct 22, 2017 at 05:01:05PM +0300, Oleh Kravchenko wrote:
>>> Hi,
>>>
>>> I'm trying add support remote control for tuners:
>>> - EvroMedia Full Hybrid Full HD
>>> - Astrometa T2hybrid
>>>
>>> But I'm stuck. Can anybody recognize this protocol?
>>
> 
> Is there anything to indicate that there actually a separate IR
> receiver on the board?  Most cx231xx devices have an MCEUSB compliant
> IR RX/TX built into the chip, and thus they don't use a separate part.
> 
> Also, IIRC, address 0x30 is the I2C address of the onboard analog
> frontend for the cx23102, and I suspect you're just reading the values
> out of the AFE.  I suspect you've grabbed a dump from the initial
> device plug-in, which would coincide with the initial register
> programming of the AFE.
> 
> I suspect if you connect the device, let it device settle, *then*
> start the I2C capture and hit a key on the remote, you'll see traffic
> on a totally different endpoint which would be the IR traffic being
> sent back over the IR interface/endpoint.
> 
> Devin
> 

-- 
Best regards,
Oleh Kravchenko


Re: cx231xx IR remote control protocol

2017-10-23 Thread Devin Heitmueller
Hi Oleh,

On Mon, Oct 23, 2017 at 5:37 AM, Sean Young  wrote:
> Hi Oleh,
>
> On Sun, Oct 22, 2017 at 05:01:05PM +0300, Oleh Kravchenko wrote:
>> Hi,
>>
>> I'm trying add support remote control for tuners:
>> - EvroMedia Full Hybrid Full HD
>> - Astrometa T2hybrid
>>
>> But I'm stuck. Can anybody recognize this protocol?
>

Is there anything to indicate that there actually a separate IR
receiver on the board?  Most cx231xx devices have an MCEUSB compliant
IR RX/TX built into the chip, and thus they don't use a separate part.

Also, IIRC, address 0x30 is the I2C address of the onboard analog
frontend for the cx23102, and I suspect you're just reading the values
out of the AFE.  I suspect you've grabbed a dump from the initial
device plug-in, which would coincide with the initial register
programming of the AFE.

I suspect if you connect the device, let it device settle, *then*
start the I2C capture and hit a key on the remote, you'll see traffic
on a totally different endpoint which would be the IR traffic being
sent back over the IR interface/endpoint.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com


Re: cx231xx IR remote control protocol

2017-10-23 Thread Sean Young
Hi Oleh,

On Sun, Oct 22, 2017 at 05:01:05PM +0300, Oleh Kravchenko wrote:
> Hi,
> 
> I'm trying add support remote control for tuners:
> - EvroMedia Full Hybrid Full HD
> - Astrometa T2hybrid
> 
> But I'm stuck. Can anybody recognize this protocol?

I would first figure out what scancodes the remote is sending. Using
a raw IR receiver, e.g. mceusb device, execute:

ir-keytable -s rcN -p all -t

Now you can get the scancodes the remote sends. Next, try to find
the same scancodes in the i2c dump.

It's also possible that the i2c device reports raw IR pulse/space
timings. If this is the case, it might be easiest to use an IR
transmitter and then use a tool like ir-ctl to send a single pulse
and see how that is reported, and build from there.

Then again,  I have no idea about these devices, maybe someone else
recognises this data and might be able to help you more.

Thanks
Sean

> $ i2cdump -y 5 0x30 b
>  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f0123456789abcdef
> 00: 42 3c 2d 0f 3f 4f 67 13 18 00 72 02 55 05 55 00B<-??Og??.r?U?U.
> 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 20: 04 02 10 00 46 05 03 07 10 f0 02 00 00 00 00 00???.F??.
> 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 40: 04 02 10 00 46 05 03 07 00 f0 02 00 00 00 00 00???.F???.??.
> 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 60: 05 02 10 40 46 05 03 07 00 f0 02 00 00 00 00 00???@F???.??.
> 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 
> $ i2cdump -y 18 0x30 b
>  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f0123456789abcdef
> 00: 42 3c 2c 0f 3f 4f 67 13 18 00 72 02 55 05 55 00B<,??Og??.r?U?U.
> 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 20: 04 02 10 00 46 05 03 07 00 f0 02 00 00 00 00 00???.F???.??.
> 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 40: 04 02 10 00 46 05 03 07 00 f0 02 00 00 00 00 00???.F???.??.
> 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 60: 04 02 10 00 46 05 03 07 00 f0 02 00 00 00 00 00???.F???.??.
> 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 
> Here dump of i2c transactions of Windows driver converted to i2c-tools:
> i2cset -y 5 0x30 0x0001 0x10 b
> i2cset -y 5 0x30 0x 0x42 b
> i2cset -y 5 0x30 0x0005 0x0f b
> i2cset -y 5 0x30 0x0008 0x18 b
> i2cget -y 5 0x30 0x0008 b # should be 0x18
> i2cset -y 5 0x30 0x0002 0x40 b
> i2cset -y 5 0x30 0x0002 0x00 b
> i2cset -y 5 0x30 0x000a 0x52 b
> i2cset -y 5 0x30 0x0023 0x00 b
> i2cset -y 5 0x30 0x0043 0x00 b
> i2cset -y 5 0x30 0x0063 0x00 b
> i2cset -y 5 0x30 0x000b 0x02 b
> i2cset -y 5 0x30 0x0027 0x17 b
> i2cset -y 5 0x30 0x0047 0x17 b
> i2cset -y 5 0x30 0x0067 0x17 b
> i2cset -y 5 0x30 0x0022 0x10 b
> i2cset -y 5 0x30 0x0042 0x10 b
> i2cset -y 5 0x30 0x0062 0x10 b
> i2cset -y 5 0x30 0x0027 0x07 b
> i2cset -y 5 0x30 0x0047 0x07 b
> i2cset -y 5 0x30 0x0067 0x07 b
> i2cset -y 5 0x30 0x0029 0xf0 b
> i2cset -y 5 0x30 0x0049 0xf0 b
> i2cset -y 5 0x30 0x0069 0xf0 b
> i2cget -y 5 0x30 0x002a b # should be 0xfa
> i2cset -y 5 0x30 0x002a 0x02 b
> i2cget -y 5 0x30 0x004a b # should be 0xfa
> i2cset -y 5 0x30 0x004a 0x02 b
> i2cget -y 5 0x30 0x006a b # should be 0xfa
> i2cset -y 5 0x30 0x006a 0x02 b
> i2cset -y 5 0x30 0x0026 0x03 b
> i2cset -y 5 0x30 0x0046 0x03 b
> i2cset -y 5 0x30 0x0066 0x03 b
> i2cget -y 5 0x30 0x0028 b # should be 0x00
> i2cget -y 5 0x30 0x0029 b # should be 0xf0
> i2cset -y 5 0x30 0x0001 0x10 b
> i2cset -y 5 0x30 0x 0x42 b
> i2cset -y 5 0x30 0x0005 0x0f b
> i2cset -y 5 0x30 0x0008 0x18 b
> i2cget -y 5 0x30 0x0008 b # should be 0x18
> i2cset -y 5 0x30 0x0002 0x40 b
> i2cset -y 5 0x30 

cx231xx IR remote control protocol

2017-10-22 Thread Oleh Kravchenko
Hi,

I'm trying add support remote control for tuners:
- EvroMedia Full Hybrid Full HD
- Astrometa T2hybrid

But I'm stuck. Can anybody recognize this protocol?

$ i2cdump -y 5 0x30 b
 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f0123456789abcdef
00: 42 3c 2d 0f 3f 4f 67 13 18 00 72 02 55 05 55 00B<-??Og??.r?U?U.
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 04 02 10 00 46 05 03 07 10 f0 02 00 00 00 00 00???.F??.
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40: 04 02 10 00 46 05 03 07 00 f0 02 00 00 00 00 00???.F???.??.
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 05 02 10 40 46 05 03 07 00 f0 02 00 00 00 00 00???@F???.??.
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

$ i2cdump -y 18 0x30 b
 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f0123456789abcdef
00: 42 3c 2c 0f 3f 4f 67 13 18 00 72 02 55 05 55 00B<,??Og??.r?U?U.
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 04 02 10 00 46 05 03 07 00 f0 02 00 00 00 00 00???.F???.??.
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40: 04 02 10 00 46 05 03 07 00 f0 02 00 00 00 00 00???.F???.??.
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 04 02 10 00 46 05 03 07 00 f0 02 00 00 00 00 00???.F???.??.
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Here dump of i2c transactions of Windows driver converted to i2c-tools:
i2cset -y 5 0x30 0x0001 0x10 b
i2cset -y 5 0x30 0x 0x42 b
i2cset -y 5 0x30 0x0005 0x0f b
i2cset -y 5 0x30 0x0008 0x18 b
i2cget -y 5 0x30 0x0008 b # should be 0x18
i2cset -y 5 0x30 0x0002 0x40 b
i2cset -y 5 0x30 0x0002 0x00 b
i2cset -y 5 0x30 0x000a 0x52 b
i2cset -y 5 0x30 0x0023 0x00 b
i2cset -y 5 0x30 0x0043 0x00 b
i2cset -y 5 0x30 0x0063 0x00 b
i2cset -y 5 0x30 0x000b 0x02 b
i2cset -y 5 0x30 0x0027 0x17 b
i2cset -y 5 0x30 0x0047 0x17 b
i2cset -y 5 0x30 0x0067 0x17 b
i2cset -y 5 0x30 0x0022 0x10 b
i2cset -y 5 0x30 0x0042 0x10 b
i2cset -y 5 0x30 0x0062 0x10 b
i2cset -y 5 0x30 0x0027 0x07 b
i2cset -y 5 0x30 0x0047 0x07 b
i2cset -y 5 0x30 0x0067 0x07 b
i2cset -y 5 0x30 0x0029 0xf0 b
i2cset -y 5 0x30 0x0049 0xf0 b
i2cset -y 5 0x30 0x0069 0xf0 b
i2cget -y 5 0x30 0x002a b # should be 0xfa
i2cset -y 5 0x30 0x002a 0x02 b
i2cget -y 5 0x30 0x004a b # should be 0xfa
i2cset -y 5 0x30 0x004a 0x02 b
i2cget -y 5 0x30 0x006a b # should be 0xfa
i2cset -y 5 0x30 0x006a 0x02 b
i2cset -y 5 0x30 0x0026 0x03 b
i2cset -y 5 0x30 0x0046 0x03 b
i2cset -y 5 0x30 0x0066 0x03 b
i2cget -y 5 0x30 0x0028 b # should be 0x00
i2cget -y 5 0x30 0x0029 b # should be 0xf0
i2cset -y 5 0x30 0x0001 0x10 b
i2cset -y 5 0x30 0x 0x42 b
i2cset -y 5 0x30 0x0005 0x0f b
i2cset -y 5 0x30 0x0008 0x18 b
i2cget -y 5 0x30 0x0008 b # should be 0x18
i2cset -y 5 0x30 0x0002 0x40 b
i2cset -y 5 0x30 0x0002 0x00 b
i2cset -y 5 0x30 0x000a 0x52 b
i2cget -y 5 0x30 0x0028 b # should be 0x00
i2cset -y 5 0x30 0x0028 0x10 b
i2cget -y 5 0x30 0x0028 b # should be 0x10
i2cget -y 5 0x30 0x0029 b # should be 0xf0
i2cset -y 5 0x30 0x0001 0x10 b
i2cset -y 5 0x30 0x 0x42 b
i2cset -y 5 0x30 0x0005 0x0f b
i2cset -y 5 0x30 0x0008 0x18 b
i2cget -y 5 0x30 0x0008 b # should be 0x18
i2cset -y 5 0x30 0x0002 0x40 b
i2cset -y 5 0x30 0x0002 0x00 b
i2cset -y 5 0x30 0x000a 0x52 b
i2cget -y 5 0x30 0x0028 b # should be 0x10
i2cset -y 5 0x30 0x0028 0x10 b
i2cget -y 5 0x30 0x0028 b # should be 0x10
i2cget -y 5 0x30 0x0029 b # should be 0xf0
i2cset -y 5 0x30 0x0001 0x10 b
i2cset -y 5 0x30 0x 0x42 b
i2cset -y 5 0x30 0x0005 0x0f b
i2cset -y 5 0x30 0x0008 0x18 b
i2cget -y 5 0x30 0x0008 b # should be 0x18
i2cset -y 5 0x30 0x0002 0x40 b
i2cset -y 5 0x30 0x0002 0x00 b
i2cset -y 5 0x30 0x000a 0x52 b
i2cget -y 5