LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 03-13-2017, 02:23 AM   #1
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Rep: Reputation: 110Reputation: 110
No sound from 'play'


I have a script that monitors things and notifies me with sound. It uses the 'play' command to play sounds.

It was working fine. I put the computer to sleep (suspend to RAM) and went to sleep myself. Then I woke up, woke the computer up, and noticed the script is silent. Testing 'play' on command line, it is definitely silent.

Other audio programs work fine, such as Audacious or even Youtube. Only 'play' is silent.

I rebooted. Problem remains.

How does that even happen, and how can I fix it?
 
Old 03-13-2017, 02:42 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by lucmove View Post
Testing 'play' on command line, it is definitely silent.
show us the complete commandline and all the output it produces (preferably with a verbose switch).
 
Old 03-13-2017, 04:23 AM   #3
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Code:
luc[17357-0]> play /home/luc/sounds/Abrir.wav 

/home/luc/sounds/Abrir.wav:

 File Size: 10.6k     Bit Rate: 434k
  Encoding: Signed PCM    
  Channels: 1 @ 16-bit   
Samplerate: 22050Hz      
Replaygain: off         
  Duration: 00:00:00.20  

In:100%  00:00:00.20 [00:00:00.00] Out:8.66k [   ===|===   ]        Clip:0    
Done.

Code:
luc[17358-0]> play -V4 /home/luc/sounds/Abrir.wav 
play DBUG formats: opening format plugin `lsx_alsa_format_fn': library 0x152c680, entry point 0x7f9d3cda88e0

play DBUG formats: opening format plugin `lsx_amr_nb_format_fn': library 0x152dde0, entry point 0x7f9d3c6a4690

play DBUG formats: opening format plugin `lsx_amr_wb_format_fn': library 0x152eb80, entry point 0x7f9d3c2761a0

play DBUG formats: opening format plugin `lsx_caf_format_fn': library 0x152f8f0, entry point 0x7f9d3be5c610

play DBUG formats: opening format plugin `lsx_fap_format_fn': library 0x1531f50, entry point 0x7f9d3b0d1610

play DBUG formats: opening format plugin `lsx_flac_format_fn': library 0x1532730, entry point 0x7f9d3aecc600

play DBUG formats: opening format plugin `lsx_gsm_format_fn': library 0x1533630, entry point 0x7f9d3aabf050

play DBUG formats: opening format plugin `lsx_lpc10_format_fn': library 0x15335a0, entry point 0x7f9d3a8bc0e0

play DBUG formats: opening format plugin `lsx_mat4_format_fn': library 0x1533d70, entry point 0x7f9d3a6b6620

play DBUG formats: opening format plugin `lsx_mat5_format_fn': library 0x1534fb0, entry point 0x7f9d3a4b0610

play DBUG formats: opening format plugin `lsx_paf_format_fn': library 0x1535790, entry point 0x7f9d3a2aa610

play DBUG formats: opening format plugin `lsx_pvf_format_fn': library 0x1535f70, entry point 0x7f9d3a0a4610

play DBUG formats: opening format plugin `lsx_sd2_format_fn': library 0x1533420, entry point 0x7f9d39e9e610

play DBUG formats: opening format plugin `lsx_sndfile_format_fn': library 0x15370a0, entry point 0x7f9d39c9a4f0

play DBUG formats: opening format plugin `lsx_vorbis_format_fn': library 0x1537860, entry point 0x7f9d39a96010

play DBUG formats: opening format plugin `lsx_w64_format_fn': library 0x1538000, entry point 0x7f9d3988f610

play DBUG formats: opening format plugin `lsx_wavpack_format_fn': library 0x15387e0, entry point 0x7f9d3968baa0

play DBUG formats: opening format plugin `lsx_xi_format_fn': library 0x1539590, entry point 0x7f9d3925b600

