IR Blasting - LMS on snakeoil
#1
As per https://www.snakeoil-os.net/forums/Threa...ctionality 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  https://github.com/mundschenk-at/squeeze...s/tag/v0.2 to handle the triggering side. See also https://forums.slimdevices.com/showthrea...box-events.

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 https://www.jaycar.com.au/single-ir-emit...4/p/AR1811 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:default@48000" seemed to work just fine as well.
- lirc has a list of remote definitions http://lirc-remotes.sourceforge.net/remotes-table.html - 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 https://github.com/micropython/micropyth...ng-Started. 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 https://github.com/micropython/micropython.git

then follow up with some makes..

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

'sudo chmod +x sb-ir-events.py' to make the script executable.

DONE.

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/sb-ir-events.py /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 https://www.nexus0.net/pub/sw/lmseventtrigger/  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
Reply

#2
(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!
Reply

#3
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.
Reply

#4
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.
Reply



Bookmarks

Possibly Related Threads…
Thread Author Replies Views Last Post
  OLED display for Snakeoil Raspberry Pi and MPD Bromf 8 4,522 13-Sep-2024, 01:12 PM
Last Post: vinaymoturi
  Snakeoil virtualized (PROXMOX), USB+PCI AUDIO passthrough, USB-DAC! lzyla 3 477 25-Jun-2024, 02:38 PM
Last Post: agent_kith
  I/R remote .Raspberry Pi, Snakeoil,MPD, and LIRC Bromf 4 4,068 19-Oct-2023, 10:06 PM
Last Post: vinaymoturi
  DACs And Motherboards Working With Snakeoil agent_kith 34 6,757,275 02-Jan-2022, 04:27 PM
Last Post: Bromf
  Get Mytec Stereo 192 working in Snakeoil agent_kith 1 4,835 08-Aug-2017, 08:25 PM
Last Post: agent_kith



Users browsing this thread:
1 Guest(s)

[-]
Our Sponsors

[-]
Welcome
You have to register before you can post on our site.

Username/Email:


Password:





[-]
Latest Threads
Announcing Snakeoil Measurements 1.3.0
Last Post: hkphantomgtr
Yesterday 09:55 PM
» Replies: 105
» Views: 11377
Howto setup resampling in Logitech Media...
Last Post: Coacharnold
18-Nov-2024 12:06 AM
» Replies: 7
» Views: 5898
Dropping Measurements, Hello High-End.
Last Post: agent_kith
26-Oct-2024 09:02 AM
» Replies: 12
» Views: 526
Very happy to have Sankeoil......! mpd w...
Last Post: run51
24-Oct-2024 05:35 AM
» Replies: 9
» Views: 1738
SO no soundcard detected - RPI Pi4 snake...
Last Post: run51
21-Oct-2024 10:55 PM
» Replies: 4
» Views: 141
download
Last Post: Snoopy8
19-Oct-2024 05:52 AM
» Replies: 1
» Views: 139
Full proces to instal snakeiol 100% work...
Last Post: audioluthier
11-Oct-2024 02:32 AM
» Replies: 9
» Views: 413
A network protocol designed for CAS
Last Post: hkphantomgtr
10-Oct-2024 09:48 PM
» Replies: 0
» Views: 102
CAS with "Single Core"
Last Post: hkphantomgtr
06-Oct-2024 08:32 AM
» Replies: 2
» Views: 143
MPD player not working
Last Post: Snoopy8
27-Sep-2024 11:54 AM
» Replies: 7
» Views: 276

[-]
SnakeoilOS Mission Statement

Our mission is to create a free to use computer OS that is easy to install, intuitive to operate and play music that will connect and engage with you emotionally.

SnakeoilOS gives you the freedom to spend more time on listening, enjoying and exploring music. Wasting time on computers is now a thing of the past! Everything is constantly evolving/improving. Please check back often for updates.

If you like this project, do show your support with a small token donation. All donations collected will be used to run this website, and for purchasing new equipment for the project.


Powered By MyBB, © 2002-2024. Theme © Melroy van den Berg.