Skip to contentSkip to conversation

Sound Programming and Signals

DISCUSSION Chuck Winters 3 participants 3 messages Jun 13, 2002 – Jun 14, 2002

lore
Share & tools
lore
#0 lore raw

I am trying to write a program which get a SIGIO signal from a sound device, and then selects on the fd to decide if the device can accept write, read, exception data. The problem is that it doesn't seem like the device every raises a SIGIO signal. If I do a kill -SIGIO <test_pid>, my handler runs. Anyone have any ideas?

Chuck

#1 lore raw
Quoted 5 lines · Chuck Winters

I am trying to write a program which get a SIGIO signal from a sound device, and then selects on the fd to decide if the device can accept write, read, exception data. The problem is that it doesn't seem like the device every raises a SIGIO signal. If I do a kill -SIGIO <test_pid>, my handler runs. Anyone have any ideas?

1. Did you set the O_ASYNC flag on the descriptor, either in the call to open(), or with a subsequent call to fcntl(fd, F_SETFL, O_ASYNC)?

2. Did you set the target process ID with fcntl(fd, F_SETOWN, pid)?

If you have done both of these, but you still don't receive SIGIO, then I would suspect that it's a limitation of the sound card driver.

Signature · 1 line
Glynn Clements <[email protected]>
#2 lore raw
Quoted 11 lines · Glynn Clements
Quoted 5 lines · Chuck Winters

I am trying to write a program which get a SIGIO signal from a sound device, and then selects on the fd to decide if the device can accept write, read, exception data. The problem is that it doesn't seem like the device every raises a SIGIO signal. If I do a kill -SIGIO <test_pid>, my handler runs. Anyone have any ideas?

1. Did you set the O_ASYNC flag on the descriptor, either in the call to open(), or with a subsequent call to fcntl(fd, F_SETFL, O_ASYNC)?

I used fcntl(fd, F_SETFL, f_flags|F_ASYNC)
after I used the F_SETOWN fcntl.

Quoted 5 lines

2. Did you set the target process ID with fcntl(fd, F_SETOWN, pid)?

If you have done both of these, but you still don't receive SIGIO, then I would suspect that it's a limitation of the sound card driver.

That really sucks then. I thought all the drivers would support that.

Thanks
Chuck