Sound Programming and Signals
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
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]>
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_ASYNCflag on the descriptor, either in the call toopen(), or with a subsequent call tofcntl(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