Following the cited thread, I implemented the following:
#!/bin/sh #---------------------------------------------------------------------------------------- # Script for turning RPi4 USB output on/off when Squeezelite player is turned on/off. # This script requires that extension uhubctl.tcz is installed. # Enter the path to this "Power On/Off Script" on the pCP Squeezelite Settings page. # https://github.com/mvp/uhubctl#raspberry-pi-4b #---------------------------------------------------------------------------------------- # squeezelite -S /home/tc/usb-power-on-off.sh # # squeezelite sets $1 to: # 0: off # 1: on # 2: initialising #---------------------------------------------------------------------------------------- # Version: 0.1 2020-08-16 SK case $1 in 0) uhubctl -l 2 -a 0 >/dev/null 2>&1 ;; 1) uhubctl -l 2 -a 1 >/dev/null 2>&1 ;; 2) uhubctl -l 2 -a 1 >/dev/null 2>&1 ;; esac also put it in the folder /home/tc and linked it in the pCP Squeezelite Settings page under "Power On/Off Script". Here is what it does for me: "Play" powers up my speakers and plays music. "Pause" pauses the music and leads to my speakers being shut down. "Power on/off" the player in LMS does not reliably lead to my speakers being power on/off. Using the "uhubctl -l 2 -a 0 >/dev/null 2>&1" "/ uhubctl -l 2 -a 1 >/dev/null 2>&1" command loged in my piCorePlayer via SSH always works as expected. - I am fine with "Play/Pause" causing my speakers to turn on/off but I expected this solution to work with "Power on/off" in LMS. - 2: initialising: do I really need that line in my script or can I leave it out? ------------------------------------------------------------------------ sisiko's Profile: http://forums.slimdevices.com/member.php?userid=70536 View this thread: http://forums.slimdevices.com/showthread.php?t=112760 _______________________________________________ unix mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/unix
