Re: Weirdness when trying to send commands to a Samsung TV

Sahbi via LIRC-list <[email protected]> Fri, 8 Nov 2019 22:34:07 +0100
Newsgroups gmane.comp.hardware.lirc
Message-ID <[email protected]>
Finally found a somewhat correct kernel source (4.14.34-_*3*_-osmc 
instead of 4.14.34-_*4*_-osmc) and managed to successfully compile the 
module, I could also load it without any errors and lirc still works for 
the other 3 remotes. However, it's still no good for the TV.

I verified that the pin is actually put in PWM mode. With the original 
module `gpio readall` shows the pin as simply "OUT", but with the 
patched version it shows ALT0 so it looks like it properly puts it in 
PWM mode. I even made sure the pin is for PWWM0 because apparently PWWM1 
is shared with audio, and I do have an HDMI cable attached. I also 
noticed that IrScrutinizer detected the frequency as 38029 before 
switching drivers, while now it reports a proper 38000. Furthermore, 
/sys/module/lirc_rpi/parameters/hardpwm exists and contains Y. So it 
looks like the driver works.

I even tried compiling lircd from git again but there was no change 
either. Might you have any other funky ideas about how to further 
troubleshoot this (or who else to possibly bug about it)? :D

On 07/11/19 21:19, Sahbi wrote:
>
>> Ouch!! Have you had a look at it (for example graphically in 
>> IrScrutinizer)? It is not even remotely close to what it is supposed 
>> to be. So we conclude that your /dev/lirc (lirc_rpi) is not even 
>> close to working correctly. Case closed!
> I did look at it, but I'm not all that familiar with raw IR stuff yet 
> so I had no idea what to look for exactly.
>> It gets the timing all messed up. (Recall that generating a 38kHz 
>> carrier in software requires an interrupt every 1/(2 * 38000) = 
>> 0.000013 s = 13 microseconds.)
> I see. Oddly enough though, the stereo remote also uses a frequency of 
> 38KHz and that works fine. But its signals are half the length of the 
> TV so that might be why I guess.
>> How to do it better is another topic. Let me just remark that I know 
>> of an unofficial driver using the hardware PWM of the RPi: 
>> https://github.com/Al-/lirc_rpi_hardpwm . See also 
>> http://lirc.10951.n7.nabble.com/hardware-pulse-wave-modulation-modified-kernel-module-tc11134.html
> Sounds interesting, I changed my IR sender's pin to one that supports 
> PWM according to a few docs. I'll try compiling the module and mess 
> with that.
>> To my knowledge, the lirc_rpi is deprecated by the Linux/RPi 
>> communities, but I am not sure it is for the "right" reason... ;-\
> Yeah it is, but the replacement gpio-ir doesn't even work half as well 
> as lirc_rpi. :D
>
> Thanks so far. =]