原因:サウンドドライバのバグらしいです。
対処:linux_a.c を以下のように修正します。
=============== 修正箇所その 1 ===============
open_output() 関数の
/* Open the audio device */
fd=open(dpm.name, O_RDWR | O_NDELAY);
if (fd<0)
{
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
dpm.name, sys_errlist[errno]);
return -1;
}
というところの直後に以下の行を追加:
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NDELAY);
=============== 修正箇所その 2 ===============
output_data() 関数で
ssize_t rc;
と変数 rc を用意し、write しているところを以下のように修正:
/* Write the data out. Linux likes to give an EINTR if you suspend
a program while waiting on a write, so we may need to retry. */
do
{
rc = write(dpm.fd, buf, count * 2);
}
while ((rc == 0) || ((rc == -1) && (errno==EINTR)));
}
else
{
/* Convert to 8-bit unsigned and write out. */
s32tou8(buf, count);
do
{
rc = write(dpm.fd, buf, count);
}
while ((rc == 0) || ((rc == -1) && (errno==EINTR)));
}
}