[Stk] crtsine example fixed for linux, can we update the docs?

Gary Scavone gary at ccrma.Stanford.EDU
Wed Sep 28 09:06:05 PDT 2011


Hi Iain,

I finally got around to testing this and I found no problem using interleaved or non-interleaved audio on my 64-bit linux system.  Note that the issue here is primarily the RtAudio class, and not any STK classes.

I tested interleaved and non-interleaved audio output using both the ALSA and JACK APIs.  My linux distribution is Fedora 11.  My audio hardware is an Intel chipset on the motherboard and an RME HDSP 9632 card.

Thus, I'm guessing this might be a hardware specific issue.  What soundcard were you testing on?

Regards,

--gary

On 2011-09-11, at 4:48 PM, Iain Duncan wrote:

> Hi Gary, by making a hybrid of playsaw.cpp and crtsine.cpp I was able to figure out why the crtsine example doesn't work on my system, which is 64-bit Ubuntu Studio. The fix held true for both Alsa and jack.
> 
> In playsaw.cpp the following is included:
> 
> RtAudio::StreamOptions options;
> options.flags |= RTAUDIO_HOG_DEVICE;
> options.flags |= RTAUDIO_SCHEDULE_REALTIME;
> #if !defined( USE_INTERLEAVED )
> options.flags |= RTAUDIO_NONINTERLEAVED;
> #endif
> 
> and the options object is passed to dac.openStream.  It turns out that the RTAUDIO_NONINTERLEAVED option is critical on my box at least. 
> 
> In crtsine, no options object is made or passed. Adding the following to crtsine fixed everything and I can play back fine with any buffer size:
> 
> RtAudio::StreamOptions options;
> // these two options are optional on linux
> options.flags |= RTAUDIO_HOG_DEVICE;
> options.flags |= RTAUDIO_SCHEDULE_REALTIME;
> // the below is required to get clean output on my 64-bit linux, with either jack or alsa 
> #if !defined( USE_INTERLEAVED )
> options.flags |= RTAUDIO_NONINTERLEAVED;
> #endif
> 
> ...
> dac.openStream( &oParams, NULL, format, sampleRate, &bufferFrames, &tick, (void *)&sine, &options );
> ...
> 
> 
> Not sure what you would like to do about the docs, but I can attest that people checking out RtAudio would love to have that note there. I'm happy to update them if it meets your approval. I'm just not sure how a user would know whether they should be using non-interleaved or not.
> 
> thanks
> Iain
> _______________________________________________
> Stk mailing list
> Stk at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk




More information about the Stk mailing list