Skip to content

Conversation

@vjr
Copy link
Member

@vjr vjr commented Nov 28, 2024

No description provided.

@vjr vjr self-assigned this Nov 28, 2024
@vjr vjr requested a review from a team November 28, 2024 19:05
@vjr
Copy link
Member Author

vjr commented Nov 28, 2024

I guess 3863b34 means the deb-packaging branch needs to add Canberra in there too?

@vjr
Copy link
Member Author

vjr commented Dec 1, 2024

Can anyone look at this PR (or maybe even the codebase/config/meson/settings etc) and tell me what I'm missing here?

What happens is unless I also set PROP_APPLICATION_LANGUAGE or PROP_MEDIA_LANGUAGE to any value (valid locale, random string, blank too) there are some sounds that don't play. The play () method returns -9 aka FILE_NOT_FOUND error which is perplexing me.

It plays most other sounds from different sound themes if I specify them except for those it decides it doesn't want to. Interesting thing is, if I copy the dialog-question.oga file to a different name say polkit-question.oga then it works. I looked through the libcanberra source code from the noble apt source for it and couldn't see anything of interest there.

I've downloaded the KDE neon ocean sound theme on my OS8 installation from https://archive.neon.kde.org/user/pool/main/o/ocean-sound-theme/

Any ideas? Thanks!

@danirabbit
Copy link
Member

@vjr not sure if this solves your issues but we've been adding this canberragtk4 class in other projects: https://github.com/elementary/switchboard-plug-sound/blob/main/src/CanberraGtk4.vala

@vjr
Copy link
Member Author

vjr commented Dec 3, 2024

@vjr not sure if this solves your issues but we've been adding this canberragtk4 class in other projects: https://github.com/elementary/switchboard-plug-sound/blob/main/src/CanberraGtk4.vala

This commit seems to get the sounds to play -> 1bee580 - hope it's an acceptable work around.

@jeremypw
Copy link
Collaborator

jeremypw commented Feb 5, 2025

@vjr this does not seem to honor the sound settings ("org.gnome.desktop.sound")? I think it should (Files for example does - see SoundManager.vala). @danirabbit Is this OK UX-wise? Its not linked to an issue.

@vjr
Copy link
Member Author

vjr commented Feb 5, 2025

hi @jeremypw ! thanks for looking into this PR - are you saying i need to check if the event-sounds flag is true only then play the sound, just like Files does? i can update this PR for that - might be this weekend though.

@vjr
Copy link
Member Author

vjr commented Feb 6, 2025

@jeremypw does the latest commit 25f5412 address your comment to honour the event-sounds sound setting?

Copy link
Collaborator

@jeremypw jeremypw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks sane in principle but I could not get any sound when testing on a VM, although Files trash deletion, which uses similar code, does produce the expected sound. I tried a few things but so far no luck.

@vjr
Copy link
Member Author

vjr commented Feb 7, 2025

The code looks sane in principle but I could not get any sound when testing on a VM, although Files trash deletion, which uses similar code, does produce the expected sound. I tried a few things but so far no luck.

@jeremypw does your VM installation actually have a dialog-question (.ogg or oga or an audio extenstion) file in /usr/share/sounds/elementary/stereo or its fallback sound theme location /usr/share/sounds/freedesktop/stereo? IIRC I had copied the file from the KDE ocean sound theme to test this PR.

If the current OS packages do not include that file this PR simply wont play the sound (current/old behaviour) and when this file is included in the elementary sound theme package it will.

@vjr vjr requested a review from jeremypw February 7, 2025 04:39
@vjr
Copy link
Member Author

vjr commented Feb 7, 2025

dialog-question.oga.gz

@jeremypw i've attached the file in question for you to try, if you place it in /usr/share/sounds/elementary/stereo and try the PR again? thanks!

@jeremypw
Copy link
Collaborator

@vjr I tried that with no success I am afraid (I had already tried changing the code to use the same sound as Files which I knew worked. I have checked that event-sounds is enabled in the settings. Notifications send from Terminal play a sound OK. So its a bit of a puzzle.

@vjr
Copy link
Member Author

vjr commented Feb 11, 2025

@vjr I tried that with no success I am afraid (I had already tried changing the code to use the same sound as Files which I knew worked. I have checked that event-sounds is enabled in the settings. Notifications send from Terminal play a sound OK. So its a bit of a puzzle.

Yes, puzzling - see #85 (comment) and #85 (comment) - if you notice anything amiss?

@danirabbit danirabbit removed this from OS 8.0.1 Feb 26, 2025
@vjr
Copy link
Member Author

vjr commented Oct 5, 2025

Note to self, see elementary/notifications#264

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

4 participants