play:      SoX v14.4.1
time:     Dec 24 2014 20:00:19
issue:    Debian
uname:    Linux luc 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64
compiler: gcc 4.9.2
arch:     1288 48 88 L OMP
play INFO formats: detected file format type `wav'
play DBUG wav: WAV Chunk fmt 
play DBUG wav: WAV Chunk data
play DBUG wav: Reading Wave file: Microsoft PCM format, 1 channel, 22050 samp/sec
play DBUG wav:         44100 byte/sec, 2 block align, 16 bits/samp, 8660 data bytes
play DBUG wav:         4330 Samps/chans
play DBUG wav: WAV Chunk LIST
play DBUG wav: Type INFO
play DBUG wav: Attempting to seek beyond unsupported chunk `ICOP' of length 32 bytes
play DBUG wav: Attempting to seek beyond unsupported chunk `DISP' of length 35 bytes
play DBUG wav: Attempting to seek beyond unsupported chunk `DISP' of length 1836 bytes

Input File     : '/home/luc/sounds/Abrir.wav'
Channels       : 1
Sample Rate    : 22050
Precision      : 16-bit
Duration       : 00:00:00.20 = 4330 samples ~ 14.7279 CDDA sectors
File Size      : 10.6k
Bit Rate       : 434k
Sample Encoding: 16-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no

play DBUG alsa: selecting format 2: S16_LE (Signed 16 bit Little Endian)
play INFO formats: can't set sample rate 22050; using 44100

Output File    : 'default' (alsa)
Channels       : 1
Sample Rate    : 44100
Precision      : 16-bit
Duration       : 00:00:00.10 = 4330 samples = 7.36395 CDDA sectors
Sample Encoding: 16-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no

play DBUG rate: i/o=0.5; 1:2 @ level 0
play DBUG effects_i_dsp: 0.724 0.161984 1
play DBUG effects_i_dsp: make_lpf(n=83, Fc=0.419008 beta=10.6185 dc-norm=1 scale=2)
play DBUG rate: fir_len=42 phases=2 coef_interp=0 mult=1 size=672
play DBUG rate: stage=0  pre_post=41 pre=0  preload=20
play INFO sox: effects chain: input        22050Hz  1 channels (multi) 16 bits 00:00:00.20
play INFO sox: effects chain: rate         44100Hz  1 channels         32 bits 00:00:00.20
play INFO sox: effects chain: dither       44100Hz  1 channels         16 bits 00:00:00.20
play INFO sox: effects chain: output       44100Hz  1 channels (multi) 16 bits 00:00:00.20
play DBUG sox: automatically entering interactive mode
In:100%  00:00:00.20 [00:00:00.00] Out:8.66k [   ===|===   ]        Clip:0    
Done.
 
Old 03-13-2017, 06:13 AM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
$ cat /proc/asound/cards

If your indexing changed for your cards, you might need to override the defaults. Audio gets odd these days since webcams, video cards, motherboards, and probably other things have soundcards on them. So which one gets used by default can change between boots and various configurations. Without configuration, the card with index 0 is the default.

$ play -d /home/luc/sounds/Abrir.wav

I guess you can have a built in default soundcard (for SoX at compile time?). On my system which outputs primarily to pulseaudio over a network, play -d outputs no audio (until ^C is pressed once), and play with no -d outputs to pulse with no delay. If you're using pulseaudio you can run pavucontrol while play is outputting sound and change the settings. Since you can have per application configs, that's one way to change them, and the issue might be that that got corrupted or otherwise changed. Beyond that you might be pointing at the wrong card, which is super easy to do these days.
 
1 members found this post helpful.
Old 03-13-2017, 11:40 AM   #5
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by Shadow_7 View Post
$ cat /proc/asound/cards
Code:
luc[17378-0]> cat /proc/asound/cards
 0 [Loopback       ]: Loopback - Loopback
                      Loopback 1
 1 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xf7d00000 irq 45
Quote:
Originally Posted by Shadow_7 View Post
... So which one gets used by default can change between boots and various configurations.
I didn't reboot. I just suspended to RAM. I rebooted later, after I noticed the problem.
 
Old 03-13-2017, 12:12 PM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
loopback is odd. AFAIK, it is used if you want to output to a file or anything besides your speakers. It is 0 so for some things that would be default. If you don't currently have a .asoundrc, does this fix it?

FILE: ~/.asoundrc
Code:
defaults.ctl.card 1
defaults.pcm.card 1
defaults.pcm.device 0
The rough equivalent of -D hw:1,0 as far as alsa would be concerned. That config would make alsa default to device 1. Which wouldn't matter in the case of pulseaudio. But not all thing use pulse, and configurations of various distros favor different things.
 
