[alsa-devel] aplay can't run in background since adding pause support

Stephen Warren swarren at nvidia.com
Mon May 23 22:55:44 CEST 2011


In recent versions of aplay, if I try to either run them in the
background, or run them in the foreground, then ^Z and bg them, they
hang indefinitely:

aplay foo.wav &
# doesn't play anything

aplay foo.wav
[1]+  Stopped      aplay foo.wav
[1]+  Stopped      aplay foo.wav

At least, this is true under ChromeOS on ARM with kernel 2.6.38 and
ALSA, or an Ubuntu Natty rootstock on ARM with the same ChromeOS

This was introduced by alsa-utils commit:
aplay/arecord: Added hardware pause support (press SPACE or Enter)

What happens is that the call to tcsetattr causes the process to receive
signal TTOU and be stopped. Running under strace yields an infinite loop
with ioctl(TCSETS) returning -ERESTARTSYS, and being retried.

I believe this is related to http://lkml.org/lkml/2008/6/2/157.

I'm not exactly sure how to solve this though. Another post in that
thread implied that adding a signal handler for TTOU and then adjusting
the tcsetattr settings might help, but I'm not convinced about that,
since I believe the -ERESTARTSYS handling loop is inside the call to
tcsetattr, and hence tcsetattr's parameters can't be changed.

Does anyone have any ideas? Thanks.


More information about the Alsa-devel mailing list