[LAD] jack ringbuffer usage

Raphaël BOLLEN raphael.bollen at mobistar.be
Mon Apr 8 11:45:32 UTC 2013


I'm trying to use jack's ringbuffer like this:

- initialization:

jack_ringbuffer_t * ringBuf = jack_ringbuffer_create(sizeof(jack_default_audio_sample_t) * (1<<16));
memset (ringBuf->buf, 0, ringBuf->size) ;

- jack process callback:

jack_default_audio_sample_t buf[numChannels];
size_t read_cnt = 0;
for (_frameCounter=0; _frameCounter < nFrames; _frameCounter++) {
     read_cnt = jack_ringbuffer_read(ringBuf, (void*)buf, sample_size * numChannels);
                                              ^^^^^^^^^  error

but g++ won't compile the code and report this

error: invalid conversion from 'void*' to 'char*' [-fpermissive]
/usr/local/include/jack/ringbuffer.h:136: error:   initializing argument 2 of 'size_t 
jack_ringbuffer_read(jack_ringbuffer_t*, char*, size_t)' [-fpermissive]

passing -fpermissive gets the program running but is it the right way to do it?



More information about the Linux-audio-dev mailing list