You are not logged in.

#1 2022-07-13 16:06:05

xafnir
Member
Registered: 2019-08-01
Posts: 14

serial_ir ir-keytable stops after first key event

Hi, I bought a new mainboard and want to test my remote controller with it.

I wanted to use again a home-brew serial ir-receiver on ttyS0 (com port) which I also used on my old mainboard.

With kernel module, i can load "serial_ir", and then use either "ir-ctr -r" or "ir-keytable -t" with my old *.toml file.

The strange thing is, that after I loaded the module, only the first or second key press on the remote are recognized. Then nothing more.
When I remove and load the serial_ir remote again, then again only the 1,2 keys press are recognized.


Has anyone any Idea what I can try to find the problem?
For example, It is possible to  increase the log level of the serial_ir module?


(I hope it's not an hardware bug in the GigaByte B660M DS3H Mainbard.)

Offline

#2 2022-07-13 18:02:54

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 630

Re: serial_ir ir-keytable stops after first key event

xafnir wrote:

For example, It is possible to  increase the log level of the serial_ir module?

You can try to enable debug output for module, as described here.

Offline

#3 2022-07-17 08:56:38

xafnir
Member
Registered: 2019-08-01
Posts: 14

Re: serial_ir ir-keytable stops after first key event

Thanks, now I'm know how to activate some debugging messages. In my case:

# message from module serial_ir
> echo 'module serial_ir +p' > /sys/kernel/debug/dynamic_debug/control
# all remote controls
> echo 'file rc-* +p' > /sys/kernel/debug/dynamic_debug/control
# all decoders
> echo 'file ir-* +p' > /sys/kernel/debug/dynamic_debug/control
# check whats active, for example ir
> cat /sys/kernel/debug/dynamic_debug/control | grep ir-

Then I can see that the sony decoder receives an "invalid bitcount", when I press a key. After that message no further key is recognized.

# remove and reload the module
> modprobe -r serial_ir && modprobe serial_ir && ir-ctl -r
# other console
> dmesg -w
...
[  +2,597742] rc rc0: leave idle mode
[  +0,000397] rc rc0: sample: (02413us pulse)
[  +0,000091] rc rc0: RC6 decode started at state 0 (2413us pulse)
[  +0,000012] rc rc0: NEC decode started at state 0 (2413us pulse)
[  +0,000004] rc rc0: NEC decode failed at count 0 state 0 (2413us pulse)
[  +0,000004] rc rc0: Sony decode started at state 0 (2413us pulse)
[  +0,000554] rc rc0: sample: (00397us space)
[  +0,000089] rc rc0: RC6 decode started at state 1 (397us space)
[  +0,000010] rc rc0: RC6 decode failed at state 1 (397us space)
[  +0,000004] rc rc0: NEC decode started at state 0 (397us space)
[  +0,000003] rc rc0: NEC decode failed at count 0 state 0 (397us space)
[  +0,000004] rc rc0: Sony decode started at state 1 (397us space)
[  +0,000446] rc rc0: sample: (00665us pulse)
[  +0,000091] rc rc0: RC6 decode started at state 0 (665us pulse)
[  +0,000011] rc rc0: RC6 decode failed at state 0 (665us pulse)
[  +0,000004] rc rc0: NEC decode started at state 0 (665us pulse)
[  +0,000003] rc rc0: NEC decode failed at count 0 state 0 (665us pulse)
[  +0,000004] rc rc0: Sony decode started at state 2 (665us pulse)
[  +0,001131] rc rc0: sample: (00556us space)
[  +0,000042] rc rc0: RC6 decode started at state 0 (556us space)
[  +0,000004] rc rc0: RC6 decode failed at state 0 (556us space)
[  +0,000003] rc rc0: NEC decode started at state 0 (556us space)
[  +0,000003] rc rc0: NEC decode failed at count 0 state 0 (556us space)
[  +0,000003] rc rc0: Sony decode started at state 3 (556us space)
[  +0,000480] rc rc0: sample: (01243us pulse)
[  +0,000037] rc rc0: RC6 decode started at state 0 (1243us pulse)
[  +0,000003] rc rc0: RC6 decode failed at state 0 (1243us pulse)
[  +0,000003] rc rc0: NEC decode started at state 0 (1243us pulse)
[  +0,000003] rc rc0: NEC decode failed at count 0 state 0 (1243us pulse)
[  +0,000003] rc rc0: Sony decode started at state 2 (1243us pulse)
[  +0,000609] rc rc0: sample: (00535us space)
[  +0,000037] rc rc0: RC6 decode started at state 0 (535us space)
[  +0,000003] rc rc0: RC6 decode failed at state 0 (535us space)
[  +0,000003] rc rc0: NEC decode started at state 0 (535us space)
[  +0,000003] rc rc0: NEC decode failed at count 0 state 0 (535us space)
[  +0,000002] rc rc0: Sony decode started at state 3 (535us space)
[  +0,000491] rc rc0: sample: (00657us pulse)
[  +0,000037] rc rc0: RC6 decode started at state 0 (657us pulse)
[  +0,000003] rc rc0: RC6 decode failed at state 0 (657us pulse)
[  +0,000003] rc rc0: NEC decode started at state 0 (657us pulse)
[  +0,000002] rc rc0: NEC decode failed at count 0 state 0 (657us pulse)
[  +0,000003] rc rc0: Sony decode started at state 2 (657us pulse)
[  +0,001223] rc rc0: sample: (00538us space)
[  +0,000039] rc rc0: RC6 decode started at state 0 (538us space)
[  +0,000003] rc rc0: RC6 decode failed at state 0 (538us space)
[  +0,000003] rc rc0: NEC decode started at state 0 (538us space)
[  +0,000003] rc rc0: NEC decode failed at count 0 state 0 (538us space)
[  +0,000003] rc rc0: Sony decode started at state 3 (538us space)
[  +0,019642] rc rc0: sample: (01270us pulse)
[  +0,000010] rc rc0: enter idle mode
[  +0,000003] rc rc0: sample: (16000us space)
[  +0,000016] rc rc0: RC6 decode started at state 0 (1270us pulse)
[  +0,000004] rc rc0: RC6 decode failed at state 0 (1270us pulse)
[  +0,000003] rc rc0: NEC decode started at state 0 (1270us pulse)
[  +0,000002] rc rc0: NEC decode failed at count 0 state 0 (1270us pulse)
[  +0,000003] rc rc0: Sony decode started at state 2 (1270us pulse)
[  +0,000006] rc rc0: RC6 decode started at state 0 (16000us space)
[  +0,000003] rc rc0: RC6 decode failed at state 0 (16000us space)
[  +0,000002] rc rc0: NEC decode started at state 0 (16000us space)
[  +0,000003] rc rc0: NEC decode failed at count 0 state 0 (16000us space)
[  +0,000003] rc rc0: Sony decode started at state 3 (16000us space)
[  +0,000003] rc rc0: Sony invalid bitcount 4
[  +0,000003] rc rc0: Sony decode failed at state 4 (15400us space)

Offline

#4 2022-07-17 14:50:54

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 630

Re: serial_ir ir-keytable stops after first key event

Your RC uses Sony protocol, doesn't it? Try to unload other protocols decoder modules, such as ir-rc6-decoder and ir-nec-decoder.
Looks like ir-sony-decoder state machine goes into inconsistent state and can't recover. Probably it's flaw in the decoder module. Another question is why it goes into inconsistent state on new motherboard and doesn't on old one. Maybe EMI. Maybe different serial port line characteristics, such as input impedance or capacity. Can you compare width of pulses and spaces reported in logs for the same command on new and old motherboards? Is circuit diagram for your receiver available? Maybe stronger pullup or pulldown could help. Also if you have USB to RS-232 adapter (with level shifting if receiver has RS-232 output), you can test with it.

Last edited by dimich (2022-07-17 14:52:30)

Offline

#5 2022-07-17 16:55:05

xafnir
Member
Registered: 2019-08-01
Posts: 14

Re: serial_ir ir-keytable stops after first key event

I removed ir_sony_decoder, and tested it with another remote, which uses NEC protocol. Same result (NEC decode failed ...)

I would say it's an an hardware problem. I have two ir-receivers. One self made by my brother and one from an old pci tv card. Both have the same problem.
It could be that the new mainboard have an other circuit/impendance/capacity on the RS232 port.

On https://www.lirc.org/receivers.html is a "more advanced ciruit" layout for the ir-receiver, which is a little bit different than my ir-receiver. Maybe it works better with it.
I will ask my brother if he can create me a new ir-receiver with that layout, because I have no experience/equipment to do that.

Offline

#6 2022-07-17 17:28:21

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 630

Re: serial_ir ir-keytable stops after first key event

sample: (16000us space)

looks strange. Neither Sony or NEC have 16 ms pulses/spaces in command and between them. Is the same space width present in working configuration?

You can try to play with serial_ir  module `sense` parameter, it can be active high or low depending on receiver output polarity.

Is any other serial drivers loaded, e.g. for serial console? serial_ir directly accesses serial port controller, it may conflict with other drivers. Try to unbind tty driver from serial port in /sys/bus/pnp/drivers/serial// or even disable it in BIOS.

Offline

Board footer

Powered by FluxBB