[opensuse] play sound from procmail
Hi all. I've got the basic recipe working, e.g. :0 * ^from:.*foo@gmail.com.* { :0c: ${MAILDIR}/INBOX :0ahi | cvlc -I default -R --gain 8.0 ${HOME}/ringtones/cash_register.mp3 } (pretty much copy-pasted from examples on the web). However, while the `cvlc` commmand works fine from the command line, when run from procmail, I keep getting [000055a9e1d96468] core audio output error: Audio output failed [000055a9e1d96468] core audio output error: The audio device "default" could not be used: Device or resource busy. [000055a9e1d96468] core audio output error: module not functional [00007fbddcc0ca08] core decoder error: failed to create audio output ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave in the procmail log and [pulseaudio] module-jackdbus-detect.c: Unable to contact D-Bus session bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 [pulseaudio] module.c: Failed to load module "module-jackdbus-detect" (argument: "channels=2"): initialization failed. [pulseaudio] socket-server.c: bind(): Address already in use [pulseaudio] module.c: Failed to load module "module-esound-protocol-unix" (argument: ""): initialization failed. [pulseaudio] main.c: Module load failed. [pulseaudio] main.c: Module load failed. [pulseaudio] main.c: Failed to initialize daemon. [pulseaudio] main.c: Daemon startup failed. in `journalctl -f`. (leading bits of the lines trimmed) I have tried wrapping the `cvlc` in a shell script which does export DISPLAY=:0 cvlc -I default -R --gain 8.0 ${HOME}/ringtones/cash_register.mp3 but that doesn't help. In this case I get a standard message in the procmail log and the following in `journalctl -f` [pulseaudio] socket-server.c: bind(): Address already in use [pulseaudio] module.c: Failed to load module "module-esound-protocol-unix" (argument: ""): initialization failed. [pulseaudio] main.c: Module load failed. [pulseaudio] main.c: Failed to initialize daemon. [pulseaudio] main.c: Daemon startup failed. Suggestions? Any sound card info I should provide, etc.? TIA Michael -- Michael Fischer michael@visv.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Tue, 21 Aug 2018, Michael Fischer wrote:
I've got the basic recipe working, e.g.
:0 * ^from:.*foo@gmail.com.* { :0c: ${MAILDIR}/INBOX :0ahi | cvlc -I default -R --gain 8.0 ${HOME}/ringtones/cash_register.mp3 }
(pretty much copy-pasted from examples on the web).
However, while the `cvlc` commmand works fine from the command line, when run from procmail, I keep getting
[000055a9e1d96468] core audio output error: Audio output failed [000055a9e1d96468] core audio output error: The audio device "default" could not be used: Device or resource busy. [000055a9e1d96468] core audio output error: module not functional [00007fbddcc0ca08] core decoder error: failed to create audio output ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave
in the procmail log
You've got a permission problem on /dev/snd/*. Just tested with: ==== :0 { :0fwc | /bin/sh -c 'formail -A "X-UID: $(id)"' :0wc | ogg123 /usr/share/sounds/KDE-Im-Message-In.ogg # :0 # inbox } ==== As it turns out, via procmail, you _ONLY_ have your primary group, as you can see by the "X-UID: " header inserted via formail, e.g. "users". But /dev/snd/* are 'crw-rw---- root.audio'... And not "root.users". Depending on your system: a) esp. if it's a single-user box, think about changing the group of /dev/snd/* b) if not, using sudo with "NOPASSWD" for the one exact command (for that (group of) user(s)) might be the easiest. HTH, -dnh -- Real programmers use chmod +x /dev/random and cross their fingers -- Comment found in a vi/emacs flamewar on slashdot. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tue, Aug 21, David Haller wrote:
Hello,
On Tue, 21 Aug 2018, Michael Fischer wrote:
I've got the basic recipe working, e.g.
:0 * ^from:.*foo@gmail.com.* { :0c: ${MAILDIR}/INBOX :0ahi | cvlc -I default -R --gain 8.0 ${HOME}/ringtones/cash_register.mp3 }
(pretty much copy-pasted from examples on the web).
However, while the `cvlc` commmand works fine from the command line, when run from procmail, I keep getting
[000055a9e1d96468] core audio output error: Audio output failed [000055a9e1d96468] core audio output error: The audio device "default" could not be used: Device or resource busy. [000055a9e1d96468] core audio output error: module not functional [00007fbddcc0ca08] core decoder error: failed to create audio output ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave
in the procmail log
You've got a permission problem on /dev/snd/*.
Just tested with:
==== :0 { :0fwc | /bin/sh -c 'formail -A "X-UID: $(id)"'
:0wc | ogg123 /usr/share/sounds/KDE-Im-Message-In.ogg
# :0 # inbox } ====
As it turns out, via procmail, you _ONLY_ have your primary group, as you can see by the "X-UID: " header inserted via formail, e.g. "users". But /dev/snd/* are 'crw-rw---- root.audio'... And not "root.users".
Depending on your system:
a) esp. if it's a single-user box, think about changing the group of /dev/snd/*
Thanks. Tried `sudo chgrp users /dev/snd/*` and verified. Didn't change anything from the "run from script setting DISPLAY=:0" case. [pulseaudio] socket-server.c: bind(): Address already in use [pulseaudio] module.c: Failed to load module "module-esound-protocol-unix" (argument: ""): initialization failed. [pulseaudio] main.c: Module load failed. [pulseaudio] main.c: Failed to initialize daemon. [pulseaudio] main.c: Daemon startup failed. NB! (might be relevant) - when the mail comes in, I have a video playing in another `vlc` process... Works - starting script from a terminal window while other `vlc` is running - the procmail recipe when NOT running another `vlc` process Fails - the procmail recipe when another `vlc` is running (also had a similar problme when the script ran ffplay...) Not sure what the right incantation or setting (if any) is to avoid what looks like a collision (which pulse isn't handling?) Michael -- Michael Fischer michael@visv.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Tue, 21 Aug 2018, Michael Fischer wrote:
On Tue, Aug 21, David Haller wrote:
| cvlc -I default -R --gain 8.0 ${HOME}/ringtones/cash_register.mp3
BTW: I think you're missing the '--play-and-exit' there...
Works - starting script from a terminal window while other `vlc` is running - the procmail recipe when NOT running another `vlc` process
How about _not_ using vlc then? It's not that mp3 are difficult to play. Try mplayer/mpeg123/play (from the sox package) or whatever else comes to mind... e.g. mplayer -ao alsa:noblock ... -dnh -- Better visibility is no good if the oncoming traffic crashes into you with its arm across its eyes from the sudden blindness. -- Graham Reed -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tue, Aug 21, David Haller wrote:
Hello,
On Tue, 21 Aug 2018, Michael Fischer wrote:
On Tue, Aug 21, David Haller wrote:
| cvlc -I default -R --gain 8.0 ${HOME}/ringtones/cash_register.mp3
BTW: I think you're missing the '--play-and-exit' there...
Note the `-R`. This is meant to wake me up at 3:00AM until I turn it off :)
Works - starting script from a terminal window while other `vlc` is running - the procmail recipe when NOT running another `vlc` process
How about _not_ using vlc then? It's not that mp3 are difficult to play. Try mplayer/mpeg123/play (from the sox package) or whatever else comes to mind...
Well, I did start with ffplay... same issues. vlc was my second try.
e.g. mplayer -ao alsa:noblock ...
Hmm, that might be the sort of incantation (alsa:noblock) I was wondering about. Aha! Winners (for now) both `mplayer -loop 0 /path/to/file` (-ao alsa:noblock didn't work from procmail) (though curiously, I still get the complaints in the journal with this one..) and `mpg123 --loop -1 /path/to/file` work (-o alsa fails) No idea why specifying the module makes it a problem, but thanks a bunch to David and Bengt. Cheers. Michael -- Michael Fischer michael@visv.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2018-08-22 00:22, Michael Fischer wrote:
On Tue, Aug 21, David Haller wrote:
and
`mpg123 --loop -1 /path/to/file` work (-o alsa fails)
No idea why specifying the module makes it a problem, but thanks a bunch to David and Bengt.
I use aplay -q /path/file on a system script that runs as root, possibly before pulse is loaded. -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
On 2018-08-21 22:02, David Haller wrote:
You've got a permission problem on/dev/snd/*.
You sure? It's probably pulseaudio in between. This indicates that something is there:
[000055a9e1d96468] core audio output error: Audio output failed [000055a9e1d96468] core audio output error: The audio device "default" > could not be used: Device or resource busy.
And what is "-I default" in cvlc? I can't find a module that's called "default". I should rather be "dummy" as it is what cvlc uses from the beginning. $ cat /usr/bin/cvlc #! /bin/sh exec /usr/bin/vlc -I "dummy" "$@" Anyway. I would try with another mp3-player instead. mpg123 has quite a lot smaller footprint than vlc. :0 * ^from:.*foo@gmail.com.* { :0c: ${MAILDIR}/INBOX :0ahi | mpg123 -q --no-control ${HOME}/ringtones/cash_register.mp3 } -- /bengan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (4)
-
Bengt Gördén
-
Carlos E.R.
-
David Haller
-
Michael Fischer