Re: [LAD] Jack ringbuffer

2015-12-10 Thread Len Ovens
On Thu, 10 Dec 2015, Will J Godfrey wrote: On Thu, 10 Dec 2015 06:51:48 -0800 (PST) Len Ovens wrote: You can check if there are 4 bytes available, if not don't read (yet). Normally (at least for anything I have done) the reason I use the ring buffer is to divorce the data

Re: [LAD] Jack ringbuffer

2015-12-10 Thread Will J Godfrey
On Thu, 10 Dec 2015 06:51:48 -0800 (PST) Len Ovens wrote: > On Thu, 10 Dec 2015, Will J Godfrey wrote: > > > On Thu, 10 Dec 2015 09:07:25 -0500 > > Paul Davis wrote: > > > >> On Thu, Dec 10, 2015 at 9:04 AM, Will Godfrey

Re: [LAD] Jack ringbuffer

2015-12-10 Thread Paul Davis
On Thu, Dec 10, 2015 at 9:04 AM, Will Godfrey wrote: > If I have a buffer size of 256 and always use a 4 byte data block, can I be > confident that reads and writes will either transfer the correct number > of bytes or none at all? > You cannot.

[LAD] Jack ringbuffer

2015-12-10 Thread Will Godfrey
If I have a buffer size of 256 and always use a 4 byte data block, can I be confident that reads and writes will either transfer the correct number of bytes or none at all? -- Will J Godfrey http://www.musically.me.uk Say you have a poem and I have a tune. Exchange them and we can both have a

Re: [LAD] Jack ringbuffer

2015-12-10 Thread Len Ovens
On Thu, 10 Dec 2015, Will J Godfrey wrote: On Thu, 10 Dec 2015 09:07:25 -0500 Paul Davis wrote: On Thu, Dec 10, 2015 at 9:04 AM, Will Godfrey wrote: If I have a buffer size of 256 and always use a 4 byte data block, can I be

Re: [LAD] jack ringbuffer usage

2013-04-12 Thread Raphaël BOLLEN
On 04/11/2013 11:35 PM, Jörn Nettingsmeier wrote: On 04/08/2013 05:27 PM, Raphaël BOLLEN wrote: On 04/08/2013 03:29 PM, Paul Davis wrote: all the xmms-based players do this (xmms, beep, beep2, audacious) gstreamer based players also do this across files, but not above play/stop. Thanks

Re: [LAD] jack ringbuffer usage

2013-04-11 Thread Jörn Nettingsmeier
On 04/08/2013 01:51 PM, Harry van Haaren wrote: On Mon, Apr 8, 2013 at 12:45 PM, Raphaël BOLLEN raphael.bol...@mobistar.be mailto:raphael.bol...@mobistar.be wrote: error: invalid conversion from 'void*' to 'char*' [-fpermissive] jack_ringbuffer_read() expects the buffer pointer to be of type

Re: [LAD] jack ringbuffer usage

2013-04-11 Thread Jörn Nettingsmeier
On 04/08/2013 05:27 PM, Raphaël BOLLEN wrote: On 04/08/2013 03:29 PM, Paul Davis wrote: all the xmms-based players do this (xmms, beep, beep2, audacious) gstreamer based players also do this across files, but not above play/stop. Thanks Paul, these are really fine programs but mostly for

[LAD] jack ringbuffer usage

2013-04-08 Thread Raphaël BOLLEN
Hi, I'm trying to use jack's ringbuffer like this: - initialization: jack_ringbuffer_t * ringBuf = jack_ringbuffer_create(sizeof(jack_default_audio_sample_t) * (116)); memset (ringBuf-buf, 0, ringBuf-size) ; - jack process callback: jack_default_audio_sample_t buf[numChannels]; size_t

Re: [LAD] jack ringbuffer usage

2013-04-08 Thread Harry van Haaren
On Mon, Apr 8, 2013 at 12:45 PM, Raphaël BOLLEN raphael.bol...@mobistar.be wrote: error: invalid conversion from 'void*' to 'char*' [-fpermissive] jack_ringbuffer_read() expects the buffer pointer to be of type char* not void*. The char* should just be interpreted as pointer, as the data is

Re: [LAD] jack ringbuffer usage

