Il 28/12/2023 23:17, Valerio Vanni ha scritto:
I found that pm-suspend works because it unloads and reloades that module
In "/etc/pm/config.d/modules" there is
---
SUSPEND_MODULES="cx23885"
---
Now I've replicated this on systemd side with this script similar to yours:
/usr/lib/systemd/system-sleep/dvb-suspend.sh
---
#!/bin/bash
[ "$1" = "post" ] && exec /usr/sbin/modprobe cx23885
[ "$1" = "pre" ] && exec /usr/sbin/rmmod cx23885
exit 0
Now I've made a little change:
----
#!/bin/bash
[ "$1" = "post" ] && exec /usr/sbin/modprobe cx23885
[ "$1" = "pre" ] && exec /usr/sbin/tv-sleep
exit 0
----
and tv-sleep does:
----
#!/bin/bash
/usr/bin/killall kaffeine
sleep 2
/usr/sbin/rmmod cx23885
----
This way, I don't have to remember to close kaffeine before suspend.
At this point, there's a couple of improvements from pm-suspend method.
One is this, the other is that pm-suspend required sudo.