Zoneminder Audio Alerts using mpg123
Posted: Sat Jul 15, 2023 9:35 am
End goal:
I have a partial solution - I will put that in my 2nd post on this topic!
My end goal is to get an audio alert zone played by my systems speaker (NOT THROUGH THE WEB PAGE) whenever a specific Zone is triggered on 1 of my monitors. For now, Im just testing with a general filter before I add in a specific zone to the filter.
The Issue/Problem
The filter I created seems to execute the command HOWEVER, all that happens is mpg123 starts up with a slightly strange command line (indicated on the included image) and it then goes to 100% of a CPU core and nothing happens.
Strange command line example, something such as "/media/camera/cameravideos/7/2023-07-09/705037" gets added to the command line (please see the below image on the right side)
I have followed both:
https://bkjaya.wordpress.com/2020/11/08 ... -a-motion/
viewtopic.php?p=122000&hilit=mp3#p122000
Steps I have performed
- Installed mpg123 "sudo apt install mpg123"
- Created the "sounds" folder and moved my mp3 file into it "sudo mkdir /usr/share/zoneminder/www/sounds"
- Performed "sudo chmodd 777 frontdoor.mp3" on the mp3 file (and other mp3 file).
- Edited my "sudoers.d" file and added bypass of permissions there on the mp3 files.
- Created the filter as a very simple filter and confirmed its settings as per instructions.
- Rebooted my system after ALL these changes.
- tested "mpg123 /usr/share/zoneminder/www/sounds/frontdoor.mp3" when logged in at the command line and it works fine.
- tested "mpg123 /usr/share/zoneminder/www/sounds/frontdoor.mp3 /media/camera/cameravideos/7/2023-07-09/705037" when logged in and that appears to work fine too!
Additional note
I have also noted this post viewtopic.php?t=31677 about the WEB_SOUND_ON_ALARM setting being reworked recently, however I believe that is unrelated to what I am doing here.
Does anyone have any thoughts?
Many thanks!
I have a partial solution - I will put that in my 2nd post on this topic!
My end goal is to get an audio alert zone played by my systems speaker (NOT THROUGH THE WEB PAGE) whenever a specific Zone is triggered on 1 of my monitors. For now, Im just testing with a general filter before I add in a specific zone to the filter.
The Issue/Problem
The filter I created seems to execute the command HOWEVER, all that happens is mpg123 starts up with a slightly strange command line (indicated on the included image) and it then goes to 100% of a CPU core and nothing happens.
Strange command line example, something such as "/media/camera/cameravideos/7/2023-07-09/705037" gets added to the command line (please see the below image on the right side)
I have followed both:
https://bkjaya.wordpress.com/2020/11/08 ... -a-motion/
viewtopic.php?p=122000&hilit=mp3#p122000
Steps I have performed
- Installed mpg123 "sudo apt install mpg123"
- Created the "sounds" folder and moved my mp3 file into it "sudo mkdir /usr/share/zoneminder/www/sounds"
- Performed "sudo chmodd 777 frontdoor.mp3" on the mp3 file (and other mp3 file).
- Edited my "sudoers.d" file and added bypass of permissions there on the mp3 files.
- Created the filter as a very simple filter and confirmed its settings as per instructions.
- Rebooted my system after ALL these changes.
- tested "mpg123 /usr/share/zoneminder/www/sounds/frontdoor.mp3" when logged in at the command line and it works fine.
- tested "mpg123 /usr/share/zoneminder/www/sounds/frontdoor.mp3 /media/camera/cameravideos/7/2023-07-09/705037" when logged in and that appears to work fine too!
Additional note
I have also noted this post viewtopic.php?t=31677 about the WEB_SOUND_ON_ALARM setting being reworked recently, however I believe that is unrelated to what I am doing here.
Does anyone have any thoughts?
Many thanks!