Il 11/01/2024 04:48, Max Nikulin ha scritto:

So your idea would be stopping and starting channel play by dbus messages? I'm looking again with introspect, and I don't see anything like "stop" in kaffeine.

It is independent ideas:
- Do not deal with user processes in system context (like /usr/lib/systemd/system-sleep/ scripts)
- Try to release dvb tuner device, so module can be unloaded.

I believe, it is a bug in the cx23885 module that it can not handle suspend/resume (and probably hibernate/thaw).

I agree.
If cx23885 module could handle suspend/resume, we wouldn't need all this mess.

Since we are talking about this module, I quote from another of your messages:

P.S. You have explicit modprobe cx23885. Does it mean that this module is not 
autoloaded when udev discovers the device?

The module is autoloaded when system boots.
But if I (after having moved away the script from /usr/lib/systemd/system-sleep/)

rmmod
systemctl-suspend
resume pc

the module is not loaded.

When I used pm-suspend, remove and reload was managed from the line
SUSPEND_MODULES="cx23885" in /etc/pm/config.d/modules

And now from rmmod and modprobe in my script.
By itself... no load.

The following is related to avoiding "setpriv" in system context and listening for D-Bus events in user session scope:

$ dbus-monitor --system "type='signal',interface='org.freedesktop.login1.Manager',member='PrepareForSleep'"

suspend:

signal time=1704679441.870349 sender=:1.6 -> destination=(null destination) serial=3187 path=/org/freedesktop/login1; interface=org.freedesktop.login1.Manager; member=PrepareForSleep----------------------------------------------------^^^^^^^^^^^^^^^
    boolean true

resume:

signal time=1704679448.065409 sender=:1.6 -> destination=(null destination) serial=3233 path=/org/freedesktop/login1; interface=org.freedesktop.login1.Manager; member=PrepareForSleep
    boolean false
---------------^^^^^

A tiny python script may be more convenient than dbus-monitor and similar tools.

Killing and starting kaffeine in response to these signals may be a workaround if the application does not allow to release the device.

Not stopping playback and not releasing the device in response to the PrepareForSleep signal, from my point of view, is a bug in kaffeine. I have no idea if vlc (broken hardware acceleration in bookworm) or another application may be an alternative for you.

To watch television, kaffeine seems very good to me.

Reply via email to