Csound Csound-dev Csound-tekno Search About

[Cs-dev] issue with audio channels..

Date2014-03-03 17:40
FromRory Walsh
Subject[Cs-dev] issue with audio channels..
I'm having some niggly problems with audio channels(testing on Linux).
I have a simple instrument:

instr 1
a1 chnget "leftChannel"
a2 chnget "rightChannel"
outs a1, a2
endin

Samples are being streamed from my frontend to Csound. Everything runs
fine until I try to recompile the instrument. At that point I get a
crash at csoundReset. Below is the backtrace:

0  0x00007ffff5c65e08  malloc_consolidate  malloc.c  4272
1  0x00007ffff5c66b89  malloc_consolidate  malloc.c  4247
2  0x00007ffff5c66b89  _int_free  malloc.c  4178
3  0x00007ffff6816616  memRESET
/home/rory/sourcecode/csound-csound6-git/Engine/memalloc.c  230
4  0x00007ffff696b3db  reset
/home/rory/sourcecode/csound-csound6-git/Top/csound.c  2672
5  0x00007ffff696bb06  csoundReset
/home/rory/sourcecode/csound-csound6-git/Top/csound.c  2787
6  0x00000000004d260e  Csound::Reset  /usr/local/include/csound/csound.hpp  367

I can't update my Csound build because sourceforge won't let me pull
from git. But I can try again later. Perhaps this issue has already be
resolved.

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-03-03 18:25
FromVictor Lazzarini
SubjectRe: [Cs-dev] issue with audio channels..
Why is CsoundReset called at all when you recompile?

Victor
On 3 Mar 2014, at 17:40, Rory Walsh  wrote:

> I'm having some niggly problems with audio channels(testing on Linux).
> I have a simple instrument:
> 
> instr 1
> a1 chnget "leftChannel"
> a2 chnget "rightChannel"
> outs a1, a2
> endin
> 
> Samples are being streamed from my frontend to Csound. Everything runs
> fine until I try to recompile the instrument. At that point I get a
> crash at csoundReset. Below is the backtrace:
> 
> 0  0x00007ffff5c65e08  malloc_consolidate  malloc.c  4272
> 1  0x00007ffff5c66b89  malloc_consolidate  malloc.c  4247
> 2  0x00007ffff5c66b89  _int_free  malloc.c  4178
> 3  0x00007ffff6816616  memRESET
> /home/rory/sourcecode/csound-csound6-git/Engine/memalloc.c  230
> 4  0x00007ffff696b3db  reset
> /home/rory/sourcecode/csound-csound6-git/Top/csound.c  2672
> 5  0x00007ffff696bb06  csoundReset
> /home/rory/sourcecode/csound-csound6-git/Top/csound.c  2787
> 6  0x00000000004d260e  Csound::Reset  /usr/local/include/csound/csound.hpp  367
> 
> I can't update my Csound build because sourceforge won't let me pull
> from git. But I can try again later. Perhaps this issue has already be
> resolved.
> 
> ------------------------------------------------------------------------------
> Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
> With Perforce, you get hassle-free workflows. Merge that actually works. 
> Faster operations. Version large binaries.  Built-in WAN optimization and the
> freedom to use Git, Perforce or both. Make the move to Perforce.
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-03-03 18:30
FromVictor Lazzarini
SubjectRe: [Cs-dev] issue with audio channels..
and while you’re at that, if you can demonstrate the problem with a short program, it will help us debug. The
backtrace is pointing to free(), but beyond that I can’t see what the issue is.

Victor
On 3 Mar 2014, at 17:40, Rory Walsh  wrote:

> I'm having some niggly problems with audio channels(testing on Linux).
> I have a simple instrument:
> 
> instr 1
> a1 chnget "leftChannel"
> a2 chnget "rightChannel"
> outs a1, a2
> endin
> 
> Samples are being streamed from my frontend to Csound. Everything runs
> fine until I try to recompile the instrument. At that point I get a
> crash at csoundReset. Below is the backtrace:
> 
> 0  0x00007ffff5c65e08  malloc_consolidate  malloc.c  4272
> 1  0x00007ffff5c66b89  malloc_consolidate  malloc.c  4247
> 2  0x00007ffff5c66b89  _int_free  malloc.c  4178
> 3  0x00007ffff6816616  memRESET
> /home/rory/sourcecode/csound-csound6-git/Engine/memalloc.c  230
> 4  0x00007ffff696b3db  reset
> /home/rory/sourcecode/csound-csound6-git/Top/csound.c  2672
> 5  0x00007ffff696bb06  csoundReset
> /home/rory/sourcecode/csound-csound6-git/Top/csound.c  2787
> 6  0x00000000004d260e  Csound::Reset  /usr/local/include/csound/csound.hpp  367
> 
> I can't update my Csound build because sourceforge won't let me pull
> from git. But I can try again later. Perhaps this issue has already be
> resolved.
> 
> ------------------------------------------------------------------------------
> Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
> With Perforce, you get hassle-free workflows. Merge that actually works. 
> Faster operations. Version large binaries.  Built-in WAN optimization and the
> freedom to use Git, Perforce or both. Make the move to Perforce.
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-03-03 19:18
FromRory Walsh
SubjectRe: [Cs-dev] issue with audio channels..
I call CsoundReset because if i don't Csound politely says:

