Bug 483824 - Timer does not play sound when finished
Summary: Timer does not play sound when finished
Status: RESOLVED FIXED
Alias: None
Product: KClock
Classification: Applications
Component: General (show other bugs)
Version: 24.02.0
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Devin Lin
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-17 11:57 UTC by Fabio
Modified: 2024-03-17 20:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 24.02.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio 2024-03-17 11:57:07 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.  set a timer
2.  wait for the timer to end


OBSERVED RESULT
system message, dialog window 

EXPECTED RESULT
system message, dialog window + sound

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

Kernel: 6.5.0-25-generic x86_64 bits: 64 compiler: N/A Desktop: MATE 1.26.0 info: mate-panel
    wm: marco 1.26.0 dm: LightDM 1.30.0 Distro: Linux Mint 21.3 Virginia base: Ubuntu 22.04 jammy

ADDITIONAL INFORMATION
In the last version it worked!
Comment 1 Titouan Camus 2024-03-17 14:10:58 UTC
I can reproduce.

Operating System: KDE neon 6.0
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.5.0-25-generic (64-bit)
Comment 2 Devin Lin 2024-03-17 15:53:50 UTC
If you go to the sound settings ("Audio" in the Settings app), under "Playback Streams", are "Notifications Sounds" muted? 

Currently the timer sound is attached to that, it probably makes sense to bypass that...
Comment 3 Titouan Camus 2024-03-17 15:56:36 UTC
(In reply to Devin Lin from comment #2)
> If you go to the sound settings ("Audio" in the Settings app), under
> "Playback Streams", are "Notifications Sounds" muted? 
> 
> Currently the timer sound is attached to that, it probably makes sense to
> bypass that...

Hello !

Notification sound is at 100% here
Comment 4 Devin Lin 2024-03-17 16:20:52 UTC
(In reply to Titouan Camus from comment #3)
> (In reply to Devin Lin from comment #2)
> > If you go to the sound settings ("Audio" in the Settings app), under
> > "Playback Streams", are "Notifications Sounds" muted? 
> > 
> > Currently the timer sound is attached to that, it probably makes sense to
> > bypass that...
> 
> Hello !
> 
> Notification sound is at 100% here

Just to check, do you have sounds from alarms? Is this in a Flatpak or a native package?
Comment 5 Titouan Camus 2024-03-17 16:28:54 UTC
(In reply to Devin Lin from comment #4)
> (In reply to Titouan Camus from comment #3)
> > (In reply to Devin Lin from comment #2)
> > > If you go to the sound settings ("Audio" in the Settings app), under
> > > "Playback Streams", are "Notifications Sounds" muted? 
> > > 
> > > Currently the timer sound is attached to that, it probably makes sense to
> > > bypass that...
> > 
> > Hello !
> > 
> > Notification sound is at 100% here
> 
> Just to check, do you have sounds from alarms? Is this in a Flatpak or a
> native package?

Alarm packages works just fine. I am with the native package.
Comment 6 Titouan Camus 2024-03-17 16:29:53 UTC
(In reply to Devin Lin from comment #4)
> (In reply to Titouan Camus from comment #3)
> > (In reply to Devin Lin from comment #2)
> > > If you go to the sound settings ("Audio" in the Settings app), under
> > > "Playback Streams", are "Notifications Sounds" muted? 
> > > 
> > > Currently the timer sound is attached to that, it probably makes sense to
> > > bypass that...
> > 
> > Hello !
> > 
> > Notification sound is at 100% here
> 
> Just to check, do you have sounds from alarms? Is this in a Flatpak or a
> native package?

Alarm works just fine. I am with the native package.
Comment 7 Devin Lin 2024-03-17 16:38:16 UTC
(In reply to Titouan Camus from comment #6)
> (In reply to Devin Lin from comment #4)
> > (In reply to Titouan Camus from comment #3)
> > > (In reply to Devin Lin from comment #2)
> > > > If you go to the sound settings ("Audio" in the Settings app), under
> > > > "Playback Streams", are "Notifications Sounds" muted? 
> > > > 
> > > > Currently the timer sound is attached to that, it probably makes sense to
> > > > bypass that...
> > > 
> > > Hello !
> > > 
> > > Notification sound is at 100% here
> > 
> > Just to check, do you have sounds from alarms? Is this in a Flatpak or a
> > native package?
> 
> Alarm works just fine. I am with the native package.

Okay, it likely is an issue related to the way sounds are played in timers, which goes through the notifications API (where there are many cases that the sound can get muted).

I've opened https://invent.kde.org/utilities/kclock/-/merge_requests/117 to switch timers to use the same method of sound playback as alarms.

You can test it by downloading the flatpak from here: https://invent.kde.org/utilities/kclock/-/jobs/1660937 (Download button under "Job artifacts" on the right side)

And then extracting, and installing it with "flatpak --user install kclock.flatpak"
Comment 8 Devin Lin 2024-03-17 16:40:35 UTC
Before running the flatpak, be sure to run "pkill kclockd" beforehand (so that it will use the kclock daemon from the flatpak).
Comment 9 Titouan Camus 2024-03-17 16:47:41 UTC
(In reply to Devin Lin from comment #8)
> Before running the flatpak, be sure to run "pkill kclockd" beforehand (so
> that it will use the kclock daemon from the flatpak).

Hmmm... It doesn't seems to work much better
Comment 10 Titouan Camus 2024-03-17 16:50:50 UTC
After reboot, the flatpack works :)
Comment 11 Devin Lin 2024-03-17 20:25:28 UTC
Git commit 8d4bb1283612942c29e86b2ee7d722a2a1a7a7c3 by Devin Lin.
Committed on 17/03/2024 at 16:21.
Pushed by devinlin into branch 'master'.

Port timer to play ringing sound through custom alarmplayer, rather than knotification

We should bypass restrictions on notification sounds (from playing through KNotifications), since the timer arguably should always sound.

This also gives us the ability to change timer sounds in the future.

M  +1    -2    kclockd.notifyrc
M  +3    -5    src/kclockd/alarmplayer.cpp
M  +1    -2    src/kclockd/alarmplayer.h
M  +29   -0    src/kclockd/timer.cpp
M  +1    -0    src/kclockd/timer.h

https://invent.kde.org/utilities/kclock/-/commit/8d4bb1283612942c29e86b2ee7d722a2a1a7a7c3
Comment 12 Devin Lin 2024-03-17 20:31:01 UTC
Git commit 412fbec6ac17076e922c4a7972f617834bd72e99 by Devin Lin.
Committed on 17/03/2024 at 20:30.
Pushed by devinlin into branch 'release/24.02'.

Port timer to play ringing sound through custom alarmplayer, rather than knotification

We should bypass restrictions on notification sounds (from playing through KNotifications), since the timer arguably should always sound.

This also gives us the ability to change timer sounds in the future.

M  +1    -2    kclockd.notifyrc
M  +3    -5    src/kclockd/alarmplayer.cpp
M  +1    -2    src/kclockd/alarmplayer.h
M  +29   -0    src/kclockd/timer.cpp
M  +1    -0    src/kclockd/timer.h

https://invent.kde.org/utilities/kclock/-/commit/412fbec6ac17076e922c4a7972f617834bd72e99
Comment 13 Devin Lin 2024-03-17 20:31:31 UTC
This will be in 24.02.1 (releasing Wednesday)
Comment 14 Titouan Camus 2024-03-17 20:44:12 UTC
(In reply to Devin Lin from comment #13)
> This will be in 24.02.1 (releasing Wednesday)

Great thanks a lot !