sox/play sleeps after playing wav file

Bug #591003 reported by Andrew Tannenbaum
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
sox (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: sox

This command should run for .4 seconds, but it runs for 3.1 seconds.
It plays the sound correctly and then waits for a couple of seconds instead of exiting immediately.
The bug happens on any wav file.
It worked correctly before 10.04.

$ time play /usr/lib/openoffice/basis3.2/share/gallery/sounds/ok.wav
/usr/lib/openoffice/basis3.2/share/gallery/sounds/ok.wav:

 File Size: 8.86k Bit Rate: 177k
  Encoding: Signed PCM
  Channels: 1 @ 16-bit
Samplerate: 11025Hz
Replaygain: off
  Duration: 00:00:00.40

In:100% 00:00:00.40 [00:00:00.00] Out:4.41k [!=====|=====!] Clip:0
Done.

real 0m3.099s
user 0m0.000s
sys 0m0.008s

When it's sleeping, strace shows this:

$ strace /usr/bin/play /usr/lib/openoffice/basis3.2/share/gallery/sounds/ok.wav

...
futex(0x98d27a8, FUTEX_UNLOCK_PI_PRIVATE, 1204212) = 0
futex(0x98d27e0, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0x98d27e4, FUTEX_WAIT_PRIVATE, 11, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x98d27a8, FUTEX_UNLOCK_PI_PRIVATE, 1204212) = 0
futex(0x98d27e4, FUTEX_WAIT_PRIVATE, 13, NULL) = 0
futex(0x98d27a8, FUTEX_UNLOCK_PI_PRIVATE, 1204212) = 0
futex(0x98d27e4, FUTEX_WAIT_PRIVATE, 15, NULL) = 0
futex(0x98d27a8, FUTEX_UNLOCK_PI_PRIVATE, 1204212) = 0
futex(0x98d27e4, FUTEX_WAIT_PRIVATE, 17, NULL) = 0
futex(0x98d27a8, FUTEX_UNLOCK_PI_PRIVATE, 1204212) = 0
futex(0x98d27e4, FUTEX_WAIT_PRIVATE, 19, NULL) = 0
...

$ lsmod
Module Size Used by
binfmt_misc 6587 1
snd_hda_codec_idt 51914 1
snd_hda_intel 21877 2
snd_hda_codec 74201 2 snd_hda_codec_idt,snd_hda_intel
snd_hwdep 5412 1 snd_hda_codec
snd_pcm_oss 35308 0
snd_mixer_oss 13746 1 snd_pcm_oss
snd_pcm 70662 3 snd_hda_intel,snd_hda_codec,snd_pcm_oss
snd_seq_dummy 1338 0
snd_seq_oss 26726 0
snd_seq_midi 4557 0
fbcon 35102 71
tileblit 2031 1 fbcon
font 7557 1 fbcon
bitblit 4707 1 fbcon
softcursor 1189 1 bitblit
snd_rawmidi 19056 1 snd_seq_midi
snd_seq_midi_event 6003 2 snd_seq_oss,snd_seq_midi
vga16fb 11385 0
vgastate 8961 1 vga16fb
snd_seq 47263 6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
i915 282354 3
snd_timer 19098 2 snd_pcm,snd_seq
drm_kms_helper 29297 1 i915
snd_seq_device 5700 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
drm 162471 4 i915,drm_kms_helper
i2c_algo_bit 5028 1 i915
snd 54148 16 snd_hda_codec_idt,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
ppdev 5259 0
sbp2 19448 0
video 17375 1 i915
lp 7028 0
psmouse 63245 0
soundcore 6620 1 snd
parport_pc 25962 1
intel_agp 24177 2 i915
output 1871 1 video
agpgart 31724 2 drm,intel_agp
snd_page_alloc 7076 2 snd_hda_intel,snd_pcm
serio_raw 3978 0
parport 32635 3 ppdev,lp,parport_pc
ohci1394 26950 0
ieee1394 81181 2 sbp2,ohci1394
e1000e 119856 0
$

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: sox 14.3.0-1.1build1
ProcVersionSignature: Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic i686
Architecture: i386
Date: Mon Jun 7 17:38:46 2010
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: sox

Revision history for this message
Andrew Tannenbaum (atannen) wrote :
Revision history for this message
Christoph-D (eigene-homepage) wrote :
Download full text (3.5 KiB)

I'm also affected by this bug. I noticed it with mplayer in Ubuntu 10.04:

$ strace mplayer test.mp3
...
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 5, NULL, 0x23f68f0) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x240c0d4, FUTEX_WAIT_PRIVATE, 5, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 7, NULL, 0x23f68f0) = 0
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 9, NULL, 0x23f68f0) = 0
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 11, NULL, 0x23f68f0) = 0
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 13, NULL, 0x23f68f0) = 0
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 15, NULL, 0x23f68f0) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x240c0d4, FUTEX_WAIT_PRIVATE, 15, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 17, NULL, 0x23f68f0) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x240c0d4, FUTEX_WAIT_PRIVATE, 17, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 19, NULL, 0x23f68f0) = 0
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 21, NULL, 0x23f68f0) = 0
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 23, NULL, 0x23f68f0) = 0
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 25, NULL, 0x23f68f0) = 0
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 27, NULL, 0x23f68f0) = 0
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 29, NULL, 0x23f68f0) = 0
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 31, NULL, 0x23f68f0) = 0
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x240c0d4, FUTEX_WAIT_REQUEUE_PI_PRIVATE, 33, NULL, 0x23f68f0) = 0
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
write(5, "W", 1) = 1
futex(0x23f68f0, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
futex(0x7f4f6fb889e0, FUTEX_WAIT, 31962, NULL) = 0
close(6) = 0
munmap(0x7f4f6fb89000, 67112960) = 0
unlink("/dev/shm/pulse-shm-2494398010") = 0
close(4) = 0
close(5) = 0
write(1, "\nExiting... (End of file)\n", 26
Exiting... (End of file)
) = 26
getpid() = 31961
munmap(0x7f4f851f2000, 212992) = 0
exit_group(0) = ?

mplayer waits a little more than 2 seconds after the mp3 file ends. While mplayer hangs, it calls futex(...) repeatedly according to strace, but nothing else.

For me it also breaks every other application that uses mplayer intern...

Read more...

Revision history for this message
Christoph-D (eigene-homepage) wrote :

Considering that mplayer is also affected, it does not seem to be a bug in sox. It may be a bug in pulseaudio, because the mplayer command line option "-ao oss" fixes the problem for me (though it causes other problems related to oss access).
Is it possible to move bug reports to another project, in this case, possibly pulseaudio?

Revision history for this message
Christoph-D (eigene-homepage) wrote :

Disabling pulseaudio by following the instructions on https://wiki.ubuntu.com/PulseAudio/Log also temporarily fixes the problem for me.

Revision history for this message
Andrew Tannenbaum (atannen) wrote :
Revision history for this message
Andrew Tannenbaum (atannen) wrote :

And yes, killing pulseaudio works around the bug for me too, though I would prefer having pulseaudio because of its multiplexing, per-app volume controls, etc.

Revision history for this message
Ulrich Klauer (uklauer) wrote :

Closing as Invalid, as this seems to be a PulseAudio problem (LP bug 582600).

Changed in sox (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.