-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open() blocking forever #14
Comments
Ah! Yeah! Good idea. Though we might need to expose the behavior as an argument to the function, because from what I'm reading this might have a lot to do with which driver your sound card uses. Some of them only support one thing using it at a time, which means the blocking behavior might be more correct (at least in the POSIX-ey sense.) |
It does seem pedantic though to block until the sound becomes free. I wouldn't really want some queued up HONK to happen after stopping my music player. |
The issue
In https://github.com/yobert/alsa/blob/master/device.go#L107, the
os.OpenFile
call does not have asyscall.O_NONBLOCK
flag. I suspect this is causing thebeep
example on my pure ALSA setup to block. (I've tested and nailed it down to theOpen()
method). This does not happen with PulseAudio.Proposal:
Add
syscall.O_NONBLOCK
like so:The text was updated successfully, but these errors were encountered: