Bug 477935 - KDE - Intermittant Audio Notifications for Various apps
Summary: KDE - Intermittant Audio Notifications for Various apps
Status: RESOLVED NOT A BUG
Alias: None
Product: plasma-pa
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: 5.27.9
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-02 19:44 UTC by Ben
Modified: 2024-02-05 06:50 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Devs of Matrix Client Apps - what their claims are about audio notifications and kde (3.08 KB, text/plain)
2023-12-02 19:44 UTC, Ben
Details
Cinny - Audio notification (290 bytes, text/plain)
2023-12-02 19:46 UTC, Ben
Details
NeoChat - Devs comments about audio notifications & kde (3.08 KB, text/plain)
2023-12-02 19:46 UTC, Ben
Details
nheko devs - audio notifications (9.61 KB, text/plain)
2023-12-02 19:47 UTC, Ben
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben 2023-12-02 19:44:05 UTC
Created attachment 163775 [details]
Devs of Matrix Client Apps - what their claims are about audio notifications and kde

KDE - Intermittant Audio Notifications for Various apps




All the following tests took approxx 9 hours to compile

Apps such as Brave Browser Element Web that are set to give audio notifications from within their settings usually start to work
immediately after you have made the settings within the apps

The VISUAL NOTIFICATIONS always work 100% perfectly all the time-nonstop

However, it has ben noticed that after a while the AUDIO NOTIFICATIONS often get 'missed' or simply stop despite the VISUAL NOTIFICATION getting displayed


OBSERVATIONS:
-------------

If some media is played that has audio via a separate app, then the AUDIO NOTIFICATIONS immediately start up again along with the accompanying VISUAL NOTIFICATIONS
It's almost as if having something else that you know will play audio will effectively (at least temporarily) 'Fix/Restore' the audio notifications again

1. It's been observed that one only needs at least 1 second of audio to be produced via any app (ex: VLC Player)



 - ONLY THE LAST PART OF AN AUDIO NOTIFICATION GETS PLAYED/HEARD:
   --------------------------------------------------------------

2. It should be noted that occasionally one only hears what sounds like the last 'half' of a/the audio notification sound
   The audio notification sound is normally approxx 1 whole whole second, but sometimes you only hear the last half of this (about 1/2 a second)

3. This 'half' of a/the default audio notification has been observed to frequently happen very often when performing the Speaker Left/Right test in the audio settings,
   but i have only ever seen this playback of a half a second playback happen ONLY ever on the left speaker.
   It's quite easy to re-produce this, simply tap on each speaker back and forth at least 6 or 7 times, eventually the left speaker will end up playing the last half of
   the test sound.
   Then it will go back to normal again until you perform the above steps to re-produce the bug again

4. Even players such as VLC player often intermittantly also only only the last-part of a small duration audio file

5. This also happens when you play some notifications sounds within the file picker in the 'Configure Notifications window itself

Possibility: Maybe playback of the first x number of milliseconds of an audio file never gets to be played or is simply not heard ?
             Could this be a possible timing issue ?




THINGS TO NOTE - APPS:
----------------------

Brave Browser
Nheko matrix client
 - Dev of app claims that they are not prepared to utilise the KNotifications feature as it would make their app larger
   sais that they use the FreeDesktop.org Implementation and that KDE has not yet implemented that

Cinny matrix client

All have the same information about them displayed in:


KDE Plasma - Settings > Notifications > Application-specific settings

This application does not support configuring notifications on a per-event basis




AUDIO NOTIFICATION TEST 1:
--------------------------

I decided to install and run the KDE App NeoChat - the matrix client application because this is one client app which is specifically designed for KDE plasma
and as such i wanted to test try the Systems Bult-In Application specific Audio Notifications - something the above apps do not support

KDE Settings > Notifications > NeoChat > Configure Events...


Close to 4 Seconds

MediaInfo:
----------

General
Complete name                            : /usr/share/sounds/Oxygen-Im-Phone-Ring.ogg
Format                                   : Ogg
File size                                : 60.2 KiB
Duration                                 : 4 s 138 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 119 kb/s

Audio
ID                                       : 9740 (0x260C)
Format                                   : Vorbis
Format settings, Floor                   : 1
Duration                                 : 4 s 138 ms
Bit rate mode                            : Variable
Bit rate                                 : 160 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Compression mode                         : Lossy
Stream size                              : 80.8 KiB
Writing library                          : libVorbis 1.1 (2004-06-29)


RESULT: Most of this notification plays - subjectively by ear approxx 90% of the audio notification was heard - only the very beginning bit was not heard


