LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   No sound from 'play' (https://www.linuxquestions.org/questions/linux-software-2/no-sound-from-play-4175601646/)

lucmove 03-13-2017 02:23 AM

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?

ondoho 03-13-2017 02:42 AM

Quote:

Originally Posted by lucmove (Post 5682750)
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).

lucmove 03-13-2017 04:23 AM

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.


Shadow_7 03-13-2017 06:13 AM

$ 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.

lucmove 03-13-2017 11:40 AM

Quote:

Originally Posted by Shadow_7 (Post 5682801)
$ 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 (Post 5682801)
... 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.

Shadow_7 03-13-2017 12:12 PM

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.

lucmove 03-13-2017 02:36 PM

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.

Shadow_7 03-13-2017 04:56 PM

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.

lucmove 03-14-2017 03:43 PM

Quote:

Originally Posted by Shadow_7 (Post 5683028)
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.

Shadow_7 03-15-2017 11:59 AM

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.

ondoho 03-15-2017 12:24 PM

...

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 (Post 5682776)
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.

lucmove 03-15-2017 04:29 PM

Quote:

Originally Posted by Shadow_7 (Post 5683762)
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 (Post 5683776)
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.

lucmove 03-15-2017 04:36 PM

Quote:

Originally Posted by Shadow_7 (Post 5683762)
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. :-(

Shadow_7 03-15-2017 07:16 PM

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.

ondoho 03-16-2017 02:28 AM

Quote:

Originally Posted by lucmove (Post 5683910)
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?


All times are GMT -5. The time now is 09:39 AM.