Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mplayer / espeak randomly hang at EOF #13

Closed
ghost opened this issue Mar 17, 2017 · 6 comments
Closed

mplayer / espeak randomly hang at EOF #13

ghost opened this issue Mar 17, 2017 · 6 comments
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Mar 17, 2017

Since I used the speakerphat script, mplayer / espeak randomly hang at the end of audio.
This makes for instance piping multiple lines to espeak impossible since it would hang after the a line or 2.

Expected behaviour:

MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team
Cannot open file '/home/pi/.mplayer/input.conf': No such file or directory
Failed to open /home/pi/.mplayer/input.conf.
Cannot open file '/etc/mplayer/input.conf': No such file or directory
Failed to open /etc/mplayer/input.conf.

Playing coucou.mp3.
Detected file format: MP2/3 (MPEG audio layer 2/3) (libavformat)
[lavf] stream 0: audio (mp3), -aid 0
Load subtitles in .
Selected audio codec: MPEG 1.0/2.0/2.5 layers I, II, III [mpg123]
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
AO: [pulse] Init failed: Connection refused
Using device: speaker-phat
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
[AO_ALSA] Unable to find simple control 'Master',0.
Video: no video
Starting playback...
A:   1.9 (01.9) of 2.5 (02.4)  6.4% 


Exiting... (End of file)

Behaviour (approximately 1/3 of times):

MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team
Cannot open file '/home/pi/.mplayer/input.conf': No such file or directory
Failed to open /home/pi/.mplayer/input.conf.
Cannot open file '/etc/mplayer/input.conf': No such file or directory
Failed to open /etc/mplayer/input.conf.

Playing coucou.mp3.
Detected file format: MP2/3 (MPEG audio layer 2/3) (libavformat)
[lavf] stream 0: audio (mp3), -aid 0
Load subtitles in .
Selected audio codec: MPEG 1.0/2.0/2.5 layers I, II, III [mpg123]
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
AO: [pulse] Init failed: Connection refused
Using device: speaker-phat
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
[AO_ALSA] Unable to find simple control 'Master',0.
Video: no video
Starting playback...
A:   1.9 (01.9) of 2.5 (02.4)  7.0% 

[here it hangs until I press ctrl+c 2 times]

^C

MPlayer interrupted by signal 2 in module: uninit_ao
^C

MPlayer interrupted by signal 2 in module: uninit_ao

I guess it happens with every audio applications.

The vumeter is active.

@RogueM
Copy link
Contributor

RogueM commented Mar 17, 2017

yes, there seems to be a bug in the ALSA stack, see this discussion on alsa-dev
http://mailman.alsa-project.org/pipermail/alsa-devel/2017-March/118650.html

... in other words it's a bug in the ALSA plugin architecture, with, currently, no known workaround besides patching the ALSA source.

@ghost
Copy link
Author

ghost commented Mar 17, 2017

@RogueM Thank you for the clarification, let's wait for a proper upstream fix.

@ghost
Copy link
Author

ghost commented Mar 22, 2017

In the meantime, is there any way to disable the vumeter / use speakerphat without vumeter to make it work?

Tried the following (found in the install script) but it does not output any sound nor alsamixer run with this conf file.

sudo cp /etc/asound.conf /etc/asound.conf.bak
sudo echo -e "pcm.\041default {\n type hw\n card 1\n}" > $HOME/.asoundrc
sudo echo -e "ctl.\041default {\n type hw\n card 1\n}" >> $HOME/.asoundrc
sudo mv $HOME/.asoundrc /etc/asound.conf

@RogueM
Copy link
Contributor

RogueM commented Mar 22, 2017

If you don't want the VU, then you don't need any asound files at all... so delete them and you should be good to go.

... it IS a bug in the dmix plugin however, which is in no small part responsible for minimising pops and clicks, so you should expect a significant deterioration in playback.

@ghost
Copy link
Author

ghost commented Mar 22, 2017

If you don't want the VU, then you don't need any asound files at all... so delete them and you should be good to go.

After removing asound.conf I don't get any sound on the speaker-phat, even tho I checked alsamixer for volume setting.

... it IS a bug in the dmix plugin however, which is in no small part responsible for minimising pops and clicks, so you should expect a significant deterioration in playback.

ACK, no choice but to live with it for now, as there doesn't seem to be a good workaround

@RogueM
Copy link
Contributor

RogueM commented Mar 22, 2017

you must be doing something wrong... no asound means you should have sound. Either you have a leftover .asoundrc in your home folder or there is an asound.conf in /etc.

try to run the phatdac installer which will set everything as needed to get sounds but no VU with the Speaker-pHAT DAC:

curl https://get.pimoroni.com/phatdac | bash

... but yes, you won't have software volume control - for that you would need to proxy the PCM scontrol with an asound.

It's entirely possible but you'll have to check the ALSA documentation, or check carefully the asound.conf shipped with pivumeter to see what should be left in and what should be left out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants