RE: Re: Jack callbacks and stdio functions

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: Re: Jack callbacks and stdio functions

Robert Hamilton
Jack,

Thanks for the definitive answer! A followup:

Do you think I might be able to fopen, fread, fwrite, and fclose to a
RAMDISK subdirectory within my Jack client code, and still achieve the
low-latency performance necessary to avoid blocking or stalling the
callbacks?

B.H.
 
--- Jack O'Quin <[hidden email]> wrote:

> Robert Hamilton <[hidden email]> writes:
>
> > My question is: When designing for low-latancy Jack clients, would the
> > above cautions also apply to the use of such stdio functions as
> tmpfile,
> > fopen, fread, fwrite, and fclose? These all use the disk drive, unless
> > rerouted to a ram disk, which in the case of tmpfile would not work
> unless
> > its source code was altered.
>
> Yes.
> --
>   joq
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Jack callbacks and stdio functions

Paul Davis
>Do you think I might be able to fopen, fread, fwrite, and fclose to a
>RAMDISK subdirectory within my Jack client code, and still achieve the
>low-latency performance necessary to avoid blocking or stalling the
>callbacks?

no. you should not be accessing things in a filesystem, even a ramdisk
filesystem, from within the process() callback. you should be using
the ringbuffer data structures provided in libjack to move data
between the realtime/process thread and some other disk-i/o
thread. see the prototypical jack_capture_client in the
example_clients directory of the source tree for an example.

--p


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: Jack callbacks and stdio functions

Robert Hamilton
In reply to this post by Robert Hamilton

--- Paul Davis <[hidden email]> wrote:

> >Do you think I might be able to fopen, fread, fwrite, and fclose to a
> >RAMDISK subdirectory within my Jack client code, and still achieve the
> >low-latency performance necessary to avoid blocking or stalling the
> >callbacks?
>
> no. you should not be accessing things in a filesystem, even a ramdisk
> filesystem, from within the process() callback. you should be using
> the ringbuffer data structures provided in libjack to move data
> between the realtime/process thread and some other disk-i/o
> thread. see the prototypical jack_capture_client in the
> example_clients directory of the source tree for an example.
>
> --p

Paul,

Okay. Will do as you advise. Thanks for the tip; saved me a lot of
trouble, as I was about to use the ramdisk. Trying to "Jack-client"
rewrite an open source app of someone else's. (In WAY over my head!)

B.H.
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel