gabrielzschmitz / Tomato.C

A pomodoro timer written in pure C.
GNU General Public License v3.0
315 stars 19 forks source link

Notification doesn't sound and tomatonoise high cpu usage #53

Closed NischalDawadi closed 3 months ago

NischalDawadi commented 3 months ago

when the session starts or finishes it only shows the notification but sound is not heard.

Also tomato noise has excessively high cpu usage.. if i enable all sound it goes upto 50% cpu usage.

Distro:Fedora 40 WM : Hyprland Specs: Ryzen 5 4500u with 16gb ram

CarlosCraveiro commented 3 months ago

Since the problem is specifically related to audio notifications, perhaps it is something related to the MPV. It might be worth testing whether it's working properly.

Maybe try something like:

$ mpv <some_video_or_audio_file>

and see if the audio is outputting as it should.

CarlosCraveiro commented 3 months ago

In fact, the test can be done with tomato's own audio files, which in your distro I believe are in /usr/local/share/tomato/sounds.

Like:

$ mpv tomato/sounds/dfltnotify.mp3
NischalDawadi commented 3 months ago

there was no problem with mpv audio. it was because of resume playback.. How to disable it for this cause ...it is handy while watching series and movies.

CarlosCraveiro commented 3 months ago

Ahh, fair enough..., but did you manage to solve this part of the problem then?

CarlosCraveiro commented 3 months ago

As for excessive CPU usage, now that you mention it, I observed the same on my machine. I tried running some profiling tools like linux-perf to see exactly what could be causing this, but I couldn't identify anything conclusive. Screenshot-2024-05-19_11-24-11 In the screenshot you can see that the execution peaks of each tomatonoise processes go to around 50% CPU usage.

I currently tend to believe that this stems from the "pull-up loop" that exists within the tomatonoise to communicate with the tomato. If that's right (which I'm not sure), the solution would be to change how this is done, perhaps Unix Sockets could be and option to optimize the communication between processes...

But in this case, as I believe this is a problem with the way the code is structure (problem with the software architecture), an optimization regarding this would need to involve a discussion with more contributors.

gabrielzschmitz commented 3 months ago

I'm currently rewriting the app from the ground up, so the app performance should be ignored for now. But about the mpv error, did you manage to fix it?

NischalDawadi commented 3 months ago

I just disabled save on quit in mpv.