Csound is already started, call csoundReset() before starting again??

I can try writing a simple demo. I posted on the off-chance you might
spot something obvious in the back trace. Another thing I've noticed
is that it is quite erratic. I can always get it to crash, but I never
know exactly when it will. I assume there are no issues in calling
Csound reset at any stage during a k-cycle?

On 3 March 2014 18:30, Victor Lazzarini  wrote:
> and while you're at that, if you can demonstrate the problem with a short program, it will help us debug. The
> backtrace is pointing to free(), but beyond that I can't see what the issue is.
>
> Victor
> On 3 Mar 2014, at 17:40, Rory Walsh  wrote:
>
>> I'm having some niggly problems with audio channels(testing on Linux).
>> I have a simple instrument:
>>
>> instr 1
>> a1 chnget "leftChannel"
>> a2 chnget "rightChannel"
>> outs a1, a2
>> endin
>>
>> Samples are being streamed from my frontend to Csound. Everything runs
>> fine until I try to recompile the instrument. At that point I get a
>> crash at csoundReset. Below is the backtrace:
>>
>> 0  0x00007ffff5c65e08  malloc_consolidate  malloc.c  4272
>> 1  0x00007ffff5c66b89  malloc_consolidate  malloc.c  4247
>> 2  0x00007ffff5c66b89  _int_free  malloc.c  4178
>> 3  0x00007ffff6816616  memRESET
>> /home/rory/sourcecode/csound-csound6-git/Engine/memalloc.c  230
>> 4  0x00007ffff696b3db  reset
>> /home/rory/sourcecode/csound-csound6-git/Top/csound.c  2672
>> 5  0x00007ffff696bb06  csoundReset
>> /home/rory/sourcecode/csound-csound6-git/Top/csound.c  2787
>> 6  0x00000000004d260e  Csound::Reset  /usr/local/include/csound/csound.hpp  367
>>
>> I can't update my Csound build because sourceforge won't let me pull
>> from git. But I can try again later. Perhaps this issue has already be
>> resolved.
>>
>> ------------------------------------------------------------------------------
>> Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
>> With Perforce, you get hassle-free workflows. Merge that actually works.
>> Faster operations. Version large binaries.  Built-in WAN optimization and the
>> freedom to use Git, Perforce or both. Make the move to Perforce.
>> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
> With Perforce, you get hassle-free workflows. Merge that actually works.
> Faster operations. Version large binaries.  Built-in WAN optimization and the
> freedom to use Git, Perforce or both. Make the move to Perforce.
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-03-03 19:28
FromVictor Lazzarini
SubjectRe: [Cs-dev] issue with audio channels..
But you can recompile without stopping Csound and calling CsoundStart() again, you don’t need
to clean it up to recompile (unless you are changing engine parameters such as SR, channels, or
other configurations).

Victor
On 3 Mar 2014, at 19:18, Rory Walsh  wrote:

