Plexamp headless with display and on/off touch button

Hello, thanks to this forum I managed to finally get my Plexamp headless working nicely and I am now able to cancel my subscription to alternatives.
I am using a raspberrypi 4 with the official touch screen and an external usb DAC. RaspbianOS full version is running on it with Plexamp beta5. Plexamp starts automatically and a browser opens the webgui on startup too. I am practically heaving now a “now playing screen” and can control it with any mobile device.

I am now missing a simple icon on the touch screen that lets me turn off the backlight of the screen once I am done using it. Ideally it would turn on if I start a playback or I touch it again.

Has anybody an idea how this could be done? I know that other headless player systems with a display can do it but I don’t find anything in other forums how to do it myself. Only a hardware button solution I could find but do not want to implement that right away and think a software solution would be more elegant.

Any hint would be appreciated.

Stefan

You are asking for a screen saver/screen blanking functionality, can that not be set up in RaspianOS?

Amusingly enough, I have the opposite problem… I left “screen blanking” on in the pi settings in raspbian and now my screen goes black after 10 mins or so. To get it to show progress and all that I have to touch the screen to get it to come back. @NEO_Dan is probably right about where to look for screen settings. This front-end implementation of PlexAmp in the browser likely doesn’t hook the OS screen control that way.

thanks for your reply. I have tried to setup blanking functionality in the OS but then I cannot control it and end up same as Urfish. 10 min and then I have to touch the display. I didn’t like that. I also tried to find out if there is something like in the mac “hot corners” but no luck…

Anyhow, meanwhile I think Urfish is right that Plexamp might not implement what I want in near future or ever. So I have managed to do the following:

I Turned off OS screen blanking and wrote a script that checks if sound iOS playing. If yes then it turns the screen on if not then it turns it off. I am somehow happy with this but it is not so nice. Next I will try to add to the script a function that detects input on the touch screen so it also turns the display on again.

If someone is interested I am posting here what I have done. I am sure there is a better way to write this script but as I have no experience in that it looks like this…

I created in .config a autostart file to start chromium at startup in full screen and turn off screen blanking and open Plexamp webui

~/.config/lxsession/LXDE-pi/autostart

It looks like this:

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
@xset s off
@xset -dpms
@xset s noblank
point-rpi
@chromium-browser --start-fullscreen --start-maximized http://plexamp-ip:32500

I wrote the following script (output-monitor1.sh):

#!/bin/sh

#monitor sound device files for change
sudo inotifywait -e open -e close -m /dev/snd/pcmC* |while read file event
do

# see if anything is running, turn on screen, turn off screen if not
if tail -q /proc/asound/card*/pcm0p/sub0/status | grep RUNNING; then

#Turn the screen on
echo 0 | sudo tee /sys/class/backlight/*/bl_power

else

#Turn the screen off
echo 1 | sudo tee /sys/class/backlight/*/bl_power

fi

sleep 10

done

made it executable

sudo chmod +x output-monitor1.sh

and put it in crontab

@reboot /home/pi/monitor/output-monitor1.sh&

Happy to get help to make this script nicer…

I found the bits and peaces to achieve the above here and here and also here

1 Like

Thanks for researching deeper and coming up with a solution!

I’ve also been considering diving into this: Turn any website into a Linux desktop app with open source tools

In theory, I could just add a native wrapper to the localhost service and have it work full screen. Perhaps there are different rules built into app activity and screen blanking? Maybe this method might give us more control over the full screen display of the “now playing” bits?

I’ll dig into it over the weekend if nobody else has a similar solution already in the works.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.