Unix Technical Forum

Re: audioio and pthreads don't work

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 ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 06:48 AM
Akos Maroy
 
Posts: n/a
Default Re: audioio and pthreads don't work

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..

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:46 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com