# Stack smashing with rtaudio

**URL:** <https://forum.csound.com/t/stack-smashing-with-rtaudio/1406>\
**Category:** Newbies\
**Created:** [October 20, 2023, 12:31pm UTC](https://forum.csound.com/t/stack-smashing-with-rtaudio/1406 "2023-10-20T12:31:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bill\_P](https://forum.csound.com/letter_avatar_proxy/v4/letter/b/e9a140/32.png) [@Bill\_P](https://forum.csound.com/u/Bill_P)\
**Post date:** [October 20, 2023, 12:31pm UTC](https://forum.csound.com/t/stack-smashing-with-rtaudio/1406/1 "2023-10-20T12:31:48Z")

</div>

I’ve been recommended to use Csound as an audio mixer with jack, mixing 7 audio inputs down to 5 outputs.  
I have used csound many years ago, but I hadn’t used rtaudio (wasn’t available back then!).  
In that sense I guess I’m a newbie, though I am familiar with basic Csound stuff.

When I tried the example script I was given I got messages to say my buffer size was not acceptable.  
I’m running Jack at 44100sps with 1024samples per period. I tried making the buffer larger (-B 4096) and get stack smashing errors. Also the output suggests it is reading raw shorts from the inputs, but the ports are actually handling samples as 32-bit floats. Any advice on setting things up to get it to work?

An added complication is that I recently moved to using pipewire with the pw-jack add-on. I have been  
using jack for a long time, but pipewire may be interacting in some way outside my knowledge.

---

<div class="post-metadata">

**Author:** ![Anthony](https://forum.csound.com/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@Anthony](https://forum.csound.com/u/Anthony)\
**Post date:** [July 1, 2024, 10:03am UTC](https://forum.csound.com/t/stack-smashing-with-rtaudio/1406/2 "2024-07-01T10:03:40Z")

</div>

This solution (update to InOut/rtjack.c ) might help you:

> <https://github.com/csound/csound/issues/1903>
>
> Hi,
> 
> When I try to start csound as follows:
> \`csound -+rtaudio=jack -odac --de…vices
> \`
> 
> The following stack smashing error is reported:
> \`\`\`
> rtaudio: JACK module enabled
> \*\*\* stack smashing detected \*\*\*: terminated
> 
> csound command: Aborted
> end of score. overall amps: 0.0
> overall samples out of range: 0
> 0 errors in performance
> Elapsed time at end of performance: real: 0.258s, CPU: 0.006s
> \`\`\`
> 
> 
> I am running \`Csound version 6.18 (double samples) Apr 7 2024\` on Arch Linux.
> 
> Pipewire is installed:
> \`pipewire --version
> pipewire
> Compiled with libpipewire 1.0.7
> Linked with libpipewire 1.0.7
> \`
> 
> The problem shows up when using CsoundQt and pressing the configure button. I was able to track down the call in CsoundQt to this line in configlists.cpp:
> \` CSOUND \*cs = csoundCreate(nullptr);\`
> 
> csound itself seems to work will except for the above command line.
> CsoundQt seems to work well except when the configuration button is pressed.
