[oS-en] How can I play a sound from a script?
Hi, I want to play a sound from a script, for example to signal it finished, but I can't. First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system: er@Erebor4:~> aplay /usr/share/sounds/freedesktop/stereo/bell.oga Playing raw data '/usr/share/sounds/freedesktop/stereo/bell.oga' : Unsigned 8 bit, Rate 8000 Hz, Mono ^CAborted by signal Interrupt... cer@Erebor4:~> This command produces horrible noise with any .oga file I try. cer@Erebor4:~> madplay /usr/share/sounds/freedesktop/stereo/bell.oga MPEG Audio Decoder 0.15.2 (beta) - Copyright © 2000-2004 Robert Leslie et al. audio: No such file or directory cer@Erebor4:~> cer@Erebor4:~> paplay /usr/share/sounds/freedesktop/stereo/bell.oga cer@Erebor4:~> (silence...) cer@Erebor4:~> play /usr/share/sounds/freedesktop/stereo/bell.oga /usr/share/sounds/freedesktop/stereo/bell.oga: File Size: 8.50k Bit Rate: 487k Encoding: Vorbis Channels: 2 @ 16-bit Samplerate: 44100Hz Replaygain: off Duration: 00:00:00.14 In:100% 00:00:00.14 [00:00:00.00] Out:6.15k [ ====|==== ] Clip:0 Done. cer@Erebor4:~> (silence...) I can play sounds with VLC, but not being a CLI command, it starts a GUI that then I have to close manually. "vlc --help" is huge, I have not seen a way to play a sound and exit. I can probably convert a sound to .wav, and play that one. play, aplay, and paplay all work that way. Second problem: I can not play them as root, and I do need them as rootm because those scripts run as root. Erebor4:~ # su cer - -c vlc /usr/share/sounds/freedesktop/stereo/service-logout.oga VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2) [000055713e92b640] vlcpulse audio output error: PulseAudio server connection failure: *Connection refused* [000055713e8494e0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-cer' [000055713e84ba40] main playlist: playlist is empty QObject::~QObject: Timers cannot be stopped from another thread Erebor4:~ # Erebor4:~ # vlc /usr/share/sounds/freedesktop/stereo/service-logout.oga VLC is not supposed to be run as root. Sorry. If you need to use real-time priorities and/or privileged TCP ports you can use vlc-wrapper (make sure it is Set-UID root and cannot be run by non-trusted users first). Erebor4:~ # Erebor4:~ # su cer - -c "aplay /usr/share/sounds/freedesktop/stereo/service-logout.oga" ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused aplay: main:830: audio open error: Connection refused Erebor4:~ # Erebor4:~ # su cer - -c "paplay /usr/share/sounds/freedesktop/stereo/service-logout.oga" Connection failure: Connection refused pa_context_connect() failed: Connection refused Erebor4:~ # stuck. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
do you have mplayer? it's how i make a sound from a script, works flawlessly On Fri, Jan 21, 2022 at 6:21 AM Carlos E. R. <robin.listas@telefonica.net> wrote:
Hi,
I want to play a sound from a script, for example to signal it finished, but I can't.
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
er@Erebor4:~> aplay /usr/share/sounds/freedesktop/stereo/bell.oga Playing raw data '/usr/share/sounds/freedesktop/stereo/bell.oga' : Unsigned 8 bit, Rate 8000 Hz, Mono ^CAborted by signal Interrupt... cer@Erebor4:~>
This command produces horrible noise with any .oga file I try.
cer@Erebor4:~> madplay /usr/share/sounds/freedesktop/stereo/bell.oga MPEG Audio Decoder 0.15.2 (beta) - Copyright © 2000-2004 Robert Leslie et al. audio: No such file or directory cer@Erebor4:~>
cer@Erebor4:~> paplay /usr/share/sounds/freedesktop/stereo/bell.oga cer@Erebor4:~>
(silence...)
cer@Erebor4:~> play /usr/share/sounds/freedesktop/stereo/bell.oga
/usr/share/sounds/freedesktop/stereo/bell.oga:
File Size: 8.50k Bit Rate: 487k Encoding: Vorbis Channels: 2 @ 16-bit Samplerate: 44100Hz Replaygain: off Duration: 00:00:00.14
In:100% 00:00:00.14 [00:00:00.00] Out:6.15k [ ====|==== ] Clip:0 Done. cer@Erebor4:~>
(silence...)
I can play sounds with VLC, but not being a CLI command, it starts a GUI that then I have to close manually. "vlc --help" is huge, I have not seen a way to play a sound and exit.
I can probably convert a sound to .wav, and play that one. play, aplay, and paplay all work that way.
Second problem: I can not play them as root, and I do need them as rootm because those scripts run as root.
Erebor4:~ # su cer - -c vlc /usr/share/sounds/freedesktop/stereo/service-logout.oga VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2) [000055713e92b640] vlcpulse audio output error: PulseAudio server connection failure: *Connection refused* [000055713e8494e0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-cer' [000055713e84ba40] main playlist: playlist is empty QObject::~QObject: Timers cannot be stopped from another thread Erebor4:~ #
Erebor4:~ # vlc /usr/share/sounds/freedesktop/stereo/service-logout.oga VLC is not supposed to be run as root. Sorry. If you need to use real-time priorities and/or privileged TCP ports you can use vlc-wrapper (make sure it is Set-UID root and cannot be run by non-trusted users first). Erebor4:~ #
Erebor4:~ # su cer - -c "aplay /usr/share/sounds/freedesktop/stereo/service-logout.oga" ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
aplay: main:830: audio open error: Connection refused Erebor4:~ #
Erebor4:~ # su cer - -c "paplay /usr/share/sounds/freedesktop/stereo/service-logout.oga" Connection failure: Connection refused pa_context_connect() failed: Connection refused Erebor4:~ #
stuck.
-- Cheers / Saludos,
Carlos E. R.
(from oS Leap 15.3 x86_64 (Erebor-4))
On 21/01/2022 13.36, tooth pik wrote:
do you have mplayer? it's how i make a sound from a script, works flawlessly
Just installed it. It works (as user), but barely audible. I don't see how to control the volume in "mplayer --help". As root, no play. Erebor4:~ # mplayer /usr/share/sounds/freedesktop/stereo/bell.oga ... AO: [pulse] Init failed: Connection refused Failed to initialize audio driver 'pulse' [AO_ALSA] alsa-lib: pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused [AO_ALSA] Playback open error: Connection refused Failed to initialize audio driver 'alsa' ... Erebor4:~ # su - cer -c "mplayer /usr/share/sounds/freedesktop/stereo/bell.oga" ... AO: [pulse] Init failed: Connection refused Failed to initialize audio driver 'pulse' [AO_ALSA] alsa-lib: pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
Hello, On Fri, 21 Jan 2022, Carlos E. R. wrote:
Just installed it. It works (as user), but barely audible. I don't see how to control the volume in "mplayer --help".
See 'man mplayer': AUDIO OUTPUT OPTIONS (MPLAYER ONLY) [..] -volume <-1-100> (also see -af volume) Set the startup volume in the mixer, either hardware or software (if used with -softvol). A value of -1 (the default) will not change the volume. HTH, -dnh -- A mouse is a device used to focus xterms.
On 21/01/2022 14.26, David Haller wrote:
Hello,
On Fri, 21 Jan 2022, Carlos E. R. wrote:
Just installed it. It works (as user), but barely audible. I don't see how to control the volume in "mplayer --help".
See 'man mplayer':
AUDIO OUTPUT OPTIONS (MPLAYER ONLY) [..] -volume <-1-100> (also see -af volume) Set the startup volume in the mixer, either hardware or software (if used with -softvol). A value of -1 (the default) will not change the volume.
No, it fails the first time, it makes me deaf the second time. :-o -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
Hello, On Fri, 21 Jan 2022, Carlos E. R. wrote:
On 21/01/2022 14.26, David Haller wrote:
On Fri, 21 Jan 2022, Carlos E. R. wrote:
Just installed it. It works (as user), but barely audible. I don't see how to control the volume in "mplayer --help".
See 'man mplayer':
AUDIO OUTPUT OPTIONS (MPLAYER ONLY) [..] -volume <-1-100> (also see -af volume) Set the startup volume in the mixer, either hardware or software (if used with -softvol). A value of -1 (the default) will not change the volume.
No, it fails the first time, it makes me deaf the second time.
Try 'mplayer -volume 30 bell.oga' -dnh -- The trouble with writing fiction is that it has to make sense, whereas real life doesn't. -- Iain Banks
On 21/01/2022 14.43, David Haller wrote:
Hello,
On Fri, 21 Jan 2022, Carlos E. R. wrote:
On 21/01/2022 14.26, David Haller wrote:
On Fri, 21 Jan 2022, Carlos E. R. wrote:
Just installed it. It works (as user), but barely audible. I don't see how to control the volume in "mplayer --help".
See 'man mplayer':
AUDIO OUTPUT OPTIONS (MPLAYER ONLY) [..] -volume <-1-100> (also see -af volume) Set the startup volume in the mixer, either hardware or software (if used with -softvol). A value of -1 (the default) will not change the volume.
No, it fails the first time, it makes me deaf the second time.
Try 'mplayer -volume 30 bell.oga'
Same problem, I have to run sound commands twice. The first there is no sound, the second time it works. Wait a minute, and repeat, issue commands twice. So, my script does that now, call the command twice. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
On Fri, 21 Jan 2022 14:50:09 +0100 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 21/01/2022 14.43, David Haller wrote:
Hello,
On Fri, 21 Jan 2022, Carlos E. R. wrote:
On 21/01/2022 14.26, David Haller wrote:
On Fri, 21 Jan 2022, Carlos E. R. wrote:
Just installed it. It works (as user), but barely audible. I don't see how to control the volume in "mplayer --help".
See 'man mplayer':
AUDIO OUTPUT OPTIONS (MPLAYER ONLY) [..] -volume <-1-100> (also see -af volume) Set the startup volume in the mixer, either hardware or software (if used with -softvol). A value of -1 (the default) will not change the volume.
No, it fails the first time, it makes me deaf the second time.
Try 'mplayer -volume 30 bell.oga'
Same problem, I have to run sound commands twice. The first there is no sound, the second time it works. Wait a minute, and repeat, issue commands twice.
So, my script does that now, call the command twice.
There's something uniquely wrong with your particular setup. You probably need to go away and conduct a series of experiments to determine as much as you can and only then report back here for help to solve whatever problem remains.
On 21/01/2022 17.14, Dave Howorth wrote:
On Fri, 21 Jan 2022 14:50:09 +0100 "Carlos E. R." <> wrote:
On 21/01/2022 14.43, David Haller wrote:
Hello,
On Fri, 21 Jan 2022, Carlos E. R. wrote:
On 21/01/2022 14.26, David Haller wrote:
On Fri, 21 Jan 2022, Carlos E. R. wrote:
Just installed it. It works (as user), but barely audible. I don't see how to control the volume in "mplayer --help".
See 'man mplayer':
AUDIO OUTPUT OPTIONS (MPLAYER ONLY) [..] -volume <-1-100> (also see -af volume) Set the startup volume in the mixer, either hardware or software (if used with -softvol). A value of -1 (the default) will not change the volume.
No, it fails the first time, it makes me deaf the second time.
Try 'mplayer -volume 30 bell.oga'
Same problem, I have to run sound commands twice. The first there is no sound, the second time it works. Wait a minute, and repeat, issue commands twice.
So, my script does that now, call the command twice.
There's something uniquely wrong with your particular setup. You probably need to go away and conduct a series of experiments to determine as much as you can and only then report back here for help to solve whatever problem remains.
And what would those tests be? This is a fresh 15.3 install, whatever I have comes from YaST sound config. I have not played with this system yet. I have never seen a similar problem, so I have no idea what to do about it. [...] See Andrei's answer about that. For my use case, considering that this is only a rescue system, I will pause investigations and just call ffplay twice in the script. Maybe the final system doesn't have the problem. If it has, I'll open a bugzilla. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
Carlos E. R. wrote:
On 21/01/2022 17.14, Dave Howorth wrote:
There's something uniquely wrong with your particular setup. You probably need to go away and conduct a series of experiments to determine as much as you can and only then report back here for help to solve whatever problem remains.
And what would those tests be?
This is a fresh 15.3 install, whatever I have comes from YaST sound config. I have not played with this system yet.
My instinct says to go with Dave's suggestion that there is something uniquely wrong with your particular setup. OTOH, when it works for me on 15.2, that might be worth trying out, for bisecting a bit?
I have never seen a similar problem, so I have no idea what to do about it.
Happens to all of us :-) -- Per Jessen, Zürich (1.1°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland.
On 21/01/2022 20.12, Per Jessen wrote:
Carlos E. R. wrote:
On 21/01/2022 17.14, Dave Howorth wrote:
There's something uniquely wrong with your particular setup. You probably need to go away and conduct a series of experiments to determine as much as you can and only then report back here for help to solve whatever problem remains.
And what would those tests be?
This is a fresh 15.3 install, whatever I have comes from YaST sound config. I have not played with this system yet.
My instinct says to go with Dave's suggestion that there is something uniquely wrong with your particular setup. OTOH, when it works for me on 15.2, that might be worth trying out, for bisecting a bit?
I rather think that Andrei Borzenkov is right about this. He said: AB> That sounds similar to what I observed using mpv with pulseaudio driver. When AB> I pause video and then resume, the first several seconds are muted. mpv developers AB> point at PA. It seems PA needs long time to "start" audio output. AB> AB> I ended configuring mpv to use ALSA driver directly and run it under pasuspend. This machine "worked" under 15.2, and I am in the process of upgrading it to 15.3. This is just an auxiliary partition for doing maintenance backups and rescue ops, which I took the chance to re-install as 15.3 and testing it. Same as in 15.2, the YaST config works partially (test sound fails on both, but sound works). For my use case, I don't need more analysis or testing in this partition, doing a double command call in scripts suffices as a hack. Considering AB comment, the issue is known, and there is nothing I can do about things, except report in bugzilla and test what they tell me to test.
I have never seen a similar problem, so I have no idea what to do about it.
Happens to all of us :-)
-- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
Good Morning, In the Message; Subject : Re: [oS-en] How can I play a sound from a script? Message-ID : <372c9431-ea2c-f278-4189-c2de7f4d70ef@telefonica.net> Date & Time: Fri, 21 Jan 2022 19:48:01 +0100 [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: [...] CER> And what would those tests be? CER> This is a fresh 15.3 install, whatever I have comes from YaST CER> sound config. I have not played with this system yet. [...] I don't remember the details, but YaST2 initially fails to install pipewire. That is, it does not install the necessary file(s?). When the pipewire installed correctly, you will get; $ pactl info Server String: /run/user/1000/pulse/native Library Protocol Version: 35 Server Protocol Version: 35 Is Local: yes Client Index: 108 Tile Size: 65472 User Name: masaru Host Name: linux-egwc Server Name: PulseAudio (on PipeWire 0.3.43) Server Version: 15.0.0 Default Sample Specification: float32le 2ch 192000Hz Default Channel Map: front-left,front-right Default Sink: alsa_output.usb-D___M_Holdings_Inc._HD-DAC1-00.analog-stereo Default Source: alsa_output.usb-D___M_Holdings_Inc._HD-DAC1-00.analog-stereo.monitor Cookie: c2f0:e751 This is th full list of pipewire files in my system; libpipewire-0_3-0-32bit-0.3.40-lp153.33.1.x86_64 pipewire-alsa-32bit-0.3.40-lp153.33.1.x86_64 pipewire-devel-0.3.43-lp153.30.56.x86_64 pipewire-libjack-0_3-32bit-0.3.40-lp153.33.1.x86_64 pipewire-spa-plugins-0_2-0.3.43-lp153.30.56.x86_64 pipewire-lang-0.3.43-lp153.30.56.noarch pipewire-0.3.43-lp153.30.56.x86_64 gstreamer-plugin-pipewire-0.3.43-lp153.30.56.x86_64 pipewire-modules-0.3.43-lp153.30.56.x86_64 pipewire-pulseaudio-0.3.43-lp153.30.56.x86_64 pipewire-alsa-0.3.43-lp153.30.56.x86_64 pipewire-spa-plugins-0_2-32bit-0.3.40-lp153.32.1.x86_64 libpipewire-0_3-0-0.3.43-lp153.30.56.x86_64 pipewire-media-session-lang-0.4.1+git.20220101.f15a4c7a-lp153.8.1.noarch pipewire-media-session-0.4.1+git.20220101.f15a4c7a-lp153.8.1.x86_64 pipewire-spa-tools-0.3.43-lp153.30.56.x86_64 pipewire-doc-0.3.43-lp153.30.56.x86_64 pipewire-tools-0.3.43-lp153.30.56.x86_64 After installation, 1. $ systemctl --user daemon-reload 2. $ systemctl --user pipewire.service pipewire-pulse.service pipewire-media-session.service 3. check the volume by alsamixer (install/update of pipewire often set the volume 0) HTH, Ragards. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ "Three young men died for Rationalization. Yet, Margaret Bloody Thatcher LIVES!" 'Brassed Off'
Hello, Sorry, I missed. In the Message; Subject : Re: [oS-en] How can I play a sound from a script? Message-ID : <87v8ycajzi.wl-nomiya@galaxy.dti.ne.jp> Date & Time: Sat, 22 Jan 2022 05:53:37 +0900 [MN] == Masaru Nomiya <nomiya@galaxy.dti.ne.jp> has written: MN> Good Morning, MN> In the Message; MN> Subject : Re: [oS-en] How can I play a sound from a script? MN> Message-ID : <372c9431-ea2c-f278-4189-c2de7f4d70ef@telefonica.net> MN> Date & Time: Fri, 21 Jan 2022 19:48:01 +0100 MN> [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: MN> [...] CER> And what would those tests be? CER> This is a fresh 15.3 install, whatever I have comes from YaST CER> sound config. I have not played with this system yet. MN> [...] MN> I don't remember the details, but YaST2 initially fails to install MN> pipewire. That is, it does not install the necessary file(s?). MN> When the pipewire installed correctly, you will get; MN> $ pactl info MN> Server String: /run/user/1000/pulse/native MN> Library Protocol Version: 35 MN> Server Protocol Version: 35 MN> Is Local: yes MN> Client Index: 108 MN> Tile Size: 65472 MN> User Name: masaru MN> Host Name: linux-egwc MN> Server Name: PulseAudio (on PipeWire 0.3.43) MN> Server Version: 15.0.0 MN> Default Sample Specification: float32le 2ch 192000Hz MN> Default Channel Map: front-left,front-right MN> Default Sink: alsa_output.usb-D___M_Holdings_Inc._HD-DAC1-00.analog-stereo MN> Default Source: alsa_output.usb-D___M_Holdings_Inc._HD-DAC1-00.analog-stereo.monitor MN> Cookie: c2f0:e751 MN> This is th full list of pipewire files in my system; MN> libpipewire-0_3-0-32bit-0.3.40-lp153.33.1.x86_64 MN> pipewire-alsa-32bit-0.3.40-lp153.33.1.x86_64 MN> pipewire-devel-0.3.43-lp153.30.56.x86_64 MN> pipewire-libjack-0_3-32bit-0.3.40-lp153.33.1.x86_64 MN> pipewire-spa-plugins-0_2-0.3.43-lp153.30.56.x86_64 MN> pipewire-lang-0.3.43-lp153.30.56.noarch MN> pipewire-0.3.43-lp153.30.56.x86_64 MN> gstreamer-plugin-pipewire-0.3.43-lp153.30.56.x86_64 MN> pipewire-modules-0.3.43-lp153.30.56.x86_64 MN> pipewire-pulseaudio-0.3.43-lp153.30.56.x86_64 MN> pipewire-alsa-0.3.43-lp153.30.56.x86_64 MN> pipewire-spa-plugins-0_2-32bit-0.3.40-lp153.32.1.x86_64 MN> libpipewire-0_3-0-0.3.43-lp153.30.56.x86_64 MN> pipewire-media-session-lang-0.4.1+git.20220101.f15a4c7a-lp153.8.1.noarch MN> pipewire-media-session-0.4.1+git.20220101.f15a4c7a-lp153.8.1.x86_64 MN> pipewire-spa-tools-0.3.43-lp153.30.56.x86_64 MN> pipewire-doc-0.3.43-lp153.30.56.x86_64 MN> pipewire-tools-0.3.43-lp153.30.56.x86_64 MN> After installation, MN> 1. $ systemctl --user daemon-reload MN> 2. $ systemctl --user pipewire.service pipewire-pulse.service pipewire-media-session.service MN> 3. check the volume by alsamixer (install/update of pipewire often set MN> the volume 0) 2. $ systemctl --user start pipewire.service pipewire-pulse.service pipewire-media-session.service add start command. Regards. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ Think. -- The IBM slogan --
On 21/01/2022 22.08, Masaru Nomiya wrote:
Hello,
Sorry, I missed.
[MN] == Masaru Nomiya <...> has written:
MN> Good Morning,
MN> In the Message;
MN> [CER] == "Carlos E. R." <...> has written:
MN> [...] CER> And what would those tests be?
CER> This is a fresh 15.3 install, whatever I have comes from YaST CER> sound config. I have not played with this system yet. MN> [...]
MN> I don't remember the details, but YaST2 initially fails to install MN> pipewire. That is, it does not install the necessary file(s?).
MN> When the pipewire installed correctly, you will get;
MN> $ pactl info
MN> Server String: /run/user/1000/pulse/native MN> Library Protocol Version: 35 MN> Server Protocol Version: 35 MN> Is Local: yes MN> Client Index: 108 MN> Tile Size: 65472 MN> User Name: masaru MN> Host Name: linux-egwc MN> Server Name: PulseAudio (on PipeWire 0.3.43) MN> Server Version: 15.0.0 MN> Default Sample Specification: float32le 2ch 192000Hz MN> Default Channel Map: front-left,front-right MN> Default Sink: alsa_output.usb-D___M_Holdings_Inc._HD-DAC1-00.analog-stereo MN> Default Source: alsa_output.usb-D___M_Holdings_Inc._HD-DAC1-00.analog-stereo.monitor MN> Cookie: c2f0:e751
MN> This is th full list of pipewire files in my system;
MN> libpipewire-0_3-0-32bit-0.3.40-lp153.33.1.x86_64 MN> pipewire-alsa-32bit-0.3.40-lp153.33.1.x86_64 MN> pipewire-devel-0.3.43-lp153.30.56.x86_64 MN> pipewire-libjack-0_3-32bit-0.3.40-lp153.33.1.x86_64 MN> pipewire-spa-plugins-0_2-0.3.43-lp153.30.56.x86_64 MN> pipewire-lang-0.3.43-lp153.30.56.noarch MN> pipewire-0.3.43-lp153.30.56.x86_64 MN> gstreamer-plugin-pipewire-0.3.43-lp153.30.56.x86_64 MN> pipewire-modules-0.3.43-lp153.30.56.x86_64 MN> pipewire-pulseaudio-0.3.43-lp153.30.56.x86_64 MN> pipewire-alsa-0.3.43-lp153.30.56.x86_64 MN> pipewire-spa-plugins-0_2-32bit-0.3.40-lp153.32.1.x86_64 MN> libpipewire-0_3-0-0.3.43-lp153.30.56.x86_64 MN> pipewire-media-session-lang-0.4.1+git.20220101.f15a4c7a-lp153.8.1.noarch MN> pipewire-media-session-0.4.1+git.20220101.f15a4c7a-lp153.8.1.x86_64 MN> pipewire-spa-tools-0.3.43-lp153.30.56.x86_64 MN> pipewire-doc-0.3.43-lp153.30.56.x86_64 MN> pipewire-tools-0.3.43-lp153.30.56.x86_64
MN> After installation,
MN> 1. $ systemctl --user daemon-reload MN> 2. $ systemctl --user pipewire.service pipewire-pulse.service pipewire-media-session.service
MN> 3. check the volume by alsamixer (install/update of pipewire often set MN> the volume 0)
2. $ systemctl --user start pipewire.service pipewire-pulse.service pipewire-media-session.service
add start command.
Thanks, but as I know nothing about pipewire, I prefer to wait till YaST installs it by default or at least as an option. I removed the pipewire packages I installed. The problem seems to be what Andrei Borzenkov said: AB> That sounds similar to what I observed using mpv with pulseaudio driver. When AB> I pause video and then resume, the first several seconds are muted. mpv developers AB> point at PA. It seems PA needs long time to "start" audio output. AB> AB> I ended configuring mpv to use ALSA driver directly and run it under pasuspend. So there is nothing I can do about it, except wait till the PA devs solve the issue. Anyway, this partition is a temporary install, so I will not invest time on this issue. I just call the ogg123 program twice in my script. Then, if my normal system also develops problems after upgrading to Leap 15.3, I will report in Bugzilla and wait. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
Hello, In the Message; Subject : Re: [oS-en] How can I play a sound from a script? Message-ID : <8e769650-5ea2-dd0a-b476-cb897c69bb02@telefonica.net> Date & Time: Fri, 21 Jan 2022 22:28:31 +0100 [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: [...] CER> Thanks, but as I know nothing about pipewire, I prefer to wait till YaST CER> installs it by default or at least as an option. I removed the CER> pipewire packages I installed. About the pipewire, ask google. Fedora alreay replace the pulseaudio system with the pipewire system. It provides marvelous sounds. You can confirm this; 1. $ echo ogg123 /usr/share/sounds/Oxygen-Sys-Log-In-Short.ogg >> ~/.profile then logout, and login 2. hear the login sound. In my case, The last part of the login sound becomes noise. 3. install the pipewire file, then 3-1. $ systemctl --user daemon-reload 3-2. $ systemctl --user start pipewire.service pipewire-pulse.service pipewire-media-session.service 3-3. check the volume by alsamixer (install/update of pipewire often set the volume 0) 4. logout, then login, and hear the login sound, again. In may case, the login sound is clean all the way through. Now, I'm enjoying the classical musics. I'm wondering if I've ever heard such good sounds with my disposed audio system before. Regards. --- ┏━━┓彡 野宮 賢 mail-to: m.nomiya @ gmail.com ┃\/彡 ┗━━┛ "Three young men died for Rationalization. Yet, Margaret Bloody Thatcher LIVES!" 'Brassed Off'
On 21.01.2022 16:50, Carlos E. R. wrote:
Try 'mplayer -volume 30 bell.oga'
Same problem, I have to run sound commands twice. The first there is no sound, the second time it works. Wait a minute, and repeat, issue commands twice.
That sounds similar to what I observed using mpv with pulseaudio driver. When I pause video and then resume, the first several seconds are muted. mpv developers point at PA. It seems PA needs long time to "start" audio output. I ended configuring mpv to use ALSA driver directly and run it under pasuspend.
Hello, In the Message; Subject : Re: [oS-en] How can I play a sound from a script? Message-ID : <b26ad356-5712-6ca9-6f56-d7999ceccdff@gmail.com> Date & Time: Fri, 21 Jan 2022 21:30:18 +0300 [AB] == Andrei Borzenkov <arvidjaar@gmail.com> has written: AB> On 21.01.2022 16:50, Carlos E. R. wrote: [...] AB> That sounds similar to what I observed using mpv with pulseaudio AB> driver. I've never heard of it!!! Could you inform me of the PULSEAUDIO DRIVER in detail? Thanks. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ Think. -- The IBM slogan --
On 22.01.2022 14:12, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: [oS-en] How can I play a sound from a script? Message-ID : <b26ad356-5712-6ca9-6f56-d7999ceccdff@gmail.com> Date & Time: Fri, 21 Jan 2022 21:30:18 +0300
[AB] == Andrei Borzenkov <arvidjaar@gmail.com> has written:
AB> On 21.01.2022 16:50, Carlos E. R. wrote:
[...] AB> That sounds similar to what I observed using mpv with pulseaudio AB> driver.
I've never heard of it!!!
Could you inform me of the PULSEAUDIO DRIVER in detail?
Hello, In the Message; Subject : Re: How can I play a sound from a script? Message-ID : <783d8754-1b7f-4261-420c-654fac888f4b@gmail.com> Date & Time: Sat, 22 Jan 2022 15:41:33 +0300 [AB] == Andrei Borzenkov <arvidjaar@gmail.com> has written: AB> On 22.01.2022 14:12, Masaru Nomiya wrote: AB>>> That sounds similar to what I observed using mpv with pulseaudio AB>>> driver. MN> > I've never heard of it!!! MN> > MN> > Could you inform me of the PULSEAUDIO DRIVER in detail? AB> https://github.com/mpv-player/mpv/issues/3754 I see; Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel But, where is the description of the pulseaudio driver? Regards, & Good Nilght. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ Think. -- The IBM slogan --
On 22.01.2022 16:04, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: How can I play a sound from a script? Message-ID : <783d8754-1b7f-4261-420c-654fac888f4b@gmail.com> Date & Time: Sat, 22 Jan 2022 15:41:33 +0300
[AB] == Andrei Borzenkov <arvidjaar@gmail.com> has written:
AB> On 22.01.2022 14:12, Masaru Nomiya wrote:
AB>>> That sounds similar to what I observed using mpv with pulseaudio AB>>> driver.
MN> > I've never heard of it!!! MN> > MN> > Could you inform me of the PULSEAUDIO DRIVER in detail?
AB> https://github.com/mpv-player/mpv/issues/3754
I see;
Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel
But, where is the description of the pulseaudio driver?
This is mpv driver. --ao=<driver> Specify the audio output drivers to be used. See AUDIO OUTPUT DRIVERS for de‐ tails and descriptions of available drivers. pulse PulseAudio audio output driver
Hello, In the Message; Subject : Re: How can I play a sound from a script? Message-ID : <6d0f2894-f8a6-ccc9-e934-0bed962176c6@gmail.com> Date & Time: Sat, 22 Jan 2022 21:08:33 +0300 [AB] == Andrei Borzenkov <arvidjaar@gmail.com> has written: AB> On 22.01.2022 16:04, Masaru Nomiya wrote: AB> > Hello, [...] AB>>> https://github.com/mpv-player/mpv/issues/3754 MN>> I see; MN>> Kernel driver in use: snd_hda_intel MN>> Kernel modules: snd_hda_intel MN>> MN>> But, where is the description of the pulseaudio driver? AB> This is mpv driver. AB> --ao=<driver> AB> Specify the audio output drivers to be used. See AUDIO OUTPUT DRIVERS for de‐ AB> tails and descriptions of available drivers. AB> pulse PulseAudio audio output driver Ah, I see. In mpv, it is written as driver. Strictly speaking, it should be written as a output plugin. I usually use the alsa plugin, not the pulseaudio plugin. The reason is the same as yours. Thanks. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ "Bill! You married with Computer. Not with Me!" "No..., with money."
Am 21.01.22 um 13:21 schrieb Carlos E. R.:
Hi,
I want to play a sound from a script, for example to signal it finished, but I can't.
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
try: for gstreamer cli: gst123 have no oga file to try, but gst123 plays all gstreamer is able to. simoN -- www.becherer.de
On 21/01/2022 13.44, Simon Becherer wrote:
Am 21.01.22 um 13:21 schrieb Carlos E. R.:
Hi,
I want to play a sound from a script, for example to signal it finished, but I can't.
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
try: for gstreamer cli:
gst123
have no oga file to try, but gst123 plays all gstreamer is able to.
cer@Erebor4:~> gst-play-1.0 /usr/share/sounds/freedesktop/stereo/bell.oga Press 'k' to see a list of keyboard shortcuts. Now playing /usr/share/sounds/freedesktop/stereo/bell.oga Redistribute latency... 0:00:00.1 / 0:00:00.1 Reached end of play list. cer@Erebor4:~> (silence...) cer@Erebor4:~> gst123 /usr/share/sounds/freedesktop/stereo/bell.oga Playing file:///usr/share/sounds/freedesktop/stereo/bell.oga Time: 0:00:00.12 of 0:00:00.13 | Bitrate: 192.0 kbit/sec cer@Erebor4:~> gst123 /usr/share/sounds/freedesktop/stereo/bell.oga Playing file:///usr/share/sounds/freedesktop/stereo/bell.oga Time: 0:00:00.12 of 0:00:00.13 | Bitrate: 192.0 kbit/sec cer@Erebor4:~> (silence...) gst123 /usr/share/sounds/freedesktop/stereo/dialog-warning.oga can be heard. cer@Erebor4:~> gst123 --volume=100 /usr/share/sounds/freedesktop/stereo/bell.oga Playing file:///usr/share/sounds/freedesktop/stereo/bell.oga Time: 0:00:00.11 of 0:00:00.13 | Bitrate: 192.0 kbit/sec cer@Erebor4:~> (silence...) cer@Erebor4:~> gst123 --volume=100 /usr/share/sounds/freedesktop/stereo/dialog-warning.oga Playing file:///usr/share/sounds/freedesktop/stereo/dialog-warning.oga Time: 0:00:00.38 of 0:00:00.49 | Bitrate: 160.0 kbit/sec cer@Erebor4:~> gst123 /usr/share/sounds/freedesktop/stereo/dialog-warning.oga Playing file:///usr/share/sounds/freedesktop/stereo/dialog-warning.oga Time: 0:00:00.38 of 0:00:00.49 | Bitrate: 160.0 kbit/sec cer@Erebor4:~> (silence...) As root: Erebor4:~ # su - cer -c "gst123 /usr/share/sounds/freedesktop/stereo/dialog-warning.oga" Playing file:///usr/share/sounds/freedesktop/stereo/dialog-warning.oga Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': Connection refused AL lib: (EE) ALCplaybackAlsa_open: Could not open playback device 'default': Connection refused Time: 0:00:00.42 of 0:00:00.49 | Bitrate: 160.0 kbit/sec Erebor4:~ # (silence...) -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
Am 21.01.22 um 14:09 schrieb Carlos E. R.:
cer@Erebor4:~> gst123 --volume=100 /usr/share/sounds/freedesktop/stereo/bell.oga
Playing file:///usr/share/sounds/freedesktop/stereo/bell.oga Time: 0:00:00.11 of 0:00:00.13 | Bitrate: 192.0 kbit/sec
cer@Erebor4:~>
(silence...)
gst123 bell.oga Playing file:///usr/share/sounds/freedesktop/stereo/bell.oga Time: 0:00:00.09 of 0:00:00.13 | Bitrate: 192,0 kbit/sec hear a "ploig" as root: gst123 bell.oga Playing file:///usr/share/sounds/freedesktop/stereo/bell.oga XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) Time: 0:00:00.06 of 0:00:00.13 | Bitrate: 192,0 kbit/sec silence. so i guess something at your gstremer is not set correct. simoN -- www.becherer.de
On 23/01/2022 12.36, Simon Becherer wrote:
Am 21.01.22 um 14:09 schrieb Carlos E. R.:
cer@Erebor4:~> gst123 --volume=100 /usr/share/sounds/freedesktop/stereo/bell.oga
Playing file:///usr/share/sounds/freedesktop/stereo/bell.oga Time: 0:00:00.11 of 0:00:00.13 | Bitrate: 192.0 kbit/sec
cer@Erebor4:~>
(silence...)
gst123 bell.oga
Playing file:///usr/share/sounds/freedesktop/stereo/bell.oga Time: 0:00:00.09 of 0:00:00.13 | Bitrate: 192,0 kbit/sec
hear a "ploig"
as root:
gst123 bell.oga
Playing file:///usr/share/sounds/freedesktop/stereo/bell.oga XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) Time: 0:00:00.06 of 0:00:00.13 | Bitrate: 192,0 kbit/sec
silence.
so i guess something at your gstremer is not set correct.
You have been missing developments. I have to call the command twice: gst123 bell.oga ; gst123 bell.oga The first one is silent, the second one works perfectly. Wait a moment, repeat, same symptoms. This with every command - except videos on youtube, they seem to work instantly. Vlc also seems to work instantly. Well, this minute sound works fine, yesterday it had issues. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
W dniu 21.01.2022 o 13:21, Carlos E. R. pisze:
Hi,
I want to play a sound from a script, for example to signal it finished, but I can't.
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
aplay and paplay seem to use some low-level raw audio formats. I suggest using gstreamer: gst-play-1.0 /usr/share/sounds/freedesktop/stereo/bell.oga
Second problem: I can not play them as root, and I do need them as rootm because those scripts run as root.
That's a much more difficult, than it seems. Pulseaudio is running as a user you're logged in. The integration with logind and udev allows to give access to soundcard to current active user. If you're running your script as root, you can use sudo to play the sound as your user. I found this works: sudo -u etam env XDG_RUNTIME_DIR=/run/user/1000 gst-play-1.0 /usr/share/sounds/freedesktop/stereo/bell.oga
On 21/01/2022 13.50, Adam Mizerski wrote:
W dniu 21.01.2022 o 13:21, Carlos E. R. pisze:
Hi,
I want to play a sound from a script, for example to signal it finished, but I can't.
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
aplay and paplay seem to use some low-level raw audio formats.
I suggest using gstreamer: gst-play-1.0 /usr/share/sounds/freedesktop/stereo/bell.oga
Tried a moment ago. I get silence.
Second problem: I can not play them as root, and I do need them as rootm because those scripts run as root.
That's a much more difficult, than it seems. Pulseaudio is running as a user you're logged in. The integration with logind and udev allows to give access to soundcard to current active user.
If you're running your script as root, you can use sudo to play the sound as your user. I found this works: sudo -u etam env XDG_RUNTIME_DIR=/run/user/1000 gst-play-1.0 /usr/share/sounds/freedesktop/stereo/bell.oga
Thanks. At least, it runs, but I get silence. vlc runs with that, but starts a GUI, and I barely hear anything. Erebor4:~ # sudo -u cer env XDG_RUNTIME_DIR=/run/user/1000 vlc /usr/share/sounds/freedesktop/stereo/bell.oga VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2) [000055fb1f352e70] main interface error: no suitable interface module [000055fb1f2614e0] main libvlc error: interface "globalhotkeys,none" initialization failed [000055fb1f2614e0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. [000055fb1f352e70] skins2 interface error: cannot initialize OSFactory [000055fb1f352e70] [cli] lua interface: Listening on host "*console". VLC media player 3.0.16 Vetinari Command Line Interface initialized. Type `help' for help.
volume 256.0 q Shutting down. [000055fb1f352e70] [cli] lua interface: Requested shutdown. Erebor4:~ #
-- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
Hello, In the Message; Subject : [oS-en] How can I play a sound from a script? Message-ID : <56e6e016-af14-49fb-6ee0-5733377d284b@telefonica.net> Date & Time: Fri, 21 Jan 2022 13:21:33 +0100 [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: CER> Hi, CER> I want to play a sound from a script, for example to signal it finished, but I CER> can't. CER> First problem: I can't find a CLI command able to play the sound files I want, CER> found in the default installed system: er@Erebor4:~> aplay /usr/share/sounds/freedesktop/stereo/bell.oga CER> Playing raw data '/usr/share/sounds/freedesktop/stereo/bell.oga' : Unsigned 8 CER> bit, Rate 8000 Hz, Mono CER> ^CAborted by signal Interrupt... CER> cer@Erebor4:~> CER> This command produces horrible noise with any .oga file I try. For oga files, it is best to use ogg123, which is included in vorbis-tools. Regards. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ "Tim Cook, the C.E.O. of Apple, said earlier this year that he would not let his nephew join social networks. Bill Gates banned cellphone until his children were teenagers, and Melinda Gates wrote that she wished they had waited even longer. Steve Jobs would not let his young children near iPads." -- The New York Times --
On 21/01/2022 13.50, Masaru Nomiya wrote:
[CER] == "Carlos E. R." <> has written:
For oga files, it is best to use ogg123, which is included in vorbis-tools.
Thanks. It runs, but I hear nothing. cer@Erebor4:~> ogg123 /usr/share/sounds/freedesktop/stereo/dialog-warning.oga Audio Device: PulseAudio Output Playing: /usr/share/sounds/freedesktop/stereo/dialog-warning.oga Ogg Vorbis stream: 2 channel, 44100 Hz Done. cer@Erebor4:~> Fails as root: Erebor4:~ # su - cer -c "ogg123 /usr/share/sounds/freedesktop/stereo/dialog-warning.oga" Audio Device: PulseAudio Output Playing: /usr/share/sounds/freedesktop/stereo/dialog-warning.oga Ogg Vorbis stream: 2 channel, 44100 Hz ERROR: Cannot open device pulse. Erebor4:~ # Runs this way, but I hear nothing: Erebor4:~ # sudo -u cer env XDG_RUNTIME_DIR=/run/user/1000 ogg123 /usr/share/sounds/freedesktop/stereo/dialog-warning.oga Audio Device: PulseAudio Output Playing: /usr/share/sounds/freedesktop/stereo/dialog-warning.oga Ogg Vorbis stream: 2 channel, 44100 Hz Done. Erebor4:~ # The volume is cranked to maximum, and now even with vlc as user I hear nothing - before it worked. But as VLC has a volume control and the GUI does not close automatically, I touch it a micra, and now I have sound with vlc. still no sound with ogg123 -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
* Carlos E. R. <robin.listas@telefonica.net> [01-21-22 08:22]:
On 21/01/2022 13.50, Masaru Nomiya wrote:
[CER] == "Carlos E. R." <> has written:
For oga files, it is best to use ogg123, which is included in vorbis-tools.
Thanks. It runs, but I hear nothing.
cer@Erebor4:~> ogg123 /usr/share/sounds/freedesktop/stereo/dialog-warning.oga
Audio Device: PulseAudio Output
Playing: /usr/share/sounds/freedesktop/stereo/dialog-warning.oga Ogg Vorbis stream: 2 channel, 44100 Hz
Done. cer@Erebor4:~>
Fails as root:
Erebor4:~ # su - cer -c "ogg123 /usr/share/sounds/freedesktop/stereo/dialog-warning.oga"
Audio Device: PulseAudio Output
Playing: /usr/share/sounds/freedesktop/stereo/dialog-warning.oga Ogg Vorbis stream: 2 channel, 44100 Hz ERROR: Cannot open device pulse.
Erebor4:~ #
Runs this way, but I hear nothing:
Erebor4:~ # sudo -u cer env XDG_RUNTIME_DIR=/run/user/1000 ogg123 /usr/share/sounds/freedesktop/stereo/dialog-warning.oga
Audio Device: PulseAudio Output
Playing: /usr/share/sounds/freedesktop/stereo/dialog-warning.oga Ogg Vorbis stream: 2 channel, 44100 Hz
Done. Erebor4:~ #
The volume is cranked to maximum, and now even with vlc as user I hear nothing - before it worked. But as VLC has a volume control and the GUI does not close automatically, I touch it a micra, and now I have sound with vlc.
still no sound with ogg123
-- Cheers / Saludos,
Carlos E. R.
(from oS Leap 15.3 x86_64 (Erebor-4))
systemctl status --user wireplumber.service -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet oftc What sort of day was it? A day like all days, filled with those events that alter and illuminate our times...
On 21/01/2022 14.50, Patrick Shanahan wrote:
* Carlos E. R. <> [01-21-22 08:22]:
On 21/01/2022 13.50, Masaru Nomiya wrote:
The volume is cranked to maximum, and now even with vlc as user I hear nothing - before it worked. But as VLC has a volume control and the GUI does not close automatically, I touch it a micra, and now I have sound with vlc.
still no sound with ogg123
Play commands have to be run twice so that they work.
systemctl status --user wireplumber.service
cer@Erebor4:~> systemctl status --user wireplumber.service Unit wireplumber.service could not be found. cer@Erebor4:~> Erebor4:~ # systemctl status --user wireplumber.service Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user) Erebor4:~ # This is a freshly installed Leap 15.3. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
Hello, On Fri, 21 Jan 2022, Carlos E. R. wrote:
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
mpv, mplayer, 'ffplay -nodisp -autoexit'
I can play sounds with VLC, but not being a CLI command, it starts a GUI that then I have to close manually. "vlc --help" is huge, I have not seen a way to play a sound and exit.
'cvlc --play-and-exit', which is obvious once you've found it ;) These four players should play just about anything besides midi or tracker files ;) For the pulseaudio problem, see Adam's answer... -dnh -- printk("NULL POINTER IDIOT\n"); linux-2.6.6/drivers/media/dvb/dvb-core/dvb_filter.c
On 21/01/2022 14.08, David Haller wrote:
Hello,
On Fri, 21 Jan 2022, Carlos E. R. wrote:
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
mpv, mplayer, 'ffplay -nodisp -autoexit'
cer@Erebor4:~> ffplay -nodisp -autoexit /usr/share/sounds/freedesktop/stereo/dialog-warning.oga runs, but I get silence.
I can play sounds with VLC, but not being a CLI command, it starts a GUI that then I have to close manually. "vlc --help" is huge, I have not seen a way to play a sound and exit.
'cvlc --play-and-exit', which is obvious once you've found it ;)
Thanks :-) runs, but I get silence. I then try "vlc -play-and-exit" and after a way I get the sound. Now cvlc also produces sound.
These four players should play just about anything besides midi or tracker files ;)
For the pulseaudio problem, see Adam's answer...
Thanks! This does work, but only the second run, the first run is silent. Repeatable: after I type something here in this post, it fails, then it works. Same problem with ogg123, the first time no sound, the second works. Same issue with other programs as user! I have to try twice. Weird. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
Carlos E. R. wrote:
On 21/01/2022 14.08, David Haller wrote:
Hello,
On Fri, 21 Jan 2022, Carlos E. R. wrote:
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
mpv, mplayer, 'ffplay -nodisp -autoexit'
cer@Erebor4:~> ffplay -nodisp -autoexit /usr/share/sounds/freedesktop/stereo/dialog-warning.oga
runs, but I get silence.
FWIW, it works here, on Leap 15.2. Volume setting? Maybe try adding '-volume 50' to the above. -- Per Jessen, Zürich (4.2°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland.
On 21/01/2022 16.15, Per Jessen wrote:
Carlos E. R. wrote:
On 21/01/2022 14.08, David Haller wrote:
Hello,
On Fri, 21 Jan 2022, Carlos E. R. wrote:
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
mpv, mplayer, 'ffplay -nodisp -autoexit'
cer@Erebor4:~> ffplay -nodisp -autoexit /usr/share/sounds/freedesktop/stereo/dialog-warning.oga
runs, but I get silence.
FWIW, it works here, on Leap 15.2. Volume setting? Maybe try adding '-volume 50' to the above.
Nope, I have to run any sound command twice. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
Hello, Sorry, I had missed. In the Message; Subject : [oS-en] How can I play a sound from a script? Message-ID : <56e6e016-af14-49fb-6ee0-5733377d284b@telefonica.net> Date & Time: Fri, 21 Jan 2022 13:21:33 +0100 [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: [...] CER> Second problem: I can not play them as root, and I do need them CER> as rootm because those scripts run as root. Once the pipewire packages are installed, you can get sound; # pw-play [sound file] Regards, and Good Night. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ "Bill! You married with Computer. Not with Me!" "No..., with money."
On 21/01/2022 14.40, Masaru Nomiya wrote:
Hello,
Sorry, I had missed.
In the Message;
...
[CER] == "Carlos E. R." <...> has written:
[...] CER> Second problem: I can not play them as root, and I do need them CER> as rootm because those scripts run as root.
Once the pipewire packages are installed, you can get sound;
# pw-play [sound file]
I guess there is more to that that simply installing the packages. Erebor4:~ # pw-play /usr/share/sounds/freedesktop/stereo/dialog-warning.oga error: pw_context_connect() failed: Host is down Erebor4:~ # cer@Erebor4:~> pw-play /usr/share/sounds/freedesktop/stereo/dialog-warning.oga error: pw_context_connect() failed: Host is down cer@Erebor4:~> -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
* Carlos E. R. <robin.listas@telefonica.net> [01-21-22 07:22]:
Hi,
I want to play a sound from a script, for example to signal it finished, but I can't.
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
er@Erebor4:~> aplay /usr/share/sounds/freedesktop/stereo/bell.oga Playing raw data '/usr/share/sounds/freedesktop/stereo/bell.oga' : Unsigned 8 bit, Rate 8000 Hz, Mono ^CAborted by signal Interrupt... cer@Erebor4:~>
This command produces horrible noise with any .oga file I try.
cer@Erebor4:~> madplay /usr/share/sounds/freedesktop/stereo/bell.oga MPEG Audio Decoder 0.15.2 (beta) - Copyright © 2000-2004 Robert Leslie et al. audio: No such file or directory cer@Erebor4:~>
cer@Erebor4:~> paplay /usr/share/sounds/freedesktop/stereo/bell.oga cer@Erebor4:~>
(silence...)
cer@Erebor4:~> play /usr/share/sounds/freedesktop/stereo/bell.oga
/usr/share/sounds/freedesktop/stereo/bell.oga:
File Size: 8.50k Bit Rate: 487k Encoding: Vorbis Channels: 2 @ 16-bit Samplerate: 44100Hz Replaygain: off Duration: 00:00:00.14
In:100% 00:00:00.14 [00:00:00.00] Out:6.15k [ ====|==== ] Clip:0 Done. cer@Erebor4:~>
(silence...)
I can play sounds with VLC, but not being a CLI command, it starts a GUI that then I have to close manually. "vlc --help" is huge, I have not seen a way to play a sound and exit.
I can probably convert a sound to .wav, and play that one. play, aplay, and paplay all work that way.
Second problem: I can not play them as root, and I do need them as rootm because those scripts run as root.
Erebor4:~ # su cer - -c vlc /usr/share/sounds/freedesktop/stereo/service-logout.oga VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2) [000055713e92b640] vlcpulse audio output error: PulseAudio server connection failure: *Connection refused* [000055713e8494e0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-cer' [000055713e84ba40] main playlist: playlist is empty QObject::~QObject: Timers cannot be stopped from another thread Erebor4:~ #
Erebor4:~ # vlc /usr/share/sounds/freedesktop/stereo/service-logout.oga VLC is not supposed to be run as root. Sorry. If you need to use real-time priorities and/or privileged TCP ports you can use vlc-wrapper (make sure it is Set-UID root and cannot be run by non-trusted users first). Erebor4:~ #
Erebor4:~ # su cer - -c "aplay /usr/share/sounds/freedesktop/stereo/service-logout.oga" ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
aplay: main:830: audio open error: Connection refused Erebor4:~ #
Erebor4:~ # su cer - -c "paplay /usr/share/sounds/freedesktop/stereo/service-logout.oga" Connection failure: Connection refused pa_context_connect() failed: Connection refused Erebor4:~ #
stuck.
-- Cheers / Saludos,
Carlos E. R.
(from oS Leap 15.3 x86_64 (Erebor-4))
/usr/bin/play from package sox works for me -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet oftc What sort of day was it? A day like all days, filled with those events that alter and illuminate our times...
On Saturday 22 January 2022, Patrick Shanahan wrote:
* Carlos E. R. <robin.listas@telefonica.net> [01-21-22 07:22]:
Hi,
I want to play a sound from a script, for example to signal it finished, but I can't.
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
er@Erebor4:~> aplay /usr/share/sounds/freedesktop/stereo/bell.oga Playing raw data '/usr/share/sounds/freedesktop/stereo/bell.oga' : Unsigned 8 bit, Rate 8000 Hz, Mono ^CAborted by signal Interrupt... cer@Erebor4:~>
This command produces horrible noise with any .oga file I try.
cer@Erebor4:~> madplay /usr/share/sounds/freedesktop/stereo/bell.oga MPEG Audio Decoder 0.15.2 (beta) - Copyright © 2000-2004 Robert Leslie et al. audio: No such file or directory cer@Erebor4:~>
cer@Erebor4:~> paplay /usr/share/sounds/freedesktop/stereo/bell.oga cer@Erebor4:~>
(silence...)
cer@Erebor4:~> play /usr/share/sounds/freedesktop/stereo/bell.oga
/usr/share/sounds/freedesktop/stereo/bell.oga:
File Size: 8.50k Bit Rate: 487k Encoding: Vorbis Channels: 2 @ 16-bit Samplerate: 44100Hz Replaygain: off Duration: 00:00:00.14
In:100% 00:00:00.14 [00:00:00.00] Out:6.15k [ ====|==== ] Clip:0 Done. cer@Erebor4:~>
(silence...)
I can play sounds with VLC, but not being a CLI command, it starts a GUI that then I have to close manually. "vlc --help" is huge, I have not seen a way to play a sound and exit.
I can probably convert a sound to .wav, and play that one. play, aplay, and paplay all work that way.
Second problem: I can not play them as root, and I do need them as rootm because those scripts run as root.
Erebor4:~ # su cer - -c vlc /usr/share/sounds/freedesktop/stereo/service-logout.oga VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2) [000055713e92b640] vlcpulse audio output error: PulseAudio server connection failure: *Connection refused* [000055713e8494e0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-cer' [000055713e84ba40] main playlist: playlist is empty QObject::~QObject: Timers cannot be stopped from another thread Erebor4:~ #
Erebor4:~ # vlc /usr/share/sounds/freedesktop/stereo/service-logout.oga VLC is not supposed to be run as root. Sorry. If you need to use real-time priorities and/or privileged TCP ports you can use vlc-wrapper (make sure it is Set-UID root and cannot be run by non-trusted users first). Erebor4:~ #
Erebor4:~ # su cer - -c "aplay /usr/share/sounds/freedesktop/stereo/service-logout.oga" ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
aplay: main:830: audio open error: Connection refused Erebor4:~ #
Erebor4:~ # su cer - -c "paplay /usr/share/sounds/freedesktop/stereo/service-logout.oga" Connection failure: Connection refused pa_context_connect() failed: Connection refused Erebor4:~ #
stuck.
-- Cheers / Saludos,
Carlos E. R.
(from oS Leap 15.3 x86_64 (Erebor-4))
/usr/bin/play from package sox works for me
Second the suggestion of sox: Name : sox Summary : Sound Conversion Tools Description : SOX is intended to be the Swiss Army knife of sound processing tools. It does many things, it just does not do them all well. Sooner or later it will come in very handy. SOX is really only usable day-to-day if you hide the wacky options with one-line shell scripts. Example: /usr/bin/play -v 0.2 /usr/share/sounds/Oxygen-Im-Sms.ogg Cheers, Michael
On 21/01/2022 21.47, Michael Hamilton wrote:
On Saturday 22 January 2022, Patrick Shanahan wrote:
* Carlos E. R. <> [01-21-22 07:22]:
Hi,
/usr/bin/play from package sox works for me
Second the suggestion of sox:
Name : sox Summary : Sound Conversion Tools Description : SOX is intended to be the Swiss Army knife of sound processing tools. It does many things, it just does not do them all well. Sooner or later it will come in very handy. SOX is really only usable day-to-day if you hide the wacky options with one-line shell scripts.
Example:
/usr/bin/play -v 0.2 /usr/share/sounds/Oxygen-Im-Sms.ogg
I tried it already, it has the same problem as all the others. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
* Carlos E. R. <robin.listas@telefonica.net> [01-21-22 16:32]:
On 21/01/2022 21.47, Michael Hamilton wrote:
On Saturday 22 January 2022, Patrick Shanahan wrote:
* Carlos E. R. <> [01-21-22 07:22]:
Hi,
/usr/bin/play from package sox works for me
Second the suggestion of sox:
Name : sox Summary : Sound Conversion Tools Description : SOX is intended to be the Swiss Army knife of sound processing tools. It does many things, it just does not do them all well. Sooner or later it will come in very handy. SOX is really only usable day-to-day if you hide the wacky options with one-line shell scripts. Example:
/usr/bin/play -v 0.2 /usr/share/sounds/Oxygen-Im-Sms.ogg
I tried it already, it has the same problem as all the others.
you have a problem local to *your* system. the problem is not "/usr/bin/play". -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet oftc What sort of day was it? A day like all days, filled with those events that alter and illuminate our times...
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 El 2022-01-22 a las 00:29 -0500, Patrick Shanahan escribió:
* Carlos E. R. <t> [01-21-22 16:32]:
On 21/01/2022 21.47, Michael Hamilton wrote:
On Saturday 22 January 2022, Patrick Shanahan wrote:
* Carlos E. R. <> [01-21-22 07:22]:
Hi,
/usr/bin/play from package sox works for me
Second the suggestion of sox:
Name : sox Summary : Sound Conversion Tools Description : SOX is intended to be the Swiss Army knife of sound processing tools. It does many things, it just does not do them all well. Sooner or later it will come in very handy. SOX is really only usable day-to-day if you hide the wacky options with one-line shell scripts. Example:
/usr/bin/play -v 0.2 /usr/share/sounds/Oxygen-Im-Sms.ogg
I tried it already, it has the same problem as all the others.
you have a problem local to *your* system. the problem is not "/usr/bin/play".
No. As Andrei has explained, it is a bug in Pulse. - -- Cheers Carlos E. R. (from openSUSE Leap 15.3 x86_64 (Minas Tirith)) -----BEGIN PGP SIGNATURE----- iJIEAREIADoWIQQt/vKEw5659AgM/X2NrxRtxRYzXAUCYeve+hwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJEI2vFG3FFjNcCGgA/A8zTvll64+mo0H1HaTB a6unNtPiVuk9DELIjGjhLrvdAQCKFx58wEKl4+QAYOnK2eJ6ulcvNlYORss0YmCh 55Ep8Q== =meK0 -----END PGP SIGNATURE-----
Carlos E. R. wrote:
Hi,
I want to play a sound from a script, for example to signal it finished, but I can't.
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
er@Erebor4:~> aplay /usr/share/sounds/freedesktop/stereo/bell.oga Playing raw data '/usr/share/sounds/freedesktop/stereo/bell.oga' : Unsigned 8 bit, Rate 8000 Hz, Mono ^CAborted by signal Interrupt... cer@Erebor4:~>
This command produces horrible noise with any .oga file I try.
I was going to say 'play', I used that in my voip conversion project. Playing .oga or midi produces horrible results, but .wav worked fine.
Second problem: I can not play them as root, and I do need them as rootm because those scripts run as root.
So run it as a regular user, with sudo ? sudo -u per XDG_RUNTIME_DIR=/run/user/1000 aplay /home/per/Documents/telephone-sit.wav -- Per Jessen, Zürich (3.8°C)
On 21/01/2022 16.10, Per Jessen wrote:
Carlos E. R. wrote:
Hi,
I want to play a sound from a script, for example to signal it finished, but I can't.
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
er@Erebor4:~> aplay /usr/share/sounds/freedesktop/stereo/bell.oga Playing raw data '/usr/share/sounds/freedesktop/stereo/bell.oga' : Unsigned 8 bit, Rate 8000 Hz, Mono ^CAborted by signal Interrupt... cer@Erebor4:~>
This command produces horrible noise with any .oga file I try.
I was going to say 'play', I used that in my voip conversion project. Playing .oga or midi produces horrible results, but .wav worked fine.
Second problem: I can not play them as root, and I do need them as rootm because those scripts run as root.
So run it as a regular user, with sudo ?
sudo -u per XDG_RUNTIME_DIR=/run/user/1000 aplay /home/per/Documents/telephone-sit.wav
Well, I was doing something similar with su instead of sudo, but without that XDG var; Adam Mizerski told about that. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.3 x86_64 (Erebor-4))
Per Jessen wrote:
Carlos E. R. wrote:
Hi,
I want to play a sound from a script, for example to signal it finished, but I can't.
First problem: I can't find a CLI command able to play the sound files I want, found in the default installed system:
er@Erebor4:~> aplay /usr/share/sounds/freedesktop/stereo/bell.oga Playing raw data '/usr/share/sounds/freedesktop/stereo/bell.oga' : Unsigned 8 bit, Rate 8000 Hz, Mono ^CAborted by signal Interrupt... cer@Erebor4:~>
This command produces horrible noise with any .oga file I try.
I was going to say 'aplay', I used that in my voip conversion project. Playing .oga or midi produces horrible results, but .wav worked fine.
According to the man page, aplay doesn't play ogg formats, only voc, wav, raw and au. Using ffmpeg, I converted one of the .oga files to .wav and played it with aplay, worked fine. (albeit on leap 15.2). -- Per Jessen, Zürich (3.2°C)
Hello, In the Message; Subject : Re: [oS-en] How can I play a sound from a script? Message-ID : <ssgo7r$8ed$1@saturn.local.net> Date & Time: Sat, 22 Jan 2022 12:02:19 +0100 [PJ] == Per Jessen <per@computer.org> has written: PJ> Per Jessen wrote: [...] PJ> According to the man page, aplay doesn't play ogg formats, only voc, PJ> wav, raw and au. Using ffmpeg, I converted one of the .oga files PJ> to .wav and played it with aplay, worked fine. (albeit on leap PJ> 15.2). That't it! The most important thing to know is that the calros's sound system is broken. Thanks. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ Think. -- The IBM slogan --
On 22/01/2022 12.19, Masaru Nomiya wrote:
Hello,
[PJ] == Per Jessen <per@computer.org> has written:
PJ> Per Jessen wrote:
[...] PJ> According to the man page, aplay doesn't play ogg formats, only voc, PJ> wav, raw and au. Using ffmpeg, I converted one of the .oga files PJ> to .wav and played it with aplay, worked fine. (albeit on leap PJ> 15.2).
That't it!
The most important thing to know is that the calros's sound system is broken.
It is a pulse bug. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
Hello, In the Message; Subject : Re: [oS-en] How can I play a sound from a script? Message-ID : <38dc8968-a5ec-4063-dfb5-e35e6fc140ec@telefonica.net> Date & Time: Sat, 22 Jan 2022 13:49:48 +0100 [CER] == "Carlos E. R." <robin.listas@telefonica.net> has written: [...] MN>> The most important thing to know is that the calros's sound system is MN> > broken. CER> It is a pulse bug. You have the good grounds to say BUG, right? Please show them logically. Regards, and Good Night. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ galaxy.dti.ne.jp ┃\/彡 ┗━━┛ Think. -- The IBM slogan --
participants (11)
-
Adam Mizerski
-
Andrei Borzenkov
-
Carlos E. R.
-
Dave Howorth
-
David Haller
-
Masaru Nomiya
-
Michael Hamilton
-
Patrick Shanahan
-
Per Jessen
-
Simon Becherer
-
tooth pik