2013-04-08 Thread Raphaël BOLLEN
On 04/08/2013 01:51 PM, Harry van Haaren wrote: On Mon, Apr 8, 2013 at 12:45 PM, Raphaël BOLLEN raphael.bol...@mobistar.be mailto:raphael.bol...@mobistar.be wrote: error: invalid conversion from 'void*' to 'char*' [-fpermissive] jack_ringbuffer_read() expects the buffer pointer to be of type

Re: [LAD] jack ringbuffer usage

2013-04-08 Thread Harry van Haaren
On Mon, Apr 8, 2013 at 1:01 PM, Raphaël BOLLEN raphael.bol...@mobistar.bewrote: Hi Harry, thanks for the information. Your welcome! I'm intrested in what kind of JACK program you're working on..? Also I'm collecting example / tutorial code for JACK programming, perhaps its of intrest to you:

Re: [LAD] jack ringbuffer usage

2013-04-08 Thread Raphaël BOLLEN
On 04/08/2013 02:09 PM, Harry van Haaren wrote: On Mon, Apr 8, 2013 at 1:01 PM, Raphaël BOLLEN raphael.bol...@mobistar.be mailto:raphael.bol...@mobistar.be wrote: Hi Harry, thanks for the information. Your welcome! I'm intrested in what kind of JACK program you're working on..? It's yet

Re: [LAD] jack ringbuffer usage

2013-04-08 Thread Adrian Knoth
On Mon, Apr 08, 2013 at 02:23:07PM +0200, Raphaël BOLLEN wrote: It's yet another audio file player. My main interest (apart from playing audio :-) ) is that it makes permanent connections to jack instead of connecting / disconnecting when changing audio files. My 4deckradio does exactly this,

Re: [LAD] jack ringbuffer usage

2013-04-08 Thread Raphaël BOLLEN
On 04/08/2013 02:24 PM, Adrian Knoth wrote: On Mon, Apr 08, 2013 at 02:23:07PM +0200, Raphaël BOLLEN wrote: It's yet another audio file player. My main interest (apart from playing audio :-) ) is that it makes permanent connections to jack instead of connecting / disconnecting when changing

Re: [LAD] jack ringbuffer usage

2013-04-08 Thread Paul Davis
On Mon, Apr 8, 2013 at 8:23 AM, Raphaël BOLLEN raphael.bol...@mobistar.bewrote: On 04/08/2013 02:09 PM, Harry van Haaren wrote: On Mon, Apr 8, 2013 at 1:01 PM, Raphaël BOLLEN raphael.bol...@mobistar.be mailto:raphael.bollen@**mobistar.be raphael.bol...@mobistar.be wrote: Hi Harry,

Re: [LAD] jack ringbuffer usage

2013-04-08 Thread Adrian Knoth
On Mon, Apr 08, 2013 at 03:16:13PM +0200, Raphaël BOLLEN wrote: It's yet another audio file player. My main interest (apart from playing audio :-) ) is that it makes permanent connections to jack instead of connecting / disconnecting when changing audio files. My 4deckradio does exactly

Re: [LAD] jack ringbuffer usage

2013-04-08 Thread Raphaël BOLLEN
On 04/08/2013 03:29 PM, Paul Davis wrote: On Mon, Apr 8, 2013 at 8:23 AM, Raphaël BOLLEN raphael.bol...@mobistar.be mailto:raphael.bol...@mobistar.be wrote: On 04/08/2013 02:09 PM, Harry van Haaren wrote: On Mon, Apr 8, 2013 at 1:01 PM, Raphaël BOLLEN raphael.bol...@mobistar.be

Re: [LAD] jack ringbuffer usage

2013-04-08 Thread Raphaël BOLLEN
On 04/08/2013 03:49 PM, Adrian Knoth wrote: On Mon, Apr 08, 2013 at 03:16:13PM +0200, Raphaël BOLLEN wrote: It's yet another audio file player. My main interest (apart from playing audio :-) ) is that it makes permanent connections to jack instead of connecting / disconnecting when changing

Re: [LAD] jack ringbuffer usage

2013-04-08 Thread Adrian Knoth
On Mon, Apr 08, 2013 at 05:31:53PM +0200, Raphaël BOLLEN wrote: [4deckradio usage information] Thanks Adrian, may I suggest you copy paste this to your Readme.md file... Absolutely. Done and pushed. Thanks -- mail: a...@thur.de http://adi.thur.de PGP/GPG: key via keyserver

