Re: Recording to file
Re: Recording to file
- Subject: Re: Recording to file
- From: Jeff Moore <email@hidden>
- Date: Sat, 6 Jul 2002 15:54:18 -0700
On Saturday, July 6, 2002, at 06:30 AM, Paul Haddad wrote:
My follow up question is what's the proper way to queue up the data
and pass it to the other thread. John suggested one way, which of the
top of my head seems somewhat expensive. I've tried using a fifo
(mkfifo), NSPipe, mach semaphore with circular buffer and unix
semaphore with circular buffer (sem_open).
Using the unix semaphore seemed to yield the best performance (the CPU
wasn't pegged) and it was relatively simple, but I'd much rather use
some sort of fifo/queue structure so that I could easily read the data
in sizes other then 1024 samples (lame seems to like 1152/channel).
So what if any is the one true way?
The one true way would depend on your circumstances. Sometimes you can
just stick the data in a ring buffer and ignore concurrency issues,
sometimes you can't and need to seek a more rigorous solution. I'd go
with whatever works and gives you the performance you want for the
situation you have.
One thing you should keep in mind is that you really do not want to put
the IO thread to sleep for an unbounded amount of time. It will wreak
havoc with the timing of things by making it look like your IOProc is
going CPU bound.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.