Hi, I'm also having this problem.
I used lirc audio_alsa in Backfire with customized firmwares without this issue.
But newer revisions have this problem. It is very easy to reproduce for me. With alsa-utils installed, arecord does the job. Just make dummy records
/usr/bin/arecord -q -d 1 -r44100 -f S16_LE -c1 -t raw > /dev/null
- Let's start in a state where lirc audio_alsa works perfectly, irw shows the remote codes, close irw, and execute arecord, then open again irw --> it stops working or working bad
- Execute three more times again --> now irw starts working fine again
- Execute four times arecord --> irw works fine
root@OpenWrt:/# irw
00000000000005e9 00 + rct3004
00000000000005e9 00 + rct3004
00000000000005e9 00 + rct3004
00000000000005e9 00 + rct3004
^C
root@OpenWrt:/# /usr/bin/arecord -q -d 1 -r44100 -f S16_LE -c1 -t raw > /dev/null
root@OpenWrt:/# irw
^C
root@OpenWrt:/# /usr/bin/arecord -q -d 1 -r44100 -f S16_LE -c1 -t raw > /dev/null
root@OpenWrt:/# irw
^C
root@OpenWrt:/# /usr/bin/arecord -q -d 1 -r44100 -f S16_LE -c1 -t raw > /dev/null
root@OpenWrt:/# irw
^C
root@OpenWrt:/# /usr/bin/arecord -q -d 1 -r44100 -f S16_LE -c1 -t raw > /dev/null
root@OpenWrt:/# irw
00000000000005e9 00 + rct3004
00000000000005e9 01 + rct3004
00000000000005e9 00 + rct3004
00000000000005e9 00 + rct3004
00000000000005e9 00 + rct3004
00000000000005e9 01 + rct3004
^C
root@OpenWrt:/# /usr/bin/arecord -q -d 1 -r44100 -f S16_LE -c1 -t raw > /dev/null
root@OpenWrt:/# irw
^C
root@OpenWrt:/# /usr/bin/arecord -q -d 1 -r44100 -f S16_LE -c1 -t raw > /dev/null
root@OpenWrt:/# irw
^C
root@OpenWrt:/# /usr/bin/arecord -q -d 1 -r44100 -f S16_LE -c1 -t raw > /dev/null
root@OpenWrt:/# irw
^C
root@OpenWrt:/# /usr/bin/arecord -q -d 1 -r44100 -f S16_LE -c1 -t raw > /dev/null
root@OpenWrt:/# irw
00000000000005e9 00 + rct3004
00000000000005e9 00 + rct3004
00000000000005e9 00 + rct3004
00000000000005e9 00 + rct3004
00000000000005e9 01 + rct3004
As you can see poking alsa with arecord exactly 4 times turns the alsa/audio stuff in a state where irw works perfectly. I tested it many times and always after 4 arecord dummy recordings all works fine.
The problem here is, other stuff in the system pokes alsa/audio stuff, so we need to poke manually with arecord 1,2, or 3 times to complete the cycle of 4 pokes.
When booting the system I only need 1 poke, once irexec handle the usb soundcard no other stuff will ruin the remote detections. I do it before mpd starts. I'm currently using this ugly init script
START=90
start() {
#create lircd directory
/bin/mkdir /var/run/lirc/
#start lirc daemon
/usr/sbin/lircd --driver=audio_alsa -d plughw@24000
#give some time to lircd to finish handling the soundcard
/bin/sleep 1
#poke alsa input with one dummy recording
/usr/bin/arecord -q -d 1 -r44100 -f S16_LE -c1 -t raw > /dev/null
#this sleep shouldn't be need
/bin/sleep 1
/usr/sbin/irexec --daemon /etc/streamradio/lircrc
}
stop() {
/usr/bin/killall lircd
}
I suspect this might be an endianess problem, 4 bytes defines the endianess, and 4 times executing arecord returns the audio card to a sane state, well who knows.