After running NeoChat at the same time as Brave Browser Element Web amd having audio notifications set to ON for any/all posts in all rooms
I choose one of the preset audio files with the selection picker for NeoChat in KDE Settings > Notifications and set to play audio

When people posted in matrix rooms, i got:

Brave Browser Element Web VISUAL NOTIFICATIONS
Brave Browser Element Web AUDIO NOTIFICATIONS

NeoChat VISUAL NOTIFICATIONS
NeoChat AUDIO NOTIFICATIONS

Obviously i did not literally hear both the 2 different audio notifications from both apps at the same time (no audio mixing or anything)
I just got some of the VIDEO AND AUDIO notificatiosn from each app at slightly different times - sometimes one preceding the other

NeoChat Version:  23.08.3

NOTE: Interestingly - Unlike Brave Browser Element Web, NeoChat never shows up in the Taskbar Volume Applet under 'Applications' - not even while its playing an Audio Notification
      The NeoChat icon in the taskbar does not show any visual notification (like a volume icon for notification volume) when there is any audio notification




AUDIO NOTIFICAITON - TEST 2:
----------------------------


/usr/share/sounds/Oxygen-Window-Maximize.ogg

Close to half a second

MEDIA INFO:
-----------

General
Complete name                            : /usr/share/sounds/Oxygen-Window-Maximize.ogg
Format                                   : Ogg
File size                                : 7.79 KiB
Duration                                 : 509 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 125 kb/s

Audio
ID                                       : 12660 (0x3174)
Format                                   : Vorbis
Format settings, Floor                   : 1
Duration                                 : 509 ms
Bit rate mode                            : Variable
Bit rate                                 : 96.0 kb/s
Channel(s)                               : 1 channel
Sampling rate                            : 44.1 kHz
Compression mode                         : Lossy
Stream size                              : 5.96 KiB (77%)
Writing library                          : libVorbis 1.1 (2004-06-29)

Im showing the used notification audio file MediaInfo for others to consider - specifically the audio file duration

I only ever heard this audio notification 1 time by NeoChat
Subsequent Notifications did not play any audio at all - or at least none were heard
I conclude that the play length/duration of this audio file is related to the audio notification not being able to play being related to the
above "ONLY THE LAST PART OF AN AUDIO NOTIFICATION GETS PLAYED/HEARD" issue ?



KDE INFO:

