Help  Search  Portal
 Portal  Search
Hello There, Guest!  Register  Login

IR Blasting - LMS on snakeoil

As per I have spent way too much time on getting IR blaster working on snakeoil with the squeezelite client and LMS server (v7.9.3). The IR_Blaster LMS plugin for hardware players (via the headphone jack) locks the player volume @100% and any player volume adjustments are blasted to my amp. Works perfectly and is what I was trying to emulate.

Unfortunately while I eventually got it all working, the result was a little underwhelming for me. My plan was to use LIRCD for the IR blasting side and the script from to handle the triggering side. See also

Below are the steps that I used to get this working in case someone else wants to do this.

LIRCD - many hours of playing around I finally got a working config. What I found. 

- I purchased a blaster from but in the end was not needed. My old DIY one consisting of an IR emitter wired to a 3.5mm audio plug worked also.
- in lirc_options.conf, I just needed to change the driver to "audio". The detected devices was listed in the syslog after starting it and you could set the device in the lirc_options.conf or as an option in the command. Mine was "ALSA:HDA Intel PCH: ALC283 Analog (hw:0,0)" but "sudo lircd -d ALSA:[email protected]" seemed to work just fine as well.
- lirc has a list of remote definitions - edit something to suit if your remote is not in the list.
- my irsend command to testing has a lot of false negatives - I eventually discovered that it needed multiple pulses to work. My final command was "usr/sbin/irsend -# 3 SEND_ONCE amp AMP_VOL_DOWN" - the #3 gives 3 x repeats.

Next step was the script... which needed micropython to be installed. To save a lot of heartache, dont follow the instructions in the README file, use the wiki instead There were lots of dependencies...

sudo apt install make
sudo apt install build-essential
sudo apt install libffi-dev
sudo apt install pkg-config
sudo apt-get install libreadline-dev
sudo apt-get install gcc-arm-none-eabi
sudo apt-get install libnewlib-arm-none-eabi

Finally install;

git clone --recurse-submodules

then follow up with some makes..

cd ~micropython/mpy-cross
cd ~micropython/ports/unix

'sudo chmod +x' to make the script executable.


Edit/create the json.config as per the example - LMS IP, port, commands and player name (optional). Use your irsend commands in the json for the events. Dont be tempted to remove any events (eg. power off) as the json file wont load. Set the command field to be empty if you dont want to use one.

This IR daemon supports power on/off and volume up/down events. If you want to do volume, you need to install the LMS plugin VolumeLock, which was well hidden in the discussion thread....if you dont install this plugin detecting volume events will not work.

You also need to set the Volume Control within the LMS audio settings of the player to 'volume controls adjust outputs' then execute with something like (I installed the deamon to /opt which may or may not be following protocol).

./micropython /opt/squeezebox-ir-events-0.2/ /opt/squeezebox-ir-events-0.2/config.json MyPlayer.

Detected events will appear on the console - I only ever ran it as a command.

Result. While I did eventually get it all working, the result was a little underwhelming for me. Power on/off appeared to work fine but I was only really interested in the volume.

I tested using both the LMS Web GUI and iPeng on my phone. 
- It didnt like quick button presses as it sometimes got messed up 
- there were some inconsistencies in detecting events, possibly related to above.
- there was sometimes audio interference with the squeezelite player which made it sound awful. 
- There are interaction challenges with the VolumeLock plugin. The plugin gives you 3 options - 

1. Allow full range of volume control - it adjusts the volume on both the players output and you blast your amp as the same time via the script. Inconsistent in practice
2. Lock player at current volume - worked ok but it was limited as to how much you could increase & decrease the volume. I guess you could play around and get optimum levels of both player and amp but messy
3. Set current vol as max. - combination of the above

Out of curiosity, I did some quick tests using a Duet as the primary player. On the whole this appeared to work much better and I never had any audio issues - limited testing because this is not where I wanted the blasting.

No listening tests outside of the obvious were done.

After all that I am still deciding whether to persist or more likely revert. This adds complexity with stability questions for my use case, with debatable gains. If only you could fix the player output at 100% and still get volume controls as in IR-Blaster plugin.

There is a potential alternative to the ir-events-deamon - see  Much simpler to install. The question is whether it can detect volume events (looks like it might - mixer/volume ??) and how the volume adjustments are treated. You may end up in the same situation.

Think that I will also look more closely at replacing the caps in my old SB3.

I will update this thread if there are any advancements.

Hope that someone finds this useful.
[-] The following 1 user Likes davem's post:
  • agent_kith
(02-Nov-2020, 11:23 AM) davem Wrote: I will update this thread if there are any advancements.

Look for an IR Blaster with serial port input (You can probably use a USB to serial port dongle if your PC don't have serial port)... This works real well IME (but this is well over 10 years ago so YMMV).

Using the audio card is only going to be as good as the audio card itself, so you might consider getting a better quality one (or up the sample rate).. But these are just band aids to a problem, serial IR works best.

Edit: Serial will also require a new kernel as I'm pretty sure I disable COM ports. Let me know if you are going to use this and I'll hit you with a new kernel with serio support.
Snakeoil Operating System - Music, your way!
Thanks AK,

I will keep that in mind. Though I'm not certain that I saw anything telling me that there were hardware limitations - the issues were more related to detecting the events. It seemed to detect better with a hardware player (& no obvious audio issues), interestingly. The biggest nuisance was not being able to disable player volume changes so you ended up with 2 areas of volume adjustment or limited adjustment. Messy.
A little more testing and findings.

This refers to my setup, results my vary with different setups. My setup Snakeoil Squeezelite player > USB out > DAC > Amp.   

Overall if vol adjustments are not too fast and done one at a time, this worked fairly well. 

If the LockVolume LMS plugin setting was set to 'Lock player at current vol' (the most useful option) then there was audio interference on vol changes. Other settings of LockVolume had no interference. All settings on a SB Duet player had no interference on any setting.

It appears that the script does not detect all volume events. In the WebGUI, there is a volume slider with vol + and - buttons on the ends. All adjustments via the slider are detected but nothing for the buttons.

Possibly Related Threads…

Users browsing this thread: 1 Guest(s)