On Tue, Dec 1, 2009 at 9:22 PM, lieven moors <lievenmoors@email-addr-hidden> 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. Why did you
check to see if there were 2 Arp structures available, and then skip
one of them?
> if( (jack_ringbuffer_read_space( (*arps_jack)[i].rb ) ) ==
> sizeof( Arp ) )
this won't return true unless there ONLY one Arp struct to read.
> {
> jack_ringbuffer_data_t data[2] ;
> jack_ringbuffer_get_read_vector( (*arps_jack)[i].rb, data ) ;
now you've got a read vector, but *after* you advanced the read ptr.
> if ( data[0].len > 0 )
> {
> arp = reinterpret_cast<Arp*>( data[0].buf ) ;
> steps = &arp->steps ;
> scale = &arp->scale ;
> }
> else if( data[1].len > 0)
> {
> cout << "data in second part of ringbuffer, this should not
> happen!" << endl ;
> }
now you've used the data from the ringbuffer, but not advanced the read ptr.
if you're going to use get_read_vector() you want to do that first,
then explicitly advanced the read ptr.
not sure if this is all that is going wrong, but this looks odd/wrong
to me as a starting point.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Wed Dec 2 08:15:01 2009
This archive was generated by hypermail 2.1.8 : Wed Dec 02 2009 - 08:15:01 EET