fewieden/MMM-AlarmClock

Alarm sound unexpected behaviour

Closed this issue · 7 comments

Platform (Hardware/OS): RPI-4 / Raspbian GNU/Linux 11 (bullseye). Official 7" touch screen.

Node version: v18.17.1

MagicMirror version: 2.24.0

Module version: 2.0.1
Description of the issue: At alarm time, the alert shows and the audio file is played. Touching the screen closes the visual alert but the sound file continues to play. It plays 3 times before stopping of its own accord.
This is with the minimal example entry to config as in readme.
Have tried a fresh OS and mm install.

Is this normal? I expected the sound to stop when touching the screen. If normal, what can I change it to get expected behaviour?

Thank you!

I note that with a longer audio file, it plays only once. It is still not cancellable by touch.

@keystrobe thank you for the report, I was able to reproduce the issue.

Trying to figure out now what's happening, it's definitely not expected to continue the sound after the alert is closed.

@keystrobe the default config of the module doesn't support touch, as most users don't have a touch possibility.

You need to explicitly specify touch: true:

{
	module: 'MMM-AlarmClock',
	position: 'top_right',
	config: {
		touch: true,
		alarms: [
			{time: "23:34", days: [0,1,2,3,4,5,6], title: "Soccer", message: "Get ready for soccer training!", sound: "alarm.mp3"},
		],
	}
},

However, it still didn't work for me, but it threw an error in the console. There seems to be a timing issue with the alerts from the default alert module, which might be due to changes in the core MagicMirror project over the years. If the config change doesn't work for you you can try my updated version 2.0.2 on the develop branch with the following commands in your terminal:

cd ~/MagicMirror/modules/MMM-AlarmClock
git checkout develop
git pull
npm ci

I tried the version 2.0.2. The touch cancels the audio as hoped, thank you! I will deploy to my actual alarm clock to check real-world performance and report back.

@keystrobe I just released version 2.0.2 containing this fix. Thank you for sponsoring me.