sparkie777
Posts: 206
Joined: Tue Nov 27, 2012 4:37 am

[LIRC] irsend runs into timeout sporadically

Wed Dec 27, 2017 12:39 pm

I've ported my LIRC configuration from raspbian/jessie to raspbian/stretch.

lirc_options.conf:

Code: Select all

[lircd]
nodaemon        = False
driver          = default
device          = auto
output          = /var/run/lirc/lircd
pidfile         = /var/run/lirc/lircd.pid
plugindir       = /usr/lib/arm-linux-gnueabihf/lirc/plugins
permission      = 666
allow-simulate  = No
repeat-max      = 600

[lircmd]
uinput          = False
nodaemon        = False
lircd.conf:

Code: Select all

begin remote
  name  SONY_RM_U304
  bits                           15
  flags      SPACE_ENC|CONST_LENGTH
  eps                            30
  aeps                          100

  header                       2446   560
  one                          1248   539
  zero                          653   539
  gap                         44350
  min_repeat                      2
  toggle_bit_mask               0x0
  frequency                   38000
      begin codes
          SYSTEM_STANDBY           0x540c
          BTN_AUX                  0x600d
          BTN_DVD                  0x220c
          BTN_DOWN                 0x640c
          BTN_UP                   0x240c
      end codes
end remote
config.txt:

Code: Select all

[...]
dtoverlay=lirc-rpi,gpio_in_pin=10,gpio_out_pin=7
[...]
Basically everything works as expected. But sporadically after calling the 'irsend' a few times

Code: Select all

irsend SEND_ONCE SONY_RM_U304 BTN_UP
the command hangs and huge masses of timeout messages like:

/var/log/messages:

Code: Select all

Dec 27 13:21:55 rpi-m irsend: lirc_command_run: Sending: SEND_ONCE SONY_RM_U304 BTN_UP
Dec 27 13:21:55 rpi-m irsend: lirc_command_run, state: 0, input: "BEGIN"
Dec 27 13:21:55 rpi-m irsend: lirc_command_run, state: 1, input: "SEND_ONCE SONY_RM_U304 BTN_UP"
Dec 27 13:21:55 rpi-m irsend: lirc_command_run, state: 2, input: "SUCCESS"
Dec 27 13:21:55 rpi-m irsend: lirc_command_run, state: 3, input: "END"
Dec 27 13:21:55 rpi-m irsend: lirc_command_run: data:END, status:0
Dec 27 13:21:56 rpi-m irsend: lirc_command_run: Sending: SEND_ONCE SONY_RM_U304 BTN_UP
Dec 27 13:21:56 rpi-m irsend: lirc_command_run, state: 0, input: "BEGIN"
Dec 27 13:21:56 rpi-m irsend: lirc_command_run, state: 1, input: "SEND_ONCE SONY_RM_U304 BTN_UP"
Dec 27 13:21:56 rpi-m irsend: lirc_command_run, state: 2, input: "SUCCESS"
Dec 27 13:21:56 rpi-m irsend: lirc_command_run, state: 3, input: "END"
Dec 27 13:21:56 rpi-m irsend: lirc_command_run: data:END, status:0
Dec 27 13:21:58 rpi-m irsend: lirc_command_run: Sending: SEND_ONCE SONY_RM_U304 BTN_UP
Dec 27 13:21:58 rpi-m irsend: lirc_command_run, state: 0, input: "BEGIN"
Dec 27 13:21:58 rpi-m irsend: lirc_command_run, state: 1, input: "SEND_ONCE SONY_RM_U304 BTN_UP"
Dec 27 13:21:58 rpi-m irsend: lirc_command_run, state: 2, input: "SUCCESS"
Dec 27 13:21:58 rpi-m irsend: lirc_command_run, state: 3, input: "END"
Dec 27 13:21:58 rpi-m irsend: lirc_command_run: data:END, status:0
Dec 27 13:21:59 rpi-m irsend: lirc_command_run: Sending: SEND_ONCE SONY_RM_U304 BTN_UP
Dec 27 13:22:00 rpi-m irsend: fill_string: timeout
Dec 27 13:22:01 rpi-m irsend: fill_string: timeout
Dec 27 13:22:02 rpi-m irsend: fill_string: timeout
Dec 27 13:22:03 rpi-m irsend: fill_string: timeout
Dec 27 13:22:04 rpi-m irsend: fill_string: timeout
Dec 27 13:22:05 rpi-m irsend: fill_string: timeout
Dec 27 13:22:06 rpi-m irsend: fill_string: timeout
Dec 27 13:22:07 rpi-m irsend: fill_string: timeout
Dec 27 13:22:08 rpi-m irsend: fill_string: timeout
Dec 27 13:22:09 rpi-m irsend: fill_string: timeout
Dec 27 13:22:10 rpi-m irsend: fill_string: timeout
Dec 27 13:22:11 rpi-m irsend: fill_string: timeout
[...]
appear in the log. If I wait for say 30s the LIRC internal state machine cleans up and calling 'irsend' continues to work as expected in the first place:

Code: Select all

