Bug 482045

Summary: Custom notification sounds do not work
Product: [Plasma] plasmashell Reporter: Kevin R <bassistguy>
Component: NotificationsAssignee: Plasma Bugs List <plasma-bugs>
Status: CONFIRMED ---    
Severity: normal CC: cardinalidiego, guimarcalsilva, kde, leonplayyt, nate, nathan, nicolas.fella, null
Priority: NOR Keywords: qt6
Version: 6.0.0   
Target Milestone: 1.0   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Kevin R 2024-02-29 15:18:50 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Got to Settings > Notifications > Plasma Workspace
2. Most but not all default sound previews work
3. If changing to a different (custom) sound, none of the sound previews work
4. Regardless if using default sounds or custom sounds, notifications don't produce a sound (e.g. Login, Logout, Device Plugged In, and so on)
5. All other sounds work (e.g. playing music from a media app)
6. The only "event" sound that works is the popping sound when changing the volume level
7. I have tried WAV and OGG files

OBSERVED RESULT
Notifications do not produce a sound, regardless if using the default sound or if changing to a custom sound

EXPECTED RESULT
Notifications such as Login, Logout, Device Plugged In should produce a sound if I have a sound assigned.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon 6
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
Comment 1 guimarcalsilva 2024-02-29 23:30:56 UTC
Can you check if they work if you install the package 'ocean-sound-theme'?

sudo apt install ocean-sound-theme
Comment 2 Nate Graham 2024-03-01 07:00:33 UTC
Yeah. Also which theme's previews are you clicking on?
Comment 3 Kevin R 2024-03-01 14:23:32 UTC
(In reply to guimarcalsilva from comment #1)
> Can you check if they work if you install the package 'ocean-sound-theme'?
> 
> sudo apt install ocean-sound-theme

Installing ocean-sound-theme allowed the notification sounds to work, however, they only work under Colors & Themes > System Sounds. Any sounds specified under Settings > Notifications > Plasma Workspace still do not work. I still can only preview thjose default sounds. It seems like the new "System Sounds" theme is overriding the Notifications / Plasma Workspace sound notifications.
Comment 4 guimarcalsilva 2024-03-02 15:49:57 UTC
(In reply to Kevin R from comment #3)
> (In reply to guimarcalsilva from comment #1)
> > Can you check if they work if you install the package 'ocean-sound-theme'?
> > 
> > sudo apt install ocean-sound-theme
> 
> Installing ocean-sound-theme allowed the notification sounds to work,
> however, they only work under Colors & Themes > System Sounds. Any sounds
> specified under Settings > Notifications > Plasma Workspace still do not
> work. I still can only preview thjose default sounds. It seems like the new
> "System Sounds" theme is overriding the Notifications / Plasma Workspace
> sound notifications.

The lack of the ocean theme on Neon was fixed in 481948

I can indeed reproduce the issue on Settings > Notifications > Plasma Workspace though. Custom sounds do not play at all, neither in the notifications nor in the previews
Comment 5 nathan 2024-03-07 15:22:31 UTC Comment hidden (spam)
Comment 6 Kevin R 2024-03-08 15:42:08 UTC Comment hidden (spam)
Comment 7 Kevin R 2024-03-08 15:51:07 UTC
So, it looks like the way Plasma 6 handles sound notifications now, as opposed to previous versions of Plasma, is the sound notifications (Settings > Notifications > Plasma Workspace) are managed by sound "references" as opposed to a direct sound file. So, for example, the default Ocean Catastrophe sound references "dialog-error-serious". I assume there is a file somewhere that references this to the actual sound file itself. I did a context search for dialog-error-serious (as an example) and I was unable to find anything. So, as I mentioned earlier, it looks like the new System Sounds themes manages / overrides the traditional custom notification sounds.

So, this is definitely something that needs to be fixed if custom sound notifications are still going to be an option going forward.
Comment 8 Kevin R 2024-03-08 16:59:58 UTC
(In reply to Kevin R from comment #7)
> So, it looks like the way Plasma 6 handles sound notifications now, as
> opposed to previous versions of Plasma, is the sound notifications (Settings
> > Notifications > Plasma Workspace) are managed by sound "references" as
> opposed to a direct sound file. So, for example, the default Ocean
> Catastrophe sound references "dialog-error-serious". I assume there is a
> file somewhere that references this to the actual sound file itself. I did a
> context search for dialog-error-serious (as an example) and I was unable to
> find anything. So, as I mentioned earlier, it looks like the new System
> Sounds themes manages / overrides the traditional custom notification sounds.
> 
> So, this is definitely something that needs to be fixed if custom sound
> notifications are still going to be an option going forward.

I forgot to mention, no matter what Sound Theme event you choose (e.g. Ocean, Oxygen, FreeDesktop), Settings > Notifications > Plasma Workspace always references the same name (e.g. dialog-error-serious). So this backs up what I mentioned earlier. A data file somewhere is what changes the sound file reference itself.
Comment 9 Nate Graham 2024-03-08 20:28:27 UTC Comment hidden (spam)
Comment 10 Kevin R 2024-03-08 21:50:11 UTC
I found the following file that points all sound themes to their respective sound files:

/usr/share/knotifications6/plasma_workspace.notifyrc

Long story short, Settings > Notifications > <whatever you choose within the list (e.g. Plasma Workspace)> will always need to point to their default sound event name. For example:

Login will always need to point to 'desktop-login'
Logout will always need to point to 'desktop-logout'

These are all defined within the above file 'plasma_workspace.notifyrc', which then directly correlates with the respective theme file that is currently chosen. For example, /usr/share/sounds/ocean/index.theme.

The only way I was able to have my own "custom" sounds was to pretty much create my own theme. However, what I did to test this out beforehand was to copy a couple of my sound files over to an existing theme sound folder (/usr/share/sounds/ocean/stereo), in this case a login and a logout sound file (they also need to be OGA files). I then did the following to rename the files:

sudo mv desktop-login.oga OLD-desktop-login.oga
sudo mv desktop-logout.oga OLD-desktop-logout.oga

sudo mv my_login_sound_file.oga desktop-login.oga
sudo mv my_logout_sound_file.oga desktop-logout.oga

This essentially replaced the original files with my "custom" files. I tested this out and was able to hear my custom logout sound (login still doesn't work, but I believe that is a whole different issue).

So, very long story short, your custom sounds need to be named the exact names that exist within the theme sound folder.

That being said, I really hope this isn't what the KDE team intended to happen, relying only on the sound theme feature. It was a pretty long process renaming all of the sound files I wanted to use. I hope a feature is added to once again allow us to use Settings > Notifications like we have always used it in the past,
Comment 11 Nicolas Fella 2024-03-08 21:54:01 UTC
/usr/share/knotifications6/plasma_workspace.notifyrc contains the system-wide default values for notification settings. Any changes in the KCM should create a local override of that file.

Using custom files is certainly supposed to work
Comment 12 Unamelable 2024-05-26 10:36:21 UTC
I have same problem. It just doesn't seems to play anything than system one.
Comment 13 Unknown 2024-07-18 22:07:58 UTC
Confirming the same problem in lieu of being able to vote on this bug.