You are not logged in.
hi,
i usually run a script that woks well, but not today.
here is what it mainly does :
/usr/bin/sox ~/anySong.wav -d #aka play ~/anySong.wav
read yesNo
which outputs :
bash: read: read error: 0: Resource temporarily unavailable
i can reproduce that behaviour in a terminal by typing these commands in a one liner command.
have you got any idea ?
PS:
system is up to date.
bash version is
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
and sox is
SoX v14.4.2
Last edited by N_BaH (2022-09-19 19:32:03)
Offline
Is the sox call crucial??
It would see something leave the stdin in O_NONBLOCK, but I can't locally reproduce this w/ sox.
Did you try this in a clean™ shell (just openend, no other programs ran)?
https://stackoverflow.com/questions/198 … navailable at the bottom has a perl and python script to set the stdin back to blocking.
Offline
Offline
is the sox crucial ?
what else could I use to record/read ogg files ?
Did you try this in a clean™ shell (just openend, no other programs ran)?
yes, new and different Xterms (xterm, urxvt), and "dry" terminal (ttyN) too.
Have you tried to close it with 'sox --options <&-'.
using this trick makes the script run well, now. thank you.
Offline
what else could I use to record/read ogg files ?
What I meant was whether calling sox was crucial to trigger the problem.
Which version/build is it exactly?
pacman -Qi sox
Offline
I didn't meet another program doing such a thing, yet.
$ pacman -Qi sox
Name : sox
Version : 14.4.2+r182+g42b3557e-1
Description : The Swiss Army knife of sound processing tools
Architecture : x86_64
URL : http://sox.sourceforge.net/
Licenses : GPL2 LGPL2.1
Groups : None
Provides : libsox.so=3-64
Depends On : file libid3tag libltdl libpng
Optional Deps : alsa-lib: alsa plugin [installed]
flac: flac plugin [installed]
gsm: gsm plugin [installed]
lame: mp3 plugin [installed]
libao: ao plugin [installed]
libmad: mp3 plugin [installed]
libpulse: pulse plugin [installed]
libsndfile: caf, fap, mat4, mat5, paf, pvf, sd2, sndfile, w64 and xi plugins [installed]
libvorbis: vorbis plugin [installed]
opencore-amr: amr_nb and amr_wb plugins [installed]
opusfile: opus plugin
twolame: mp3 plugin [installed]
wavpack: wavpack plugin [installed]
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 1310.18 KiB
Packager : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date : Thu Sep 15 01:08:34 2022
Install Date : Sun Sep 18 02:15:05 2022
Install Reason : Explicitly installed
Install Script : No
Validated By : SHA-256 Sum
Offline
Ah, it's important to run the commands in a row because the prompt (apparently) sanitizes stdin.
And strace shows that sox indeed runs "fcntl(0, F_SETFL, O_RDWR|O_APPEND|O_NONBLOCK|O_LARGEFILE)" but not anything to suggest it would clean up afterwards.
=> That's a bug, https://sourceforge.net/p/sox/bugs/
(The workaround won't work if one wants to pipe something into sox)
Edit: https://sourceforge.net/p/sox/bugs/273/ … apparently has been a problem in the past.
Last edited by seth (2022-09-20 06:33:47)
Offline