[...]
Dec 27 13:26:57 rpi-m irsend: fill_string: timeout
Dec 27 13:26:58 rpi-m irsend: fill_string: timeout
Dec 27 13:26:59 rpi-m irsend: fill_string: timeout
Dec 27 13:27:00 rpi-m irsend: fill_string: timeout
Dec 27 13:27:01 rpi-m irsend: fill_string: timeout
Dec 27 13:27:03 rpi-m irsend: fill_string: timeout
Dec 27 13:27:04 rpi-m irsend: fill_string: timeout
Dec 27 13:27:44 rpi-m irsend: lirc_command_run: Sending: SEND_ONCE SONY_RM_U304 BTN_UP
Dec 27 13:27:44 rpi-m lircd[336]: lircd-0.9.4c[336]: Error: error processing command: SEND_ONCE SONY_RM_U304 BTN_UP
Dec 27 13:27:44 rpi-m lircd-0.9.4c[336]: Error: error processing command: SEND_ONCE SONY_RM_U304 BTN_UP
Dec 27 13:27:44 rpi-m lircd[336]: lircd-0.9.4c[336]: Error: busy: repeating
Dec 27 13:27:44 rpi-m lircd-0.9.4c[336]: Error: busy: repeating
Dec 27 13:27:44 rpi-m irsend: lirc_command_run, state: 0, input: "BEGIN"
Dec 27 13:27:44 rpi-m irsend: lirc_command_run, state: 1, input: "SEND_ONCE SONY_RM_U304 BTN_UP"
Dec 27 13:27:44 rpi-m irsend: lirc_command_run, state: 2, input: "ERROR"
Dec 27 13:27:44 rpi-m irsend: irsend: command failed: SEND_ONCE SONY_RM_U304 BTN_UP
Dec 27 13:27:44 rpi-m irsend: lirc_command_run, state: 3, input: "DATA"
Dec 27 13:27:44 rpi-m irsend: lirc_command_run, state: 4, input: "1"
Dec 27 13:27:44 rpi-m irsend: lirc_command_run, state: 5, input: "busy: repeating"
Dec 27 13:27:44 rpi-m irsend: lirc_command_run, state: 6, input: "END"
Dec 27 13:27:44 rpi-m irsend: lirc_command_run: status:END, status:5
It's a raspbian/ stretch issue since in raspbian/ jessie everything worked with no problems at all.

Since stretch it appears calling 'irsend' with less than 1 second gap makes the error more likely to strike. The phenomenon is at random. Sometimes even the very first call to 'irsend' (after reboot) runs instantly into a timeout.

Is this a known LIRC problem? Exists there a workaround? Or even a fix? :-)

LIRC is unusable with this kind of failure.

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: [LIRC] irsend runs into timeout sporadically

Wed Dec 27, 2017 11:08 pm

LIRC seems to have become a limbo project with little chance of any support/changes being made to it

I've left all my LIRC projects (got 3 of them around the house) on Jessie as my workaround

sparkie777
Posts: 206
Joined: Tue Nov 27, 2012 4:37 am

Re: [LIRC] irsend runs into timeout sporadically

Thu Dec 28, 2017 4:55 am

mattmiller wrote:
Wed Dec 27, 2017 11:08 pm
I've left all my LIRC projects (got 3 of them around the house) on Jessie as my workaround
I strongly hoped you would not say that :o

In the meantime I found some postings with similar issues for lirc_0.9.4c (the version raspbian/stretch uses)

LIRC Mailing Lists - irsend: fill_string: timeout

original comments from there:

[...]
Yes, I think it should. But the lircd code for repeating is somewhat ...
peculiar...
[...]

[...]
Ok. There are still some open questions, but my personal goal is rather
to replace Lirc than to support or improve it : -).

(see Welcome to the HARCToolbox project! and bengtmartensson (Bengt Martensson))
[...]

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: [LIRC] irsend runs into timeout sporadically

Thu Dec 28, 2017 8:51 am

But, if its just sending your having problems with, then I'd think it wouldn't be too much trouble to use @joan pigpiod for that bit

viewtopic.php?f=63&t=126919

But can I suggest having a think about whether sticking with Jessie is going to actually be a real world problem

sparkie777
Posts: 206
Joined: Tue Nov 27, 2012 4:37 am

Re: [LIRC] irsend runs into timeout sporadically

Thu Dec 28, 2017 9:50 am

sounds great, thanks for the hint. My first aid procedure now was to revert all my LIRC RPis back to jessie. To keep up the good WAF :-)
So I gained some time to experiment with solutions not dealing with LIRC.

Rest in Peace LIRC.

talkeasy
Posts: 38
Joined: Sun Nov 04, 2012 10:57 pm

Re: [LIRC] irsend runs into timeout sporadically

Wed Jan 17, 2018 7:12 pm

Thanks for posting this - spent many hours trying to suppress multiple repeats and other random behaviour using Stretch. Rebuilt the platform on Jessie and all now works a treat.

Be great to get a working Stretch solution and not bury LIRC in the long term!

Return to “Troubleshooting”