1 members found this post helpful.
Old 03-13-2017, 02:36 PM   #7
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
These changes to .asoundrc didn't work. I have tried other changes, and they didn't work either.

Please read this other thread of mine if you're interested:

http://www.linuxquestions.org/questi...ds-4175600743/

It could be related, but note that thread is from February 28 and 'play' worked fine in the meantime, including several reboots.
 
Old 03-13-2017, 04:56 PM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Create a new user, and reboot and log into that user. See if the issue persists. Be sure to add the user to the audio group.
 
1 members found this post helpful.
Old 03-14-2017, 03:43 PM   #9
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by Shadow_7 View Post
Create a new user, and reboot and log into that user. See if the issue persists. Be sure to add the user to the audio group.
Well, I tried it. It didn't work. Even logging in as root doesn't work.
 
Old 03-15-2017, 11:59 AM   #10
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Well that rules out configs in the /home/ path. So you're looking at configs in / or /etc/ or something else. Although most of those types of issues would affect ALL applications, not just "play". Perhaps uninstall and reinstall sox. Or just reinstall sox.

$ sudo apt-get install --reinstall sox

Bit rot, corruption or something else happened.
 
1 members found this post helpful.
Old 03-15-2017, 12:24 PM   #11
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
...

have you ever tried playing this file with another application?
have you ever tried playing another file with this application?


Quote:
Originally Posted by lucmove View Post
Code:
luc[17358-0]> play -V4 /home/luc/sounds/Abrir.wav 
play DBUG formats: opening format plugin `lsx_alsa_format_fn': library 0x152c680, entry point 0x7f9d3cda88e0

play DBUG formats: opening format plugin `lsx_amr_nb_format_fn': library 0x152dde0, entry point 0x7f9d3c6a4690

play DBUG formats: opening format plugin `lsx_amr_wb_format_fn': library 0x152eb80, entry point 0x7f9d3c2761a0

play DBUG formats: opening format plugin `lsx_caf_format_fn': library 0x152f8f0, entry point 0x7f9d3be5c610

play DBUG formats: opening format plugin `lsx_fap_format_fn': library 0x1531f50, entry point 0x7f9d3b0d1610

play DBUG formats: opening format plugin `lsx_flac_format_fn': library 0x1532730, entry point 0x7f9d3aecc600

play DBUG formats: opening format plugin `lsx_gsm_format_fn': library 0x1533630, entry point 0x7f9d3aabf050

play DBUG formats: opening format plugin `lsx_lpc10_format_fn': library 0x15335a0, entry point 0x7f9d3a8bc0e0

play DBUG formats: opening format plugin `lsx_mat4_format_fn': library 0x1533d70, entry point 0x7f9d3a6b6620

play DBUG formats: opening format plugin `lsx_mat5_format_fn': library 0x1534fb0, entry point 0x7f9d3a4b0610

play DBUG formats: opening format plugin `lsx_paf_format_fn': library 0x1535790, entry point 0x7f9d3a2aa610

play DBUG formats: opening format plugin `lsx_pvf_format_fn': library 0x1535f70, entry point 0x7f9d3a0a4610

play DBUG formats: opening format plugin `lsx_sd2_format_fn': library 0x1533420, entry point 0x7f9d39e9e610

play DBUG formats: opening format plugin `lsx_sndfile_format_fn': library 0x15370a0, entry point 0x7f9d39c9a4f0

play DBUG formats: opening format plugin `lsx_vorbis_format_fn': library 0x1537860, entry point 0x7f9d39a96010

play DBUG formats: opening format plugin `lsx_w64_format_fn': library 0x1538000, entry point 0x7f9d3988f610

play DBUG formats: opening format plugin `lsx_wavpack_format_fn': library 0x15387e0, entry point 0x7f9d3968baa0

play DBUG formats: opening format plugin `lsx_xi_format_fn': library 0x1539590, entry point 0x7f9d3925b600

