GNOME Bugzilla – Bug 528812
Logout sound not playing at all
Last modified: 2020-10-30 14:32:25 UTC
Hey, I'm running Fedora 9 rawhide with the latest patches and nearly all sound things of gnome work even login! The only one that isn't working is the logout sound while it's defined and working when i click the play button next to it (in the gnome sound settings panel). I've had it before (older gnome versions) that the logout sound was only played partly or ended abruptly but in this gnome version it simply doesn't play at all. Thanx, Mark
Hi Mark, which version of gnome-session are you using?
*** Bug 530257 has been marked as a duplicate of this bug. ***
I'm using the latest stable version. The ones that are installed by default on Fedora and Ubuntu.
I can verify that this bug is also happening on Solaris, using GNOME 2.24. All sounds seem to work okay, but not logout sounds.
I can confirm this bug on GNOME 2.26 on Ubuntu Jaunty (updating bug fields to match). The expected way to play it appears to be via the /usr/share/gnome/shutdown/libcanberra-logout-sound.sh file installed by libcanberra. It corresponds to the /usr/share/gnome/autostart/libcanberra-login-sound.desktop file that plays the login sound. While gnome-session looks in /usr/share/gnome/autostart/ and runs the scripts there, it doesn't seem to know about /usr/share/gnome/shutdown/. Is this a directory that libcanberra just made up? Would a patch that ran scripts in that directory before shutting down be accepted?
On second thought, maybe running all scripts in that directory is not the best approach. canberra is installing a .sh file, not a .desktop file, and I suspect if we implemented support for this, we'd want to use .desktop files. And since this is the only case of something wanting to be done on shutdown, perhaps gnome-session should just call ca_context_play and directly play the sound on shutdown.
(In reply to comment #5) > The expected way to play it appears to be via the > /usr/share/gnome/shutdown/libcanberra-logout-sound.sh file installed by > libcanberra. It corresponds to the > /usr/share/gnome/autostart/libcanberra-login-sound.desktop file that plays the > login sound. > > While gnome-session looks in /usr/share/gnome/autostart/ and runs the scripts > there, it doesn't seem to know about /usr/share/gnome/shutdown/. Is this a > directory that libcanberra just made up? libcanberra didn't just make that up. It's definitely supposed to work. It's possible that the code in gnome-session just never got written... :) (In reply to comment #6) > On second thought, maybe running all scripts in that directory is not the best > approach. canberra is installing a .sh file, not a .desktop file, and I > suspect if we implemented support for this, we'd want to use .desktop files. There are good reasons for using .desktop files for startup that don't really apply as much to shutdown. (At shutdown you're generally not really launching applications, you're just doing cleanup) Also, KDE does it this way (directory full of scripts, not .desktop files), so this moves us a little closer towards session compatibility with them. > And since this is the only case of something wanting to be done on shutdown, > perhaps gnome-session should just call ca_context_play and directly play the > sound on shutdown. The official theory is that gnome-session does not take any interest in the specifics of what happens in the session, so having it be an external script is correct. (Note that gnome-session doesn't currently depend on libcanberra.)
Created attachment 135759 [details] [review] Proposed patch Here's a possible patch to run all scripts found in the shutdown directory. It plays a logout sound for me. There are two open questions with it: 1) Did I put the hook in the right place (end_phase for GSM_MANAGER_PHASE_EXIT)? 2) I used spawn_sync, thinking that it would be bad if gnome-session exited in the middle of a shutdown script. I assume that's correct, even if it means we are vulnerable to slow scripts? Should I add timeout logic?
(In reply to comment #8) > Created an attachment (id=135759) [edit] > Proposed patch > > Here's a possible patch to run all scripts found in the shutdown directory. It > plays a logout sound for me. > > There are two open questions with it: > 1) Did I put the hook in the right place (end_phase for > GSM_MANAGER_PHASE_EXIT)? That looks okay, but I'd probably move it inside gsm_manager_quit(). Hrm, see below, though. > 2) I used spawn_sync, thinking that it would be bad if gnome-session exited in > the middle of a shutdown script. I assume that's correct, even if it means we > are vulnerable to slow scripts? Should I add timeout logic? Yeah. I think we'd need some timeout here. We already have some stuff that deals with timeout in phases. It might be worth adding a new phase just for this and use the current infrastructure. In that case, I imagine we would move the stuff that stops client in the EXIT phase to a new phase that is just before, and run the scripts instead in EXIT.
Just FYI, I don't have time now to clean this patch up myself. I can come back to it later, or some other enterprising soul can fix it up.
Hmm, when we finally get this it would be good if the shutdown path was overridable at runtime via 'gnome-session --shutdown', similar to the way we already have 'gnome-session --autostart'. This can then be used by gdm in much the same way as --autostart to make sure the gdm login X11 display is cleaned up properly before we hand it over to the user.
This is nice to have. Is there a freedesktop spec for this part of the implementation? If the directory is /usr/share/gnome/shutdown, one tends to interprete that a shutdown rather than logout. However, the libcanberra sound here is for lgout rather than shutdown. Therefore, should the directory not be /usr/share/gnome/logout? Of course the 'shutdown' directory can be reserved for actual shutdown.
(In reply to comment #12) > This is nice to have. Is there a freedesktop spec for this part of the > implementation? If the directory is /usr/share/gnome/shutdown, one tends to > interprete that a shutdown rather than logout. However, the libcanberra sound > here is for lgout rather than shutdown. Therefore, should the directory not be > /usr/share/gnome/logout? Of course the 'shutdown' directory can be reserved for > actual shutdown. There's no freedesktop spec, but KDE uses $KDEDIR/shutdown/ (eg, /usr/share/kde/4.0/shutdown/), so I'd copied that.
What's happening with this patch? There was talk of 'cleaning the patch up', but there hasn't been a resubmission.
I'd be happy to clean it up. In what way does it need to be cleaned up? What is it calling or doing that needs to be cleaned? (Sorry, I'm not a gnome developer. Just a part time coder. I don't have the entire gnome spec in front of me. Where is the entire gnome spec?)
Apologies. I see that it needs to "adding a new phase just for this and use the current infrastructure." and "move the stuff that stops client in the EXIT phase to a new phase that is just before, and run the scripts instead in EXIT." But, where do I get all the specs and such for the infrastructure and the phases?
Assuming that this problem is obsolete nowadays. If you can still reproduce this problem with a recent version (currently: 3.38) of GNOME / gnome-session, then please report this at https://gitlab.gnome.org/GNOME/gdm/-/issues/ and follow https://wiki.gnome.org/Community/GettingInTouch/BugReportingGuidelines - thanks a lot!