Problems with mplayer and PulseAudio on Ubuntu 10.04

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]<

 



Hello everyone!

I have Ubuntu 10.04 (AMD64), cleanly installed on a new system I bought,
an Intel Pentium Dual Core E6500 with an Asrock P5B-DE mother board,

This mother board comes with an HDA Intel onboard audio card, that has
the Via VT1708S codec. This onboard audio card does not have the
ability to do hardware mixing as it seems.

Everything seems to work fine, PulseAudio mixes all audio streams
nicely.

The problem is with mplayer. I cannot play *any* sound with it, and worse,
it causes PulseAudio to go "bonkers". Once I start mplayer, I cannot hear
any sound, from any application.

I tested mplayer from the default Ubuntu repositories [1] and a much newer
build from the RVM Ubuntu PPA repository [2] (the author of SMPlayer, if I
am not mistaken). Both behave quite much the same.

Usage scenario #1:

1. No sounds playing.
2. Start mplayer -ao pulse video_with_audio.avi.

Expected result: video plays together with audio.

Actual result: video plays without any audible sound.

More info: if I try to play other sounds with other apps (say vlc or gnome
system sounds), they all seem to work fine, but I can no longer hear them,
just like with mplayer. Mplayer seems to work fine - no errors, but I
cannot hear anything.

pavucontrol shows the mplayer audio stream (and other audio streams
 from other apps). The VU meter indicates proper audio stream activity,
all is fine. No volume is muted/low, no stream is suspended (pacmd ls),
nothing shows wrong.

Semi-workarounds:
- pulseaudio --kill. This restarts the PulseAudio system and then it works
fine again.
- I change the card profile (say, from stereo to 7.1 and back). This makes
PulseAudio output sound again. If I do this while mplayer plays the video
file, I can hear its own audio stream fine. This means that only the
initialization of mplayer makes pulseaudio go bonkers.

Usage scenario #2:
1. Start vlc video_with_audio.avi. (making sure it is configured to use
PulseAudio output). Sound plays fine.
2. Start mplayer -ao pulse another_video_with_audio.avi.

Expected result: I can see both videos playing and I can hear both audio
streams mixed.

Actual result: I can see both videos playing, but no sound. Even the sound
   from vlc goes mute.

Again, there are no indications of errors from any of the players, nor
   from pacmd ls, nor from pavucontrol. I can see both audio streams playing
fine.

Same "semi-workarounds" apply.

Usage scenario #3:

1. Start mplayer -ao alsa/jack/etc.

It's the same as with -ao pulse, with some differences:

a) mplayer from default Ubuntu repos allows the use of -ao esd, which no
longer breaks PulseAudio and the audio stream *almost* plays fine. It does
not play fine, because after a few random seconds it stops - I can no
longer hear sound. If I seek within the file with mplayer, then it resets
some buffers and I can hear the audio stream again, and so on.

At least it doesn't break PA.

b) mplayer from RVM Ubuntu PPA ... behaves with -ao esd as it does with
-ao pulse. However, -ao oss works fine. I can hear the audio stream with
no problems. Nonetheless, -ao oss manages to take over PulseAudio and that
means any sounds coming from PulseAudio are not heard by me. Once I stop
mplayer the situation does not 'recover', I need to kill pulseaudio or
change the card profile back and forth.


Usage scenario #4:

1. Start mplayer, with or without -ao pulse, but without any video/audio
file, just so you can see its command line help.

Expected result: I get the mplayer help and that there's no sound output,
and that it does not affect PulseAudio.

Actual result: mplayer somehow manages to break PulseAudio once again,
irrespective of -ao pulse, irrespective of giving it any video/audio file
to play. "WTF?" moment here.


Debugging the problem:

1. Starting mplayer with -msglevel all=9 shows no errors at all.
2. pacmd ls and other lists/infos from pacmd do not show errors/problems.
3. pacmd set-log-level 4 does, finally, show errors in /var/log/syslog.
The gist of the problem lies in:

pulseaudio[8713]: client.c: Created 30 "Native client (UNIX socket client)"
pulseaudio[8713]: client.c: Freed 30 "Native client (UNIX socket client)"
pulseaudio[8713]: protocol-native.c: Connection died.
pulseaudio[8713]: module-udev-detect.c: /dev/snd/controlC0 is accessible:
yes
pulseaudio[8713]: last message repeated 10 times
pulseaudio[8713]: client.c: Created 31 "Native client (UNIX socket client)"
pulseaudio[8713]: protocol-native.c: Protocol version: remote 16, local 16
pulseaudio[8713]: protocol-native.c: Got credentials: uid=1000 gid=1000
success=1
pulseaudio[8713]: protocol-native.c: SHM possible: yes
pulseaudio[8713]: protocol-native.c: Negotiated SHM: yes
pulseaudio[8713]: module-augment-properties.c: Looking for .desktop file
for mplayer
pulseaudio[8713]: client.c: Freed 31 "ALSA plug-in [mplayer]"
pulseaudio[8713]: protocol-native.c: Connection died.
pulseaudio[8713]: client.c: Created 32 "Native client (UNIX socket client)"
pulseaudio[8713]: protocol-native.c: Protocol version: remote 16, local 16
pulseaudio[8713]: protocol-native.c: Got credentials: uid=1000 gid=1000
success=1
pulseaudio[8713]: protocol-native.c: SHM possible: yes
pulseaudio[8713]: protocol-native.c: Negotiated SHM: yes
pulseaudio[8713]: module-augment-properties.c: Looking for .desktop file
for mplayer
pulseaudio[8713]: client.c: Freed 32 "ALSA plug-in [mplayer]"
pulseaudio[8713]: protocol-native.c: Connection died.
pulseaudio[8713]: module-udev-detect.c: /dev/snd/controlC0 is accessible:
yes
pulseaudio[8713]: module-udev-detect.c: /dev/snd/controlC0 is accessible:
yes

This is MPlayer started without any video/audio file. It tries to access
ALSA or something like that, and then the connection dies.

The messages above are repeated several times, then I get:

pulseaudio[8713]: alsa-sink.c: Underrun!
pulseaudio[8713]: alsa-source.c: Overrun!
pulseaudio[8713]: alsa-sink.c: Increasing wakeup watermark to 30,00 ms
pulseaudio[8713]: alsa-source.c: Increasing wakeup watermark to 30,00 ms

... and these are repeated several times again, and the watermark is
increased more and more.


Some thoughts:

1. mplayer shouldn't access any sound system if I do not elect to play any
file.

2. mplayer shouldn't access alsa if I elect some other -ao.

3. pulseaudio shouldn't go bonkers if mplayer does access alsa.

4. somehow I think that mplayer -ao pulse does "pretty much the same" as
it does mplayer -ao oss from the rvm Ubuntu PPA. The latter did take
control of the sound card, via OSS. The former does somehow take control
of the sound card, pulseaudio looses it, then mplayer happily goes on to
use pulseaudio for subsequent audio stream output, but now ... pulseaudio
is silenced.


I have debug output saved in various states before playing files, during
and after, in the following file:

http://sucan.ro/mplayer-pulseaudio-bug.tar.gz

(Please read the readme.txt file.)


Any thoughts how I can fix this issue? I'd like to be able to play files
with mplayer.


Thanks to everyone who takes the time to read all this, and reply. :)



[1] http://packages.ubuntu.com/lucid/mplayer
[2] https://launchpad.net/~rvm/+archive/mplayer


-- 
Mihai Sucan
http://www.robodesign.ro


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux