this post was submitted on 17 Aug 2023
5 points (100.0% liked)

Linux Questions

1149 readers
3 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 1 year ago
MODERATORS
 

I have a box running kodi in standalone mode with X11. My TV displays "no signal" if I leave it for too long, does anyone know how to stop this from happening?

I can still ssh into the box and use the remote app Kore so the system hasn't suspended or anything like that.

Pressing up/down etc on the kore remote, which should change what is displayed on screen, doesn't wake kodi up. However, I can wake it up if I tell Kodi to play a video.

all 13 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

Finally found a solution that works to disable power management! I added the following line to the service section of my systemd unit file:

ExecStartPost = /usr/bin/sh -c 'DISPLAY=:0 xset s off -dpms'

If I check with the command below I can see DPMS is off

DISPLAY=:0 xset -q

[–] [email protected] 2 points 1 year ago (1 children)

Edit /etc/X11/xorg.conf.d/10-monitor.conf and set dpms to false

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago) (2 children)

Thanks, I will try this and let you know if it works. The file didn't exist so I created it with the following contents because I saw online the option is supposed to go in the monitor section:

Section "Monitor" # Identifier "????" Option "dpms" "false" EndSection

I don't know what the identifier should be so I haven't set it.

---- edit

That didn't work for me, I got this error and kodi won't start

[ 4.485] Parse error on line 6 of section Monitor in file /etc/X11/xorg.conf.d/10-monitor.conf This section must have an Identifier line. [ 4.485] (EE) Problem parsing the config file [ 4.485] (EE) Error parsing the config file [ 4.485] (EE) Fatal server error: [ 4.485] (EE) no screens found(EE) [ 4.485] (EE) Please consult the The X.Org Foundation support at http://wiki.x.org for help. [ 4.485] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information. [ 4.485] (EE) [ 4.485] (EE) Server terminated with error (1). Closing log file.

I can't work out what that display should be called though

kodi@kodi:~$ sudo xrandr Can't open display

kodi@kodi:~$ sudo xdpyinfo | grep -A4 '^screen' >xdpyinfo: unable to open display "".

Any ideas?

[–] [email protected] 1 points 1 year ago (1 children)

I spent a few years looking for this solution. I will be able to check the exact config on that system tomorrow. If I forget to reply just send me a message.

The system has an intel onboard gpu, some low powered cpu with hdmi out. It's running Arch with Mesa drivers, hooked directly to TV.

[–] [email protected] 1 points 1 year ago

Thanks, I'm pretty sure I found a solution a few years ago but didn't write it down. Then the drive failed so I had to set everything up from scratch again!

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Apparently you can put whatever you like in the identifier field and it's not verified by X. So I changed to

Section "Monitor" Identifier "TV" Option "dpms" "false" EndSection

That got rid of the error but it still wasn't working.

Trying another method with xset:

kodi@kodi:~$ xset -dpms xset: unable to open display ""

I figured out I need to specify a display since I'm connecting with ssh:

DISPLAY=:0 xset -q

This shows me that dpms was still on even after rebooting with the /etc/xorg.conf.d/10-monitor.conf file in place.

Anyway I ran the following commands:

DISPLAY=:0 xset -dpms DISPLAY=:0 xset s off DISPLAY=:0 xset s noblank DISPLAY=:0 xset s noexpose DISPLAY=:0 xset s 0 0

The commands are explained here: https://wiki.archlinux.org/title/Display_Power_Management_Signaling

Now an xset query returns:

kodi@kodi:~$ DISPLAY=:0 xset -q Keyboard Control: auto repeat: on key click percent: 0 LED mask: 00000000 XKB indicators: 00: Caps Lock: off 01: Num Lock: off 02: Scroll Lock: off 03: Compose: off 04: Kana: off 05: Sleep: off 06: Suspend: off 07: Mute: off 08: Misc: off 09: Mail: off 10: Charging: off 11: Shift Lock: off 12: Group 2: off 13: Mouse Keys: off auto repeat delay: 660 repeat rate: 25 auto repeating keys: 00ffffffdffffbbf fadfffefffedffff 9fffffffffffffff fff7ffffffffffff bell percent: 50 bell pitch: 400 bell duration: 100 Pointer Control: acceleration: 2/1 threshold: 4 Screen Saver: prefer blanking: no allow exposures: no timeout: 0 cycle: 0 Colors: default colormap: 0x20 BlackPixel: 0x0 WhitePixel: 0xffffff Font Path: /usr/share/fonts/X11/misc,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins DPMS (Energy Star): Standby: 600 Suspend: 600 Off: 600 DPMS is Disabled

I also added the commands above to ~/.xinitrc so hopefully they will be run automatically every time

-- edit:

So, although those xset commands work I have to run them every time, the commands in .xinitrc clearly aren't being run.

I have a feeling this is because kodi is being started using xinit run from a systemd unit file so it isn't reading /kodi/home/.xinitrc.

So the plan is to set the home environment variable in the unit file (like below) and see if that works. Will test when the box is free.

Environment="HOME=/home/kodi"

[–] [email protected] 1 points 1 year ago (1 children)

What Linux distro and what desktop environment?

[–] [email protected] 1 points 1 year ago

Debian 12 No desktop environment, I'm running kodi in standalone mode via xinit (my systemd unit file is like the one below):

https://github.com/graysky2/kodi-standalone-service/blob/master/x86/init/kodi-x11.service

[–] [email protected] 1 points 1 year ago (1 children)

You can also simply turn dpms off in a startup script run when your user session starts. The command is

 xset -dpms
[–] [email protected] 1 points 1 year ago (1 children)

Thanks, in this case that wasn't suitable for me because it wasn't a full desktop environment, just Kodi in standalone mode. So there was no easy way to run the command like there would be on a desktop or laptop, I had to add it to my systemd unit file.

[–] [email protected] 1 points 1 year ago (1 children)

Sounds fine is there any benefit to running kodi in standalone mode vs fullscreen at startup in a simple wm?

[–] [email protected] 1 points 1 year ago

I think standalone mode is just the normal binary with some preset options enabled to allow better control of system/screen settings, auto mounting USB drives etc.