1

Using Rhythmbox for music through the speakers on my monitor.

Problem is when the screen turns off (for reason of inactivity as set in System Settings > Brightness and Lock > [turn screen off when inactive for:]) the sound goes with it.

Is there a discrete setting somewhere which defeats this and leaves the sound intact but still turns the screen off?

graham
  • 10,436
  • Your computer probably is going to sleep mode. You should indeed set it to blank the screen, but not go into sleep mode. Look in the Power settings to disable automatic suspend. I cannot check the interface of your version to provide specific details, unfortunatelly. – vanadium Sep 09 '18 at 10:52
  • 1
    @vanadium I don't see an option to disable automatic suspend in power settings to just blank the screen in 16.04 – graham Sep 09 '18 at 11:37
  • 1
    Again, I cannot specifically look myself as I am on 18.04. This is using Gnome Shell rather than Unity, and the settings have strongly changed. In Settings - Power, I have an option "Automatic suspend", where whether it autosuspends and the timeout can be set when on battery and when on power. – vanadium Sep 09 '18 at 11:40

1 Answers1

0

More than 4 years since the question was asked, but still my very specific solution can be useful. I never was able to find any quick fix for this.

I had the exact same problem. Years ago I solved it using a script to move the mouse once sound was detected. That stopped working since the tool I used (xdtool) would not work anymore with gnome terminals running wayland. There is a lot of information out there regarding this (for example, here), and if you can run around this issue, it is the best solution IMO.

My current solution is to run a simple script (code bellow). The solution is divided in three parts:

  1. Detect sound. Got the solution here;
  2. Alter screen/power settings. Got the solution here;
  3. If needed, fine tune step above regarding file permissions. Got the solution here.

If the script bellow does not work with steps 1 and 2 only, then you probably need step 3.

Steps 1 and 2 are reproduced (with a few more similar settings) in the following script:

while [ 0 ]; do
cat /proc/asound/card0/pcm3p/sub0/status | grep -qi running  && (echo "Sound playing..."; gsettings set org.gnome.settings-daemon.plugins.power idle-dim false; gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'; gsettings set org.gnome.desktop.screensaver lock-delay 10000;gsettings set org.gnome.desktop.session idle-delay 0 )
sleep 55
cat /proc/asound/card0/pcm3p/sub0/status | grep -qi closed  &&  (echo "Silence..."; gsettings reset org.gnome.settings-daemon.plugins.power idle-dim; gsettings reset org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type; gsettings set org.gnome.desktop.screensaver lock-delay 180; gsettings set org.gnome.desktop.session idle-delay 120)

done

You can execute it from any terminal. The idea is to change power saving and screen settings if music is being played, and alter it back to normal otherwise. There are a arbitrary values being set that can be changed. Details can be found in the links provided. Hope it works for anyone else but me!