Zren / plasma-applet-eventcalendar

https://store.kde.org/p/998901/
469 stars 92 forks source link

No sound for timer #162

Open luigir-it opened 3 years ago

luigir-it commented 3 years ago

If I set a timer, no sound plays at the end. It doesn't work even with custom sounds.

Zren commented 3 years ago

Does the following command work?

python3 ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/scripts/notification.py --sound complete test test
luigir-it commented 3 years ago

I installed the package via aur so it says "no such file or directory" If I change the path to /usr/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/scripts/notification.py , the command does work and I hear the notification.

Zren commented 3 years ago

I did find a bug where toggling the timer sfx checkbox in the config from unchecked to checked does not actually apply. If you click the button in the panel popup it should enable it though. Is there any error (ignore onFoo warnings) in the plasmashell logs when a timer finishes?

journalctl -b0 _COMM=plasmashell -f
luigir-it commented 3 years ago

So, I enter the command on the terminal. Last error is at 23:53 (more than half hour ago). I then set the timer (10 seconds for convenience) and no new errors appeared.

Zren commented 3 years ago

Does a notification appear when the timer ends?

luigir-it commented 3 years ago

yes

Zren commented 3 years ago

If you enable debugging in the eventcalendar widget config window (bottom of the General tab), it should show this during a notification:

qml: [eventcalendar:debug] NotificationMananger.notify {
        "appName": "Timer",
        "appIcon": "chronometer",
        "summary": "Timer finished",
        "body": "0:03 has passed",
        "expireTimeout": 2000,
        "soundFile": "/usr/share/sounds/freedesktop/stereo/complete.oga",
        "actions": []
}

or

qml: [eventcalendar:debug] NotificationMananger.notify {
        "appName": "Timer",
        "appIcon": "chronometer",
        "summary": "Timer finished",
        "body": "0:03 has passed",
        "expireTimeout": 2000,
        "soundFile": "/usr/share/sounds/freedesktop/stereo/complete.oga",
        "actions": [
                "repeat,Repeat"
        ]
}
luigir-it commented 3 years ago

xsession-errors doesn't exist

Zren commented 3 years ago

Ah sorry, the wording about ~/.xsession-errors is for Ubuntu based distros. In Arch plasmashell is launched by systemd and it's logs are captured by journalctl. Use the command I gave you before.

luigir-it commented 3 years ago

If I use the journalctl command after I enable debugging mode and started another timer, there are still no new errors (the last one is at 23:53). As you probably noticed, English is not my native language, so tell me if I'm not clear enough

Zren commented 3 years ago

Your english is good.

I forgot that Qt doesn't log qml: messages by default. Arch probably hasn't patched this to print these messages. Run this:

kwriteconfig5 --file ~/.config/QtProject/qtlogging.ini --group "Rules" --key "qml.debug" "true"

Then relog and check journalctl, or run the following command to restart plasmashell in the current login session and print log messages to the terminal you run the command in.

kstart5 -- plasmashell --replace
luigir-it commented 3 years ago

So, i run the kwrite command, then the journal one and set a 5 sec timer. No new errors. I don't understand if now I have to restart plasmashell or not.

Zren commented 3 years ago

Just logout then log back in. Then confirm "debugging" is checked in the event calendar widget settings. Then run journalctl -b0 _COMM=plasmashell -f in a terminal. Then run a timer to see if there's any log messages in the journalctl logs.

luigir-it commented 3 years ago

Ok. No new errors related to the timer (something new appeared because of the logout-login).

Zren commented 3 years ago

There should be messages like this at least if debugging was enabled correctly:

qml: [eventcalendar:debug] isExpanded true
qml: [eventcalendar:debug] setToday Thu Oct 8 19:47:18 2020 GMT-0400
qml: [eventcalendar:debug] onMonthViewDateChanged Thu Oct 8 00:00:00 2020 GMT-0400

In any case, I'm not sure why it's not working. Perhaps try using another timer widget from the KDE Store?

I also have this widget which is not on the KDE Store as the GUI is not polished: https://github.com/Zren/plasma-applet-systraytimer

luigir-it commented 3 years ago

Ok. So I tried another time the kwrite, logout/in, journal and timer. No new messages. Then I tried all again but this time with sudo kwrite and yes, new errors appeared. Screenshot_20201009_021150

I tried the timer widget included with plasma, it doesn't make any sound (even though it doesn't say it makes sounds).

Systraytimer does work (does produce a sound), but I don't really like the gui lol.

luigir-it commented 3 years ago

Hello. Today I had some time to use the pc again. After I started the system, I wanted to try again to see any relevant error messages, but the notification service was somehow disabled (so no notifications for timer or anything else). Rebooting the system did not help. So I googled a bit, and found this https://bit.ly/30XHzSQ I indeed use latte dock, but it said the problem was solved. But if I put a notification widget on the desktop, the widged worked (was able to receive notification in that widget and a pop-up) So I removed Event Calendar and rebooted. The widget notification on latte worked again. So I added Event Calendar and tried the timer. It worked and the sound too! Than I rebooted just to make sure everything will still work. And yes it does. Both notification and timer sound. So, after all this, I have no idea about what caused the problem in the first place. But the issue with the timer sound was there for a long time, like months. Now, since the issue with arch made everything crash, and I'm a noobie to Linux, I deleted latte-dock and everything before I discovered that the crash problem was related to Event Calendar. So this was an occasion to reinstall latte and all the widget from the beginning. However, the issue with the timer was still there, and I thought it was a good idea to report it. Now everything work for apparently no reason, but i'm good with that lol I hope this could help anyway.

Zren commented 3 years ago

Probably Issue #60. I should probably release v70 with that fix. I got distracted by the Qt 5.15.1 bug.

banchaa commented 3 years ago

I found out, that when I disable system sounds, the configured sounds also don't work. I scratched my head to find the issue.

Zren commented 3 years ago

@banchaa: Because were using the system's ____ complete sound effect using libcanberra.

banchaa commented 3 years ago

@banchaa: Because were using the system's ____ complete sound effect using libcanberra.

Thank you very much. <3 :)