Goldendict: Cannot play sound using internal player after upgrade to Ubuntu 13.10.

Created on 21 Oct 2013  路  28Comments  路  Source: goldendict/goldendict

The prompt information is:

"WARN: FFmpeg audio Player ao_open_live() failed: can not open the device alsa channel 1, rate 11025, bit 8."

Bug Linux

Most helpful comment

I found a soulotion for the problem.
Install VLC and then in goldendict menu:
From Edit > Preferences > Audio > Use external program. And then add this line to the field : /usr/bin/cvlc
All done.

All 28 comments

My guess is that your sound card driver cannot support that audio format, currently there is no solution for that...

@goldendict/developers
Is it necessary to include an optional external deps for re-sampling, which should address this problem?

@timonwong I doubt that, the feature worked fine before I upgrade from 13.04 to 13.10, and the audio will be played well if I set mplayer as the external player,

@metalbrick
Did the mplayer use ALSA output device?

@timonwong I just changed it from pulse to alsa, they both work.

@timonwong I assume that the issue might caused by the Phonon dependencies of Ubuntu 13.10.

@metalbrick
Phonon is completed removed, it's not required anymore.

So maybe ubuntu 13.10 had something changed in the alsa driver, which broke libao (which uses alsa driver under linux)

I have the same issue on updated Manjaro : no internal audio, similar warning.
External player (mpv) works just fine.

When I launch goldendict from terminal and try playing with internal player, I can see the following:
Codec open: PCM signed 16-bit little-endian: channels: 1, rate: 11025, format: s16
ao_open_live(): Advanced Linux Sound Architecture (ALSA) output: channels: 1, rate: 11025, bits: 16
ao_alsa ERROR: Unable to open ALSA device 'default' for playback => Invalid argument

Using Ubuntu 13.04, I built goldendict recently. Oddly this exact error occurs on one of my dictionary, but not on another. External Player "mplayer" works fine for both, but cannot play for ~2 seconds or longer. (i.e. partially playing sentences.) What can I do?

++++++console information: this one is OKEY++++++++++++
clicked QUrl( "gdau://6bc3e3cda9f69d3c685750087e0d355c/exa_p008-000288301.wav" )
getResource: gdau://6bc3e3cda9f69d3c685750087e0d355c/exa_p008-000288301.wav
scheme: gdau
host: 6bc3e3cda9f69d3c685750087e0d355c
n is /home/scinart/Downloads/Goldendict/exa_p008-000288301.wav
Deflated
Codec open: MP3 (MPEG audio layer 3): channels: 1, rate: 22050, format: s16
ao_open_live(): Advanced Linux Sound Architecture (ALSA) output: channels: 1, rate: 22050, bits: 16

++++++++++++++this cannot play +++++++++++++++++++++++++
clicked QUrl( "gdau://1157fe517878f56c041f9f8ebf9f2c72/presum03.wav" )
getResource: gdau://1157fe517878f56c041f9f8ebf9f2c72/presum03.wav
scheme: gdau
host: 1157fe517878f56c041f9f8ebf9f2c72
n is /home/scinart/Downloads/Goldendict/presum03.wav
Deflated
Codec open: PCM unsigned 8-bit: channels: 1, rate: 11025, format: u8
ao_open_live(): Advanced Linux Sound Architecture (ALSA) output: channels: 1, rate: 11025, bits: 8

<<

You can try another external player as a workaround:

  • mplayer2 (I find it far better than mplayer);
  • mpv (I find it far better than mplayer or mplayer2 :));
  • vlc;
  • any other command line player will probably do.

I've just found that internal player works for some audio files!

Try opening page "Die Walk眉re" in English Wikipedia and play audio file under "Noted excerpts" section. It works!
Output:
getResource: http://upload.wikimedia.org/wikipedia/commons/a/ad/Richard_Wagner_-_Ride_of_the_Valkyries_original.ogg
scheme: http
host: upload.wikimedia.org
Codec open: Vorbis: channels: 1, rate: 44100, format: fltp
ao_open_live(): Advanced Linux Sound Architecture (ALSA) output: channels: 1, rate: 44100, bits: 32
ao_alsa WARNING: ALSA 'default' device may only simulate >16 bit playback
ao_alsa ERROR: Unable to open ALSA device 'default' for playback => Invalid argument

