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 7 3,608 11-Nov-2023, 07:55 AM
Last Post: agent_kith
  I/R remote .Raspberry Pi, Snakeoil,MPD, and LIRC Bromf 4 3,352 19-Oct-2023, 10:06 PM
Last Post: vinaymoturi
  DACs And Motherboards Working With Snakeoil agent_kith 34 1,623,727 02-Jan-2022, 04:27 PM
Last Post: Bromf
  Get Mytec Stereo 192 working in Snakeoil agent_kith 1 4,224 08-Aug-2017, 08:25 PM
Last Post: agent_kith
  Quick Start Guide to Install Snakeoil agent_kith 2 6,551 18-Dec-2016, 07:02 AM
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
ZimaBoard 2x NIC, 2x SATA, 2x USB, 1x PC...
Last Post: agent_kith
26-Mar-2024 12:04 PM
» Replies: 13
» Views: 612
LMS Upgrade ?
Last Post: uglymusic
15-Mar-2024 09:14 PM
» Replies: 7
» Views: 149
Squeezebox shutdown
Last Post: TripleX
13-Mar-2024 07:34 AM
» Replies: 4
» Views: 70
MP3 Not Playing
Last Post: Coacharnold
10-Mar-2024 10:25 AM
» Replies: 3
» Views: 52
Fail to install myMPD
Last Post: hkphantomgtr
03-Mar-2024 08:45 PM
» Replies: 9
» Views: 195
Intel HFI Driver Can "Save Tons Of CPU C...
Last Post: hkphantomgtr
28-Feb-2024 09:15 PM
» Replies: 0
» Views: 41
Announcing Snakeoil Measurements 1.3.0
Last Post: agent_kith
26-Feb-2024 10:02 PM
» Replies: 94
» Views: 4137
More Problems with Squeezelite in 1.3
Last Post: Coacharnold
17-Feb-2024 09:47 PM
» Replies: 2
» Views: 69
Snakeoil Music server & Snakeoil its own...
Last Post: Snoopy8
17-Feb-2024 11:20 AM
» Replies: 8
» Views: 365
RoonBridge (64 bit only)
Last Post: scrarfussi
15-Feb-2024 08:26 PM
» Replies: 3
» Views: 4125

[-]
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.