Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The syntax of sox (and therefor play) has changed a lot over the years. What is the exact command being attempted? And what is the deets on the file being attempted?
This is tough. I appreciate your attention and effort.
Quote:
Originally Posted by ondoho
so 'play' cannot play any file, as stated previously. my bad.
anyhow, have you tried giving it a precise definition of the format you are feeding it, instead of relying on its auto-detection?
does sox use its own audio decoding libraries, or does it rely on others?
is your system (debian jessie i presume) up-to-date, is sox from the standard repositories, did you reboot after system upgrade?
I can only answer the last question. I didn't upgrade and I didn't reboot when the problem happened. That notification script plays often (whenever I select and copy text, for example). It was working fine. Then I suspended to RAM then I resumed from suspended mode, and 'play' wasn't working anymore.
Do they pretend to work? Or do they crash outright?
If pretend, check that the file has audible content. And that the levels on your soundcard are not muted. Don't rule out that pulse can assert itself if you've installed some new stuff. Some stuff is configured for pulse by default. Like java with /etc/java-7-openjdk/sound.properties, in debian jessie it defaults to pulse (4 lines), but the commented out alsa (4 lines) are right next to the pulse ones.
Do they pretend to work? Or do they crash outright?
If pretend, check that the file has audible content. And that the levels on your soundcard are not muted. Don't rule out that pulse can assert itself if you've installed some new stuff. Some stuff is configured for pulse by default. Like java with /etc/java-7-openjdk/sound.properties, in debian jessie it defaults to pulse (4 lines), but the commented out alsa (4 lines) are right next to the pulse ones.
They pretend to work. There is just no sound. The file is audible in other ways, such as Audacious.
Like I said before, I can play that file in other programs, so nothing is muted.
I just ran into something new. Another script, used less often, played a sound. That one doesn't use 'play' it uses a Tcl script with the Snack extension/module, allegedly with no external dependencies. That script plays the mac-alarm.wav file, but it can play other sounds if I want it to. Then things get even more confusing:
Tcl script plays "mac-alarm.wav"
Tcl script doesn't play "Abrir.wav"
sox/play plays "mac-alarm.wav"!
sox/play doesn't play "Abrir.wav" (but it used to!)
Audacious plays both files, but it doesn't solve my problem because it isn't a command line app and won't run in background, i.e. without bringing up a GUI.
Then I had an idea: why not use mplayer? Well...
Code:
luc[17516-0]> mplayer /home/luc/sounds/Abrir.wav
Failed to read /etc/mplayer/mplayer.conf.local: No such file or directory
Warning unknown option include at line 177
MPlayer 1.3.0-4.9.2 (C) 2000-2016 MPlayer Team
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing /home/luc/sounds/Abrir.wav.
libavformat version 57.25.100 (internal)
Audio only file format detected.
Load subtitles in /home/luc/sounds/
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 22050 Hz, 1 ch, s16le, 352.8 kbit/100.00% (ratio: 44100->44100)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
AO: [alsa] 44100Hz 1ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 0.0 (00.0) of 0.2 (00.1) ??,?%
Exiting... (End of file)
Despite all the output, no sound comes out of it. For some reason, I also have mplayer2 installed. Let's see:
Code:
luc[17517-0]> mplayer2 /home/luc/sounds/Abrir.wav
MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team
Cannot open file '/home/luc/.mplayer2/input.conf': No such file or directory
Failed to open /home/luc/.mplayer2/input.conf.
Cannot open file '/etc/mplayer2/input.conf': No such file or directory
Failed to open /etc/mplayer2/input.conf.
Playing /home/luc/sounds/Abrir.wav.
Detected file format: WAV / WAVE (Waveform Audio) (libavformat)
[lavf] stream 0: audio (pcm_s16le), -aid 0
Clip info:
copyright: 1995-1998 Microsoft Corporation
Load subtitles in /home/luc/sounds/
Selected audio codec: Uncompressed PCM [pcm]
AUDIO: 22050 Hz, 1 ch, s16le, 352.8 kbit/100.00% (ratio: 44100->44100)
AO: [pulse] Init failed: Connection refused
AO: [alsa] 44100Hz 1ch s16le (2 bytes per sample)
[AO_ALSA] Unable to find simple control 'Master',0.
Video: no video
Starting playback...
A: 0.2 (00.1) of 0.2 (00.1) ??,?%
Exiting... (End of file)
That one works! Let's update the table:
Tcl script plays "mac-alarm.wav"
Tcl script doesn't play "Abrir.wav"
sox/play plays "mac-alarm.wav"!
sox/play doesn't play "Abrir.wav" (but it used to!)
mplayer plays neither
mplayer2 plays both
That's good enough. I can replace sox/play with mplayer2 in my script because mplayer2 can play all fil... Wait, no, not all files. There is still one.
There is one sound that my script also uses, it's called "tick2.wav"
sox/play, the Tcl script and both mplayer and mplayer2 can't play it. sox/play used to play it before I suspended to RAM a couple of days ago! How can that happen?????!!!!!
There shouldn't be anything wrong with "tick2.wav" because Audacious can play it and sox/play could play it until a couple of days ago.
I tried saving the file with another program, and it didn't work. That shouldn't make any difference, since other programs can play it and I must reiterate that sox/play was working fine until I suspended to RAM. Nothing else was changed.
I'll have to give up on this issue, as I posted about it on the official sox mailing list 4 days ago and haven't heard a peep from them yet. Maybe it's some bug that nobody wants to talk about or maybe nobody has a clue of what could have happened and nobody is interested in finding out.
So much for open source software on an open source OS. :-(
I will format and reinstall everything (as if it were Windows) around July, when I might have some free time.
Something changed, corruption or otherwise. A reinstall is probably warranted since you technically don't know what changed. The process of this thread has been to determine what changed. Using strace on sox (play) to see what all is "opened" and reinstall all the parts to insure good copies would be one way to see if the program changed. There could be bit rot on storage devices so you're a victim of the data lottery, not anything else that failed per say. It could also be configurations, which a fresh install of everything would fix (in theory), but leave you in the dark about what went wrong. Not that you care, until it happens again. And again, or otherwise doesn't get fixed by a new install.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
I posted what I did for a reason... I found that a script I had for my SDR stopped working with "play" after an upgrade but substituting "paplay" with a few changes it worked fine.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.