You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
lirc_rpi module, possible bug in kernel > 3.6 #525
Sums it up best:
"by GeofP » Sun Feb 02, 2014 9:50 pm
...
My /etc/lirc/lircd.conf includes the following parameters:
........ pulse space
header 9590 4730
one 630 1755
zero 630 560
frequency was not defined but the default is 38KHz
The software version of the re-installed software is as follows:
Linux Geof-Pi-1 3.6.11+ #557 PREEMPT Wed Oct 2 18:49:09 BST 2013 armv6l GNU/Linux
Measurements on the storage oscilloscope were as follows:
Header pulse = 9.7ms
frequency = 38KHz
These measurements show the timing for lirc is now correct.
Before the install of the mrgrey software version, my version was:
Linux Geof-Pi-1 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l GNU/Linux
Measurements on the storage oscilloscope were as follows:
Header pulse = 8.2ms
frequency = 45KHz
These measurements show the timing for lirc is wrong. ..."
I have checked the lirc timing problem on a number of versions of software.
These produce the correct timing: versions 3.6.11+ #363 through to 3.6.11+ #557 (the last in the 3.6.xx series I could find)
These produce the wrong timing: versions 3.10.13+ #555 through to 3.10.28+ #634 (latest release at time of writing).
The wrong timing is faster then the correct timing by about 15%
This driver was provided as a pull request, so I don't know much about it.
I can't think of any that we have changed that would affect timing, but there are many upstream commits between 3.6 and 3.10 kernels.
Can you confirm if the issue only affect transmission, or is there a problem with reception?
@ar0n@cleverca22 You were involved in the original driver - any suggestions?
I performed the following experiment which confirms it is only a fault with the transmission. irrecord puts the correct parameters in the lircd.conf file for both 3.6.11 and 3.10.29. The timing produced in transmission is wrong in the 3.10.29 version. (which is the same as posted above, but I wanted to confirm the actual numbers and measurements.)
Starting with software version 3.6.11+ #557 PREEMPT Wed Oct 2 18:49:09 BST 2013
Using mode2 -d /dev/lirc0, recorded the pulses from the foxsat remote power button (key_power).
The header pulse was displayed as 8982
The header pulse measured 9.0ms on the oscilloscope (which is what is expected)
Using irrecord -d /dev/lirc0 ~/lircd.conf, recorded button presses from the humax remote
Output of irrecord as follows:
Found const length: 107290
Space/pulse encoded remote control found.
Signal length is 67.
Found possible header: 8981 4429
Found trail pulse: 589
Found repeat code: 8983 2214
Signals are space encoded.
Signal length is 32
The lircd.conf included the following line:
header 8981 4429
Changed the name in ~/lircd.conf to foxsat-hdr and copied the file to /etc/lirc
Started up lirc again with sudo /etc/init.d/lirc start
Ran the command irsend send_once foxsat-hdr key_power
A header pulse of 9.0ms was measured on the oscilloscope.
Performed a sudo rpi-update to:
3.10.29+ #636 PREEMPT Sun Feb 9 19:58:58 GMT 2014
Checked the header pulse
irsend send_once foxsat-hdr key_power
lirc ir header pulse measures 7.7ms, (before the rpi-update it had read 9.0ms)
Repeated the above experiment of learning the remote, making a new lircd.conf file and measuring the new header pulse.
Using mode2 -d /dev/lirc0, recorded the pulses from the foxsat remote power button (key_power).
The header pulse was displayed as 8980, (before was 8982, so effectivily the same)
The header pulse measured 9.0ms on the oscilloscope
Using irrecord -d /dev/lirc0 ~/lircd.conf, recorded button presses from the humax remote.
Output of irrecord as follows: (this was effectively the same as before)
Found const length: 107290
Space/pulse encoded remote control found.
Signal length is 67.
Found possible header: 8983 4427
Found trail pulse: 588
Found repeat code: 8985 2213
Signals are space encoded.
Signal length is 32
The lircd.conf included the following line: (this was effectively the same as before)
header 8983 4427
Ran the command irsend send_once foxsat-hdr key_power
A header pulse of 7.7ms was measured on the oscilloscope.
I don't have the equipment to check this out now, but can somebody test it with this version: ar0n@69af0bf
This one directly writes the registers, so we can rule out a few things (but I think the problem is elsewhere). Thanks!
I tried this a couple of weeks back and got a file not found error message.
My current software is : 3.10.29+ #636 PREEMPT Sun Feb 9 19:58:58 GMT 2014
Tried it again, this is the response:
sudo rpi-update 69af0bf
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS
*** Performing self-update
--2014-02-17 07:45:09-- https://github.com/Hexxeh/rpi-update/raw/master/rpi-update
Resolving github.com (github.com)... 192.30.252.128
Connecting to github.com (github.com)|192.30.252.128|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.github.com/Hexxeh/rpi-update/master/rpi-update [following]
--2014-02-17 07:45:15-- https://raw.github.com/Hexxeh/rpi-update/master/rpi-update
Resolving raw.github.com (raw.github.com)... 185.31.18.133
Connecting to raw.github.com (raw.github.com)|185.31.18.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7174 (7.0K) [text/plain]
Saving to: `/usr/bin/rpi-update.tmp'
100%[======================================>] 7,174 --.-K/s in 0.02s
*** Relaunching after update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS
*** ARM/GPU split is now defined in /boot/config.txt using the gpu_mem option!
*** Downloading specific firmware revision (this will take a few minutes)
*** Decompressing downloaded firmware archive
--2014-02-17 07:45:20-- https://github.com/Hexxeh/rpi-firmware/tarball/69af0bf569f66fa3262f2b46e5e636742de48dcb
Resolving github.com (github.com)... 192.30.252.128
Connecting to github.com (github.com)|192.30.252.128|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2014-02-17 07:45:26 ERROR 404: Not Found.
I have the same kind of behavior with Raspbmc which is using a 3.10.24 kernel.
I am only using IR blasting, thus output only, and I have checked timing with a scope
When freq is 38khz, real output is almost 45Khz.
Timing off pulses is also shorter than expected (~480us instead of 533).
I came to the quick conclusion that it could be related to the overclocking factor (Raspbmc is using 800Mhz , whereas the regular RPi should run 700Mhz). Can someone confirm that ?
I don't use Raspbmc and have not configured the Pi to be overclocked. Looking at my /boot/config.txt confirms the Pi is running at the default 700MHz. So, I think this not the cause of the problem.
@jjmz interesting. First can you just call ndelay(d * 1000) rather than udelay(d) just to rule out an issue with udelay not being accurate.
If it's just an issue with quantising to 1us resolution is introducing the error (measured at about 18%) that would suggest the delays being called are ~5us - are they really that short?
Can anyone else repeat their tests with this patch?
@jjmz :
I've patched the original version of 3.10.30+ I used to test ar0n@69af0bf with. So far receiving works but sending doesn't work at all. Not even the TV responded (and it did work in all kernel versions until now). I'll check my hardware-setup again now ..
If someone could tell me how to do the "cross-compile toolchain" mentioned earlier by koromar, I will try to incorporate this patch and measure the timings on my system.
Activity
GeofP commentedon Feb 6, 2014
I have checked the lirc timing problem on a number of versions of software.
These produce the correct timing: versions 3.6.11+ #363 through to 3.6.11+ #557 (the last in the 3.6.xx series I could find)
These produce the wrong timing: versions 3.10.13+ #555 through to 3.10.28+ #634 (latest release at time of writing).
The wrong timing is faster then the correct timing by about 15%
popcornmix commentedon Feb 9, 2014
This driver was provided as a pull request, so I don't know much about it.
I can't think of any that we have changed that would affect timing, but there are many upstream commits between 3.6 and 3.10 kernels.
Can you confirm if the issue only affect transmission, or is there a problem with reception?
@ar0n @cleverca22 You were involved in the original driver - any suggestions?
chrislibuilds commentedon Feb 9, 2014
Receiving works, but irrecord spit out a slightly different lircd.conf:
Linux host1 3.6.11+ #557 PREEMPT Wed Oct 2 18:49:09 BST 2013 armv6l GNU/Linux
Linux host2 3.10.28+ #634 PREEMPT Sun Feb 2 15:16:25 GMT 2014 armv6l GNU/Linux
GeofP commentedon Feb 10, 2014
I performed the following experiment which confirms it is only a fault with the transmission. irrecord puts the correct parameters in the lircd.conf file for both 3.6.11 and 3.10.29. The timing produced in transmission is wrong in the 3.10.29 version. (which is the same as posted above, but I wanted to confirm the actual numbers and measurements.)
Starting with software version 3.6.11+ #557 PREEMPT Wed Oct 2 18:49:09 BST 2013
Using mode2 -d /dev/lirc0, recorded the pulses from the foxsat remote power button (key_power).
The header pulse was displayed as 8982
The header pulse measured 9.0ms on the oscilloscope (which is what is expected)
Using irrecord -d /dev/lirc0 ~/lircd.conf, recorded button presses from the humax remote
Output of irrecord as follows:
Found const length: 107290
Space/pulse encoded remote control found.
Signal length is 67.
Found possible header: 8981 4429
Found trail pulse: 589
Found repeat code: 8983 2214
Signals are space encoded.
Signal length is 32
The lircd.conf included the following line:
header 8981 4429
Changed the name in ~/lircd.conf to foxsat-hdr and copied the file to /etc/lirc
Started up lirc again with sudo /etc/init.d/lirc start
Ran the command irsend send_once foxsat-hdr key_power
A header pulse of 9.0ms was measured on the oscilloscope.
Performed a sudo rpi-update to:
3.10.29+ #636 PREEMPT Sun Feb 9 19:58:58 GMT 2014
Checked the header pulse
irsend send_once foxsat-hdr key_power
lirc ir header pulse measures 7.7ms, (before the rpi-update it had read 9.0ms)
Repeated the above experiment of learning the remote, making a new lircd.conf file and measuring the new header pulse.
Using mode2 -d /dev/lirc0, recorded the pulses from the foxsat remote power button (key_power).
The header pulse was displayed as 8980, (before was 8982, so effectivily the same)
The header pulse measured 9.0ms on the oscilloscope
Using irrecord -d /dev/lirc0 ~/lircd.conf, recorded button presses from the humax remote.
Output of irrecord as follows: (this was effectively the same as before)
Found const length: 107290
Space/pulse encoded remote control found.
Signal length is 67.
Found possible header: 8983 4427
Found trail pulse: 588
Found repeat code: 8985 2213
Signals are space encoded.
Signal length is 32
The lircd.conf included the following line: (this was effectively the same as before)
header 8983 4427
Ran the command irsend send_once foxsat-hdr key_power
A header pulse of 7.7ms was measured on the oscilloscope.
ar0n commentedon Feb 16, 2014
I don't have the equipment to check this out now, but can somebody test it with this version: ar0n@69af0bf
This one directly writes the registers, so we can rule out a few things (but I think the problem is elsewhere). Thanks!
GeofP commentedon Feb 17, 2014
I tried this a couple of weeks back and got a file not found error message.
My current software is : 3.10.29+ #636 PREEMPT Sun Feb 9 19:58:58 GMT 2014
Tried it again, this is the response:
sudo rpi-update 69af0bf
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS
*** Performing self-update
--2014-02-17 07:45:09-- https://github.com/Hexxeh/rpi-update/raw/master/rpi-update
Resolving github.com (github.com)... 192.30.252.128
Connecting to github.com (github.com)|192.30.252.128|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.github.com/Hexxeh/rpi-update/master/rpi-update [following]
--2014-02-17 07:45:15-- https://raw.github.com/Hexxeh/rpi-update/master/rpi-update
Resolving raw.github.com (raw.github.com)... 185.31.18.133
Connecting to raw.github.com (raw.github.com)|185.31.18.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7174 (7.0K) [text/plain]
Saving to: `/usr/bin/rpi-update.tmp'
100%[======================================>] 7,174 --.-K/s in 0.02s
2014-02-17 07:45:20 (397 KB/s) - `/usr/bin/rpi-update.tmp' saved [7174/7174]
*** Relaunching after update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS
*** ARM/GPU split is now defined in /boot/config.txt using the gpu_mem option!
*** Downloading specific firmware revision (this will take a few minutes)
*** Decompressing downloaded firmware archive
--2014-02-17 07:45:20-- https://github.com/Hexxeh/rpi-firmware/tarball/69af0bf569f66fa3262f2b46e5e636742de48dcb
Resolving github.com (github.com)... 192.30.252.128
Connecting to github.com (github.com)|192.30.252.128|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2014-02-17 07:45:26 ERROR 404: Not Found.
chrislibuilds commentedon Feb 20, 2014
finally set up a cross-compile toolchain to test the code aron mentioned. will post an update with my findings tonight.
chrislibuilds commentedon Feb 20, 2014
@ar0n : doesn't work with ar0n@69af0bf
jjmz commentedon Mar 4, 2014
I have the same kind of behavior with Raspbmc which is using a 3.10.24 kernel.
I am only using IR blasting, thus output only, and I have checked timing with a scope
When freq is 38khz, real output is almost 45Khz.
Timing off pulses is also shorter than expected (~480us instead of 533).
I came to the quick conclusion that it could be related to the overclocking factor (Raspbmc is using 800Mhz , whereas the regular RPi should run 700Mhz). Can someone confirm that ?
GeofP commentedon Mar 4, 2014
I don't use Raspbmc and have not configured the Pi to be overclocked. Looking at my /boot/config.txt confirms the Pi is running at the default 700MHz. So, I think this not the cause of the problem.
jjmz commentedon Mar 6, 2014
Ok, that's not the overclocking factor...
I made some tests replacing udelay (and rounding to nearest us) by ndelay in the code, and it seems to work pretty well
Here are the patched lines :
popcornmix commentedon Mar 6, 2014
@jjmz interesting. First can you just call ndelay(d * 1000) rather than udelay(d) just to rule out an issue with udelay not being accurate.
If it's just an issue with quantising to 1us resolution is introducing the error (measured at about 18%) that would suggest the delays being called are ~5us - are they really that short?
Can anyone else repeat their tests with this patch?
chrislibuilds commentedon Mar 6, 2014
@jjmz :
I've patched the original version of 3.10.30+ I used to test ar0n@69af0bf with. So far receiving works but sending doesn't work at all. Not even the TV responded (and it did work in all kernel versions until now). I'll check my hardware-setup again now ..
chrislibuilds commentedon Mar 6, 2014
replugged/rewired what was possible: now it's working with jjmz's patch. =)
GeofP commentedon Mar 7, 2014
If someone could tell me how to do the "cross-compile toolchain" mentioned earlier by koromar, I will try to incorporate this patch and measure the timings on my system.
332 remaining items
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO
lirc: added support for RaspberryPi GPIO