When I try to listen to some pronunciation from one of my offline dictionaries, internal player fails:
Codec open: PCM signed 16-bit little-endian: channels: 1, rate: 11025, format: s16
ao_open_live(): Advanced Linux Sound Architecture (ALSA) output: channels: 1, rate: 11025, bits: 16
ao_alsa ERROR: Unable to open ALSA device 'default' for playback => Invalid argument

Looks like a PCM codec problem.
Output, when playing the same word in external mpv player:
/tmp/gd-hXMT1457.wav
(is there a conversion step - to wav - here?)

Note: internal player has the benefit - it is automatically stopped before pronouncing next word.
In case of vlc: it opens separate GUI window for each request. These windows have to be closed manually.
mpv: it doesn't create windows, but is also launched in separate process. To stop playing, ending (or even killing!) process in system monitor is needed.

One more observation: sound in mpv is much better than in vlc. Also internal player and vlc have mono output, mpv - stereo (this can be observed in pavucontrol window).

@vedgy
If file /etc/libao.conf exists in your system, please paste its contents here.
And don't forget to check if there is in your ~/.libao.

Yes, there is /etc/libao.conf file in my system.
It's contents:
default_driver=alsa
dev=default

There is no .libao file or directory in my home directory.

@vedgy
Maybe the ALSA mixer is broken for certain formats, you can try replacing its whole content with this: (make a backup first), be sure the dev=default option is removed.

default_driver=pulse

@timonwong

Thanks, this resolved the issue!
Furthermore: sound quality of internal player is the same as using external mpv (much better than using vlc).
And of course using internal player solves stopping playback problem.

One flaw of internal player: it has Mono output. Or is this not a flaw?

@vedgy
Good to know, the mono output is by design, I haven't convert mono audio to stereo yet.

@scinart
@metalbrick
Can you verify that?

@timonwong Yes, it did solve the problem by modifying /etc/libao.conf, thanks a lot.

there is no .libao file. Here is my default /etc/libao.conf file.

default_driver=alsa
quiet

Changing default_driver to pulse won't work at all. (same error message as before)
I'm now using external player cvlc and it works fine. Thanks to @vedgy

@scinart
Have you rebooted after changing to default_driver=pulse?

@vedgy
Yes. but still in vain. After changing and rebooting, all external players work fine.
Deadbeef seems to have an option to choose output device, and PulseAudio Sound Server is ok.
yet Goldendict is at a loss.

@scinart
I had the same problem on Ubuntu 13.10. My libao.conf was completely similar. I just changed the default_driver=alsa to default_driver=pulse and also removed quiet, then restarted the computer and the problem just solved.

I found a soulotion for the problem.
Install VLC and then in goldendict menu:
From Edit > Preferences > Audio > Use external program. And then add this line to the field : /usr/bin/cvlc
All done.

@loge It repeated the sound without stopping. Do you have such problem too?

@Kasramvd No. Everything is good here. Except sometimes I have to run killall vlc because it stops to function.

@loge It repeated the sound without stopping. Do you have such problem too?

If it repeats the sound, you can fix it by turning off 'loop all' or 'loop one' in VLC gui control bar, then exit VLC, then restart goldendict.

@kasramvd No. Everything is good here. Except sometimes I have to run killall vlc because it stops to function.

I suppose it's because vlc is lauched in separate process each time you activate the audio, as in @vedgy's comment. To fix this, you may want to try: Open VLC Player on your PC > 'Media' on the tool bar at the top of VLC media player > check 'Quit at the end of playlist' > exit VLC > restart goldendict.

I have a "ffmpeg" error too.
Arch Linux, packages ffmpeg and libao installed.

I found a soulotion for the problem.
Install VLC and then in goldendict menu:
From Edit > Preferences > Audio > Use external program. And then add this line to the field : /usr/bin/cvlc
All done.

The problem is that the vlc-processes do not stop.
You can use "/usr/bin/cvlc --play-and-exit" instead. It's works.

On my manjaro, install the mpv, then just put the mpv as the external program work fine, no looping issue.

If there are many dictionaries loaded by GoldenDict, then there could also be too many files open when the temporary wave file to be opened. Reducing the number of loaded dictionaries or increasing the process limit solves the issue in this case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ingjieye picture ingjieye  路  6Comments

sallyahaj picture sallyahaj  路  7Comments

bcdavasconcelos picture bcdavasconcelos  路  5Comments

johnlepikhin picture johnlepikhin  路  9Comments

m040601 picture m040601  路  36Comments