Operating System: openSUSE Tumbleweed 20231127
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11
Kernel Version: 6.6.2-1-default (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-3570K CPU @ 3.40GHz
Memory: 11.6 GiB of RAM
Graphics Processor: AMD Radeon RX 6600

Tests performed under KDE Plasma Wayland

ALL AUDIO IS GOING OUT THROUGH MY PCI-E AMD Radeon RX 6600 Video Card DisplayPort to my 32" Monitor

NOTE: I was not sure of the correct category to put this under - e.g.:

Product: plasma-pa
Component: kcm

Product: systemsettings
Component: kcm_pulseaudio

Product: plasma-pa
Component: general


Attachments are of convo's i had with the app Devs
I have no opinion at all about what they said - Im only "sharing" what they said here
Clarification would be appreciated as to the accuracy of what they say


RELATED BUGS:

Fix audio notification sound mute
https://bugs.kde.org/show_bug.cgi?id=456390

Notification sound plays on Plasma session started with a new user account despite its volume level is set to 0% in plasma-pa settings
https://bugs.kde.org/show_bug.cgi?id=425974

Audio notification sounds level initial default is 0%
https://bugs.kde.org/show_bug.cgi?id=466190

Impossible to adjust the volume level of the notification sounds
https://bugs.kde.org/show_bug.cgi?id=407397

Button to mute/unmute notification sounds does not work as expected until "Notification sounds" slider is clicked
https://bugs.kde.org/show_bug.cgi?id=398392
Comment 1 Ben 2023-12-02 19:46:15 UTC
Created attachment 163776 [details]
Cinny - Audio notification
Comment 2 Ben 2023-12-02 19:46:53 UTC
Created attachment 163777 [details]
NeoChat - Devs comments about audio notifications & kde
Comment 3 Ben 2023-12-02 19:47:42 UTC
Created attachment 163778 [details]
nheko devs - audio notifications
Comment 4 Ben 2023-12-02 21:15:08 UTC
Tests indicate the same problems with audio notifications  exist under plasma x11

Tested with NeoChat

Operating System: openSUSE Tumbleweed 20231129
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11
Kernel Version: 6.6.2-1-default (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-3570K CPU @ 3.40GHz
Memory: 11.6 GiB of RAM
Graphics Processor: AMD Radeon RX 6600
Comment 5 Harald Sitter 2024-01-22 09:20:33 UTC
Does the sound work if you run:

`CANBERRA_DRIVER=pulse canberra-gtk-play  --file /usr/share/sounds/Oxygen-Window-Maximize.ogg`

perhaps also try this for good measure: 

`CANBERRA_DRIVER=alsa canberra-gtk-play  --file /usr/share/sounds/Oxygen-Window-Maximize.ogg`
Comment 6 Ben 2024-01-23 15:34:01 UTC
(In reply to Harald Sitter from comment #5)
> Does the sound work if you run:
> 
> `CANBERRA_DRIVER=pulse canberra-gtk-play  --file
> /usr/share/sounds/Oxygen-Window-Maximize.ogg`
> 
> perhaps also try this for good measure: 
> 
> `CANBERRA_DRIVER=alsa canberra-gtk-play  --file
> /usr/share/sounds/Oxygen-Window-Maximize.ogg`


For each line above, the very first time i ran them, i got no audio
The second time i ran each command, i did get audio
Comment 7 Ben 2024-01-23 15:39:31 UTC
KDE INFO:

Operating System: openSUSE Tumbleweed 20240121
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.114.0
Qt Version: 5.15.12
Kernel Version: 6.6.11-1-default (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-3570K CPU @ 3.40GHz
Memory: 11.6 GiB of RAM
Graphics Processor: AMD Radeon RX 6600
Comment 8 Harald Sitter 2024-01-24 10:10:30 UTC
(In reply to Ben from comment #6)
> (In reply to Harald Sitter from comment #5)
> > Does the sound work if you run:
> > 
> > `CANBERRA_DRIVER=pulse canberra-gtk-play  --file
> > /usr/share/sounds/Oxygen-Window-Maximize.ogg`
> > 
> > perhaps also try this for good measure: 
> > 
> > `CANBERRA_DRIVER=alsa canberra-gtk-play  --file
> > /usr/share/sounds/Oxygen-Window-Maximize.ogg`
> 
> 
> For each line above, the very first time i ran them, i got no audio
> The second time i ran each command, i did get audio

Sounds to me like your sound driver / speakers simply are sleeping and the audio cutoff you have is the delay for them to wake up.

Maybe give disabling power management a try:
https://www.audiosciencereview.com/forum/index.php?threads/how-to-disable-power-savings-in-linux.40511/
Comment 9 Harald Sitter 2024-02-02 11:22:09 UTC
Any news on this?
Comment 10 Ben 2024-02-03 06:53:08 UTC
(In reply to Harald Sitter from comment #9)
> Any news on this?


Firstly i think its important for me to say that as a general rule, i dont see why any distro (ubunto as such is so common to see on the internet)
as needing to ever create/edit any such system files as all if one is using a Desktop environment
OpenSUSE has YaST which is an extremely detailed and highly configurable options to do with the OS at both a hardware and a software level
thus obfuscating any need to use cli/terminal - except perhaps for bug testing when its deems that maybe the GUI options are not fully working as they should or for optional scripts



I dont know if this is a distro specific issue or not
I have compiled some info below for you to review here:


Audio Issues - How to disable power savings in Linux:




https://www.audiosciencereview.com/forum/index.php?threads/how-to-disable-power-savings-in-linux.40511/

As power-saving is quite often the root cause of distortions or malfunctions in sound here my collection of possibilities to disable power-savings.
All commands are for Ubuntu, you may have to change things according to your distribution.



Feel free to complete the possibilities...

1. Disable power saving in Pulseaudio

Edit /etc/pulse/default.pa and comment the following line:

NOTE: OpenSUSE Tumbleweed has no files called default.pa in /etc/pulse/




load-module module-suspend-on-idle by adding # in front

Result:

# load-module module-suspend-on-idle

Then restart the sound server.

"systemctl --user start pulseaudio.service pulseaudio.socket"



2. Disable power saving in Pipewire

copy alsa config script
"sudo cp -a /usr/share/wireplumber/main.lua.d/50-alsa-config.lua /etc/wireplumber/main.lua.d/50-alsa-config.lua"


OPENSUSE KONSOLE TERMINAL OUTPUT:

lyraness@IntelPC-OS1 /$ sudo cp -a /usr/share/wireplumber/main.lua.d/50-alsa-config.lua /etc/wireplumber/main.lua.d/50-alsa-config.lua
cp: cannot create regular file '/etc/wireplumber/main.lua.d/50-alsa-config.lua': No such file or directory
lyraness@IntelPC-OS1 /$



edit /etc/wireplumber/main.lua.d/50-alsa-config.lua

Line
--["session.suspend-timeout-seconds"] = 5, -- 0 disables suspend
gets
["session.suspend-timeout-seconds"] = 0, -- default is 5

restart wireplumber

"systemctl --user restart wireplumber"




EXTRA INFO AND Q & A


Distro: OpenSUSE Tumbleweed
DE: KDE PLASMA


KDE Application Launcher Search Engine: power management

Window: Advanced Power Settings
Under Title: Power Managaement

- Energy Saving
- Activity Power Settings
- Advanced Power Settings


Plasma Taskbar - on right-hand side in grouping sumbolised by a small white triangle 'Status and Notifications' - Power Management

0 reference to Audio



Yast - Administrator Settings

Sysconfig Editor:

- Hardware > Soundcard
             Soundcard > PulseAudio
Sound


YaST - Services Manager:

References to audio in there

examples: alsa-restorfe, also-state

power-profiles-daemon - Power Profiles Daemon
powertop - extend the battery life of laptop


Chat-GPT 3.5 Q & A:
-------------------


DragonMan

!q Does it matter what linux distro one is on if one has KDE Plasma for the purposes of always having any power savings related to audio turned off ?


ChatGPT.3.5-Turbo (Public)

For power savings related to audio, the Linux distribution itself doesn't have a direct impact. Power management settings and features are typically controlled by the desktop environment or power management tools that are bundled with the distribution. In the case of KDE Plasma, you can control power-saving settings through its system settings.

To access power management settings in KDE Plasma, you can follow these steps:

Click on the "K" menu icon at the bottom left corner.
Type "Power" in the search bar and select "Power Management."
In the Power Management settings, you will find options to configure various power-saving features.
You can adjust settings like screen brightness, suspend behavior, and other power-saving options according to your preferences. Keep in mind that some settings may require administrator privileges to modify.

Overall, regardless of the specific Linux distribution, as long as you have the KDE Plasma desktop environment installed, you should be able to access and configure power management settings accordingly.


DragonMan

Is there a guarantee that the KDE Plasma 'Power Settings' option also has full control of the audio when it comes to power savings ?


ChatGPT.3.5-Turbo (Public)

The KDE Plasma "Power Settings" option primarily focuses on power management features related to system resources, such as CPU usage, screen brightness, and sleep behavior. It may not have direct control over audio-related power savings.

However, you can still achieve power savings for audio by adjusting settings in other areas of your Linux distribution. For example, you can configure power management settings for individual hardware components like the sound card or audio devices. These settings are often found in the advanced options of your distribution's power management tools or sound settings.

Additionally, some Linux distributions provide separate power management utilities specifically for audio devices. These utilities allow you to fine-tune power-saving features for audio hardware.

To summarize, while the KDE Plasma "Power Settings" may not have dedicated audio power-saving options, you can explore other settings in your Linux distribution or consider additional power management utilities to optimize audio-related power consumption.



GAB A.I: Q & A:
---------------

ME:

Does it matter what linux distro one is on if one has KDE Plasma for the purposes of always having any power savings related to audio turned off ?


GAB A.I.:

Yes, it matters what Linux distribution you are using even if you have KDE Plasma. Different distributions have different configurations and settings for power management, and they may not be identical or have the same options available. To ensure that audio power savings are always turned off, you should check the specific settings for your chosen distribution and adjust them accordingly.


ME:

Can you state if there are any guarantees of exactly what the KDE Plasma's 'Power Management' option WILL provide ?


GAB A.I.:

The KDE Plasma's 'Power Management' option provides a set of tools and settings that allow you to manage and optimize your system's power consumption. While it can help improve battery life and reduce energy waste, there are no guarantees that it will provide an exact or specific amount of power savings. The actual results may vary depending on your hardware configuration, usage patterns, and other factors that influence power consumption.
Comment 11 Harald Sitter 2024-02-03 12:47:15 UTC
Did any of the commands fix the cut off notifications?
Comment 12 Ben 2024-02-05 01:49:13 UTC
(In reply to Harald Sitter from comment #11)
> Did any of the commands fix the cut off notifications?

Maybe my posts above were not clearly marked
The info you posted is for Ubuntu, not Opensuse Tumblweed
The files referenced were not found in the directorys on my OS
Thats why i asked both ChatGPT-3.5 and GabAI
Comment 13 Harald Sitter 2024-02-05 06:50:34 UTC
I would suggest taking this to a suse support forum. Since canberra-gtk-play also produces the same result there isn't a bug on the plasma-pa side for us to fix, it would seem.