play:      SoX v14.4.1
time:     Dec 24 2014 20:00:19
issue:    Debian
uname:    Linux luc 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64
compiler: gcc 4.9.2
arch:     1288 48 88 L OMP
play INFO formats: detected file format type `wav'
play DBUG wav: WAV Chunk fmt 
play DBUG wav: WAV Chunk data
play DBUG wav: Reading Wave file: Microsoft PCM format, 1 channel, 22050 samp/sec
play DBUG wav:         44100 byte/sec, 2 block align, 16 bits/samp, 8660 data bytes
play DBUG wav:         4330 Samps/chans
play DBUG wav: WAV Chunk LIST
play DBUG wav: Type INFO
play DBUG wav: Attempting to seek beyond unsupported chunk `ICOP' of length 32 bytes
play DBUG wav: Attempting to seek beyond unsupported chunk `DISP' of length 35 bytes
play DBUG wav: Attempting to seek beyond unsupported chunk `DISP' of length 1836 bytes

Input File     : '/home/luc/sounds/Abrir.wav'
Channels       : 1
Sample Rate    : 22050
Precision      : 16-bit
Duration       : 00:00:00.20 = 4330 samples ~ 14.7279 CDDA sectors
File Size      : 10.6k
Bit Rate       : 434k
Sample Encoding: 16-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no

play DBUG alsa: selecting format 2: S16_LE (Signed 16 bit Little Endian)
play INFO formats: can't set sample rate 22050; using 44100

Output File    : 'default' (alsa)
Channels       : 1
Sample Rate    : 44100
Precision      : 16-bit
Duration       : 00:00:00.10 = 4330 samples = 7.36395 CDDA sectors
Sample Encoding: 16-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no

play DBUG rate: i/o=0.5; 1:2 @ level 0
play DBUG effects_i_dsp: 0.724 0.161984 1
play DBUG effects_i_dsp: make_lpf(n=83, Fc=0.419008 beta=10.6185 dc-norm=1 scale=2)
play DBUG rate: fir_len=42 phases=2 coef_interp=0 mult=1 size=672
play DBUG rate: stage=0  pre_post=41 pre=0  preload=20
play INFO sox: effects chain: input        22050Hz  1 channels (multi) 16 bits 00:00:00.20
play INFO sox: effects chain: rate         44100Hz  1 channels         32 bits 00:00:00.20
play INFO sox: effects chain: dither       44100Hz  1 channels         16 bits 00:00:00.20
play INFO sox: effects chain: output       44100Hz  1 channels (multi) 16 bits 00:00:00.20
play DBUG sox: automatically entering interactive mode
In:100%  00:00:00.20 [00:00:00.00] Out:8.66k [   ===|===   ]        Clip:0    
Done.
i don't know, it looks like sox has difficulties identifying the file format.
 
Old 03-15-2017, 04:29 PM   #12
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by Shadow_7 View Post
Perhaps uninstall and reinstall sox. Or just reinstall sox.
$ sudo apt-get install --reinstall sox
Just tried it. No change.

Quote:
Originally Posted by ondoho View Post
have you ever tried playing this file with another application?
have you ever tried playing another file with this application?
Yes to both. Other programs can play the file and 'play' can't play any other file.
 
Old 03-15-2017, 04:36 PM   #13
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by Shadow_7 View Post
Or just reinstall sox.
Note that uninstalling sox caused removal of something called terminatorX because it depends on sox. Before I proceeded, I ran terminatorX and it played normally. Then I uninstalled and reinstalled them, and nothing changed. :-(
 
Old 03-15-2017, 07:16 PM   #14
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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?

$ avprobe /home/luc/sounds/Abrir.wav

or ffprobe depending on your system.
 
1 members found this post helpful.
Old 03-16-2017, 02:28 AM   #15
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by lucmove View Post
Other programs can play the file and 'play' can't play any other file.
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?

Last edited by ondoho; 03-16-2017 at 02:31 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to play sound directly from input on USB sound card, a Sound Blaster X-Fi THX JunctaJuvant Other *NIX 10 06-14-2014 02:36 AM
No surround sound, mic not working, XMMS wont play (others give sound) Virtuality Linux - Hardware 2 03-26-2012 07:26 PM
Isnt it xmms crappy to play sound, like detecting sound cards. Others are all better frenchn00b Linux - General 2 02-11-2008 06:51 PM
I can't hear any sound when I play a cd or mp3...but tested with system tools->Sound Niceman2005 Linux - General 6 10-31-2005 09:51 AM
FC2: Sound Card (SiS SI7012) Detect But Donot Play Sound rajanaeem Linux - Hardware 0 10-22-2004 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration