This is a discussion on Re: audioio and pthreads don't work within the mailing.openbsd.tech forums, part of the OpenBSD category; --> Marco S Hyman wrote: > > The problem is that if I link an application with pthread, it just ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Marco S Hyman wrote: > > The problem is that if I link an application with pthread, it just won't > > read from the sound card. if I don't, it reads fine. > > When using pthread the threads library converts all I/O to non blocking, > but hides this from the application. This causes a problem with audio > as audio devices are opened with record.pause=1. Doing a blocked read > overrides the pause setting, a non-blocked read doesn't. > > Change your application to to explicity disable pause and things should > work just fine. Do this by adding > > audioInfo.record.pause = 0; > > before doing your AUDIO_SETINFO. thanks, this works now. two strange things though: without setting pause to 0, but duing an AUDIO_GETINFO, it would return 0 anyway, though recording wouldn't start. the other thing is that this hack is not needed on Solaris thanks anyway.. |