Re: [LAD] jack ringbuffer question

2009-12-08 Thread lieven moors
Thanks for pointing that out to me. I've started a version which uses atomic pointer exchange, and this is something I wasn't aware of. I think it shouldn't be a problem right now, as I keep the objects I use in memory, and I don't need the reaction of the program to the pointer swap to be a

Re: [LAD] jack ringbuffer question

2009-12-03 Thread lieven moors
Sean Bolton wrote: On Dec 2, 2009, at 7:33 AM, lieven moors wrote: Paul Davis wrote: On Tue, Dec 1, 2009 at 9:51 PM, lieven moors lievenmo...@gmail.com wrote: I want to repeat the same Arp, until there is an update to the text file. One arp is allready loaded in each ringbuffer in

Re: [LAD] jack ringbuffer question

2009-12-03 Thread Paul Coccoli
On Thu, Dec 3, 2009 at 8:14 AM, lieven moors lievenmo...@gmail.com wrote: Thanks very much for your reply! I was reluctant to start using atomic pointers, because I might change the program later to read longer sequences of Arps. So the ringbuffer approach might be a good choice after all. I

Re: [LAD] jack ringbuffer question

2009-12-02 Thread lieven moors
Paul Davis wrote: On Tue, Dec 1, 2009 at 9:51 PM, lieven moors lievenmo...@gmail.com wrote: I want to repeat the same Arp, until there is an update to the text file. One arp is allready loaded in each ringbuffer in main(). When the file is modified, a second one is added, and process

Re: [LAD] jack ringbuffer question

2009-12-02 Thread Kjetil S. Matheussen
lieven moors: I want to repeat the same Arp, until there is an update to the text file. One arp is allready loaded in each ringbuffer in main(). When the file is modified, a second one is added, and process skips to the second one. Since I have only space for two arps in the buffer, there

Re: [LAD] jack ringbuffer question

2009-12-02 Thread Sean Bolton
On Dec 2, 2009, at 7:33 AM, lieven moors wrote: Paul Davis wrote: On Tue, Dec 1, 2009 at 9:51 PM, lieven moors lievenmo...@gmail.com wrote: I want to repeat the same Arp, until there is an update to the text file. One arp is allready loaded in each ringbuffer in main(). When the file

[LAD] jack ringbuffer question

2009-12-01 Thread lieven moors
Hi everyone, I just started writing my first c++ program, and I'm kind of stuck with something I cannot understand. After a few days of trying to figure this out, I decided to ask for more professional help. I'm working on a kind of arpeggiator for linux (which I intend to release under GPL).

Re: [LAD] jack ringbuffer question

2009-12-01 Thread Paul Davis
On Tue, Dec 1, 2009 at 9:22 PM, lieven moors lievenmo...@gmail.com wrote: if( (jack_ringbuffer_read_space( (*arps_jack)[i].rb ) ) ==        (sizeof( Arp ) * 2) ) {   jack_ringbuffer_read_advance( (*arps_jack)[i].rb, sizeof(Arp) ) ; } You've just moved the read ptrs, before reading any data.

Re: [LAD] jack ringbuffer question

2009-12-01 Thread lieven moors
Paul Davis wrote: On Tue, Dec 1, 2009 at 9:22 PM, lieven moors lievenmo...@gmail.com wrote: if( (jack_ringbuffer_read_space( (*arps_jack)[i].rb ) ) == (sizeof( Arp ) * 2) ) { jack_ringbuffer_read_advance( (*arps_jack)[i].rb, sizeof(Arp) ) ; } You've just moved the read

Re: [LAD] jack ringbuffer question

2009-12-01 Thread Paul Davis
On Tue, Dec 1, 2009 at 9:51 PM, lieven moors lievenmo...@gmail.com wrote: I want to repeat the same Arp, until there is an update to the text file. One arp is allready loaded in each ringbuffer in main(). When the file is modified, a second one is added, and process skips to the second one.

Re: [LAD] jack ringbuffer question

2009-12-01 Thread lieven moors
Paul Davis wrote: On Tue, Dec 1, 2009 at 9:51 PM, lieven moors lievenmo...@gmail.com wrote: I want to repeat the same Arp, until there is an update to the text file. One arp is allready loaded in each ringbuffer in main(). When the file is modified, a second one is added, and process