> I call CsoundReset because if i don't Csound politely says:
> 
> Csound is already started, call csoundReset() before starting again??
> 
> I can try writing a simple demo. I posted on the off-chance you might
> spot something obvious in the back trace. Another thing I've noticed
> is that it is quite erratic. I can always get it to crash, but I never
> know exactly when it will. I assume there are no issues in calling
> Csound reset at any stage during a k-cycle?
> 
> On 3 March 2014 18:30, Victor Lazzarini  wrote:
>> and while you're at that, if you can demonstrate the problem with a short program, it will help us debug. The
>> backtrace is pointing to free(), but beyond that I can't see what the issue is.
>> 
>> Victor
>> On 3 Mar 2014, at 17:40, Rory Walsh  wrote:
>> 
>>> I'm having some niggly problems with audio channels(testing on Linux).
>>> I have a simple instrument:
>>> 
>>> instr 1
>>> a1 chnget "leftChannel"
>>> a2 chnget "rightChannel"
>>> outs a1, a2
>>> endin
>>> 
>>> Samples are being streamed from my frontend to Csound. Everything runs
>>> fine until I try to recompile the instrument. At that point I get a
>>> crash at csoundReset. Below is the backtrace:
>>> 
>>> 0  0x00007ffff5c65e08  malloc_consolidate  malloc.c  4272
>>> 1  0x00007ffff5c66b89  malloc_consolidate  malloc.c  4247
>>> 2  0x00007ffff5c66b89  _int_free  malloc.c  4178
>>> 3  0x00007ffff6816616  memRESET
>>> /home/rory/sourcecode/csound-csound6-git/Engine/memalloc.c  230
>>> 4  0x00007ffff696b3db  reset
>>> /home/rory/sourcecode/csound-csound6-git/Top/csound.c  2672
>>> 5  0x00007ffff696bb06  csoundReset
>>> /home/rory/sourcecode/csound-csound6-git/Top/csound.c  2787
>>> 6  0x00000000004d260e  Csound::Reset  /usr/local/include/csound/csound.hpp  367
>>> 
>>> I can't update my Csound build because sourceforge won't let me pull
>>> from git. But I can try again later. Perhaps this issue has already be
>>> resolved.
>>> 
>>> ------------------------------------------------------------------------------
>>> Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
>>> With Perforce, you get hassle-free workflows. Merge that actually works.
>>> Faster operations. Version large binaries.  Built-in WAN optimization and the
>>> freedom to use Git, Perforce or both. Make the move to Perforce.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
>> 
>> ------------------------------------------------------------------------------
>> Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
>> With Perforce, you get hassle-free workflows. Merge that actually works.
>> Faster operations. Version large binaries.  Built-in WAN optimization and the
>> freedom to use Git, Perforce or both. Make the move to Perforce.
>> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 
> ------------------------------------------------------------------------------
> Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
> With Perforce, you get hassle-free workflows. Merge that actually works. 
> Faster operations. Version large binaries.  Built-in WAN optimization and the
> freedom to use Git, Perforce or both. Make the move to Perforce.
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-03-03 19:34
FromVictor Lazzarini
SubjectRe: [Cs-dev] issue with audio channels..
No, I don’t think that is a good idea, csoundReset() should be called only after you stop running
csoundPerformKsmps(), and not concurrently with it.

Victor
On 3 Mar 2014, at 19:18, Rory Walsh  wrote:

>  I assume there are no issues in calling
> Csound reset at any stage during a k-cycle?


------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-03-03 20:02
FromRory Walsh
SubjectRe: [Cs-dev] issue with audio channels..
With regards to the first point about not resetting Csound, channels
can change, and so can MIDI settings, or audio settings for that
matter. I think it's safest to call reset. The user case here is
someone opening a Cabbage instrument, making changes to any part of
the csd file and then re-compiling. My code prevents
csoundPerformKsmps() from being called during a re-compile but I need
to double check this. The erratic nature of this crash seems to lean
towards that being the problem.

On 3 March 2014 19:34, Victor Lazzarini  wrote:
> No, I don't think that is a good idea, csoundReset() should be called only after you stop running
> csoundPerformKsmps(), and not concurrently with it.
>
> Victor
> On 3 Mar 2014, at 19:18, Rory Walsh  wrote:
>
>>  I assume there are no issues in calling
>> Csound reset at any stage during a k-cycle?
>
>
> ------------------------------------------------------------------------------
> Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
> With Perforce, you get hassle-free workflows. Merge that actually works.
> Faster operations. Version large binaries.  Built-in WAN optimization and the
> freedom to use Git, Perforce or both. Make the move to Perforce.
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-03-03 20:50
FromRory Walsh
SubjectRe: [Cs-dev] issue with audio channels..
I think I've identified the problem here, and see a possible solution.
It was a worker thread in the background that was causing the problem.
Sorry for the noise and thanks for prompt reply as always.

Rory.


On 3 March 2014 20:02, Rory Walsh  wrote:
> With regards to the first point about not resetting Csound, channels
> can change, and so can MIDI settings, or audio settings for that
> matter. I think it's safest to call reset. The user case here is
> someone opening a Cabbage instrument, making changes to any part of
> the csd file and then re-compiling. My code prevents
> csoundPerformKsmps() from being called during a re-compile but I need
> to double check this. The erratic nature of this crash seems to lean
> towards that being the problem.
>
> On 3 March 2014 19:34, Victor Lazzarini  wrote:
>> No, I don't think that is a good idea, csoundReset() should be called only after you stop running
>> csoundPerformKsmps(), and not concurrently with it.
>>
>> Victor
>> On 3 Mar 2014, at 19:18, Rory Walsh  wrote:
>>
>>>  I assume there are no issues in calling
>>> Csound reset at any stage during a k-cycle?
>>
>>
>> ------------------------------------------------------------------------------
>> Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
>> With Perforce, you get hassle-free workflows. Merge that actually works.
>> Faster operations. Version large binaries.  Built-in WAN optimization and the
>> freedom to use Git, Perforce or both. Make the move to Perforce.
>> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net