Csound Csound-dev Csound-tekno Search About

[Cs-dev] csoundPerformKsmp() question/proposal

Date2005-10-14 22:52
FromIain Duncan
Subject[Cs-dev] csoundPerformKsmp() question/proposal
Thinking more on the cpu sharing issue.

In the following loop:

while( cs_performing )
{
    	cs_performing = csoundPerformKsmp( csound );
}

I assume the cpu idles somewhere in csoundPerfromKsmp() because it can't 
calculate a ksmp beyond our buffer size for real time right? So, would 
the following be possible to implement:

- a version of csoundPerfromKsmp() that takes a mutex in addition to the 
csound instance
- inside, it locks the mutex, performs, and releases the mutex before 
idling, and gets called like:

while( cs_performing )
{
	cs_performing = csoundPerformKsmpWait( csound, &cs_wait_mutex );
}
	
and elsewhere in another thread we have a loop that repeatedly does:

while( cs_performing )
{
	csoundWaitThreadLockNoTimeOut( cs_wait_mutex );
	// take one message off the queue
	// send one data item into or out of csound
	csoundNotifyThreadLock( cs_wait_mutex );
}

This way, we would lock csound out of performKsmp for the maximum of 
time taken to write one api call, which I can totally live with. If it's 
time for csound to perform audio, it will be waiting on that mutex, and 
as we are only going to be taking one item off a queue and dumping it 
into csound, that wait should be very small.

Does this makes sense? Is there a better way? Would the 
csoundPerformKsmpWait( csound, mutex ) be a good api addition? I 
personally like the idea of not having to get to smaller sizes than the 
ksmp for buffering.

Thanks
Iain



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-03-01 19:55
Fromscarbo
SubjectRe: [Cs-dev] csoundPerformKsmp() question/proposal
Hello everybody, I have this gib problem:
This is the callback in my iOs app.
The code work fine as expected in realtime, also when I run application
through Cubasis Inter-Audio app work fine but when I freeze in Cubasis
(audio callback is called as soon possible), the incoming audio is
truncated, stuttering in the waveform. Could be something related to
csoundPerformKsmps thread?
Thanks in advances.


    csdata *cdata = (csdata *) inRefCon;
    int ret = cdata->ret, nchnls = cdata->nchnls;
    float coef = (float) INT_MAX / csoundGet0dBFS(cdata->cs);
    CSOUND *cs = cdata->cs;

    int ksmps = csoundGetKsmps(cs);
    MYFLT *spin = csoundGetSpin(cs);
    MYFLT *spout = csoundGetSpout(cs);

    // Get a pointer to the dataBuffer of the AudioBufferList
	AudioUnitSampleType *outL = (AudioUnitSampleType
*)ioData->mBuffers[0].mData;
    AudioUnitSampleType *outR = (AudioUnitSampleType
*)ioData->mBuffers[1].mData;
    
	// Perform ksmps bock
    if(!ret) {
        ret = csoundPerformKsmps(cs);
    
    } else {
        cdata->running = false;
    }
    
	// Symple copy spout in iOs buffer
	for (UInt32 i = 0; i < ksmps; i++) {

        outL[i] = (AudioUnitSampleType) (MYFLT)(spout[i * nchnls] * coef);
        outR[i] = (AudioUnitSampleType) (MYFLT)(spout[(i * nchnls) + 1] *
coef);
    }
        
    cdata->ret = ret;
    return  noErr;

    



--
View this message in context: http://csound.1045644.n5.nabble.com/csoundPerformKsmp-question-proposal-tp1124595p5732903.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-03-04 21:44
FromAndres Cabrera
SubjectRe: [Cs-dev] csoundPerformKsmp() question/proposal
AttachmentsNone  None  
Hi,

I have noticed this problem with coreaudio (not a porblem with portaudio or jack), that the buffers are not flushed to 0 when playing is paused. From what I looked, it's not trivial to fix, but maybe someone else can look.

Cheers,
Andrés


On Sat, Mar 1, 2014 at 11:55 AM, scarbo <alessandropetrolati@me.com> wrote:
Hello everybody, I have this gib problem:
This is the callback in my iOs app.
The code work fine as expected in realtime, also when I run application
through Cubasis Inter-Audio app work fine but when I freeze in Cubasis
(audio callback is called as soon possible), the incoming audio is
truncated, stuttering in the waveform. Could be something related to
csoundPerformKsmps thread?
Thanks in advances.


    csdata *cdata = (csdata *) inRefCon;
    int ret = cdata->ret, nchnls = cdata->nchnls;
    float coef = (float) INT_MAX / csoundGet0dBFS(cdata->cs);
    CSOUND *cs = cdata->cs;

    int ksmps = csoundGetKsmps(cs);
    MYFLT *spin = csoundGetSpin(cs);
    MYFLT *spout = csoundGetSpout(cs);

    // Get a pointer to the dataBuffer of the AudioBufferList
        AudioUnitSampleType *outL = (AudioUnitSampleType
*)ioData->mBuffers[0].mData;
    AudioUnitSampleType *outR = (AudioUnitSampleType
*)ioData->mBuffers[1].mData;

        // Perform ksmps bock
    if(!ret) {
        ret = csoundPerformKsmps(cs);

    } else {
        cdata->running = false;
    }

        // Symple copy spout in iOs buffer
        for (UInt32 i = 0; i < ksmps; i++) {

        outL[i] = (AudioUnitSampleType) (MYFLT)(spout[i * nchnls] * coef);
        outR[i] = (AudioUnitSampleType) (MYFLT)(spout[(i * nchnls) + 1] *
coef);
    }

    cdata->ret = ret;
    return  noErr;





--
View this message in context: http://csound.1045644.n5.nabble.com/csoundPerformKsmp-question-proposal-tp1124595p5732903.html
Sent from the Csound - Dev mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2014-03-04 23:06
FromVictor Lazzarini
SubjectRe: [Cs-dev] csoundPerformKsmp() question/proposal
How is the pause done (using CsoundPerformanceThread()?)

Victor
On 4 Mar 2014, at 21:44, Andres Cabrera  wrote:

> Hi,
> 
> I have noticed this problem with coreaudio (not a porblem with portaudio or jack), that the buffers are not flushed to 0 when playing is paused. From what I looked, it's not trivial to fix, but maybe someone else can look.
> 
> Cheers,
> Andrés
> 
> 
> On Sat, Mar 1, 2014 at 11:55 AM, scarbo  wrote:
> Hello everybody, I have this gib problem:
> This is the callback in my iOs app.
> The code work fine as expected in realtime, also when I run application
> through Cubasis Inter-Audio app work fine but when I freeze in Cubasis
> (audio callback is called as soon possible), the incoming audio is
> truncated, stuttering in the waveform. Could be something related to
> csoundPerformKsmps thread?
> Thanks in advances.
> 
> 
>     csdata *cdata = (csdata *) inRefCon;
>     int ret = cdata->ret, nchnls = cdata->nchnls;
>     float coef = (float) INT_MAX / csoundGet0dBFS(cdata->cs);
>     CSOUND *cs = cdata->cs;
> 
>     int ksmps = csoundGetKsmps(cs);
>     MYFLT *spin = csoundGetSpin(cs);
>     MYFLT *spout = csoundGetSpout(cs);
> 
>     // Get a pointer to the dataBuffer of the AudioBufferList
>         AudioUnitSampleType *outL = (AudioUnitSampleType
> *)ioData->mBuffers[0].mData;
>     AudioUnitSampleType *outR = (AudioUnitSampleType
> *)ioData->mBuffers[1].mData;
> 
>         // Perform ksmps bock
>     if(!ret) {
>         ret = csoundPerformKsmps(cs);
> 
>     } else {
>         cdata->running = false;
>     }
> 
>         // Symple copy spout in iOs buffer
>         for (UInt32 i = 0; i < ksmps; i++) {
> 
>         outL[i] = (AudioUnitSampleType) (MYFLT)(spout[i * nchnls] * coef);
>         outR[i] = (AudioUnitSampleType) (MYFLT)(spout[(i * nchnls) + 1] *
> coef);
>     }
> 
>     cdata->ret = ret;
>     return  noErr;
> 
> 
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/csoundPerformKsmp-question-proposal-tp1124595p5732903.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
> 
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&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-04 23:10
FromAndres Cabrera
SubjectRe: [Cs-dev] csoundPerformKsmp() question/proposal
AttachmentsNone  None  
Right.

I have seen these issues with the performace thread. So maybe the issues are not the same.

Cheers,
Andrés


On Tue, Mar 4, 2014 at 3:06 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
How is the pause done (using CsoundPerformanceThread()?)

Victor
On 4 Mar 2014, at 21:44, Andres Cabrera <mantaraya36@gmail.com> wrote:

> Hi,
>
> I have noticed this problem with coreaudio (not a porblem with portaudio or jack), that the buffers are not flushed to 0 when playing is paused. >From what I looked, it's not trivial to fix, but maybe someone else can look.
>
> Cheers,
> Andrés
>
>
> On Sat, Mar 1, 2014 at 11:55 AM, scarbo <alessandropetrolati@me.com> wrote:
> Hello everybody, I have this gib problem:
> This is the callback in my iOs app.
> The code work fine as expected in realtime, also when I run application
> through Cubasis Inter-Audio app work fine but when I freeze in Cubasis
> (audio callback is called as soon possible), the incoming audio is
> truncated, stuttering in the waveform. Could be something related to
> csoundPerformKsmps thread?
> Thanks in advances.
>
>
>     csdata *cdata = (csdata *) inRefCon;
>     int ret = cdata->ret, nchnls = cdata->nchnls;
>     float coef = (float) INT_MAX / csoundGet0dBFS(cdata->cs);
>     CSOUND *cs = cdata->cs;
>
>     int ksmps = csoundGetKsmps(cs);
>     MYFLT *spin = csoundGetSpin(cs);
>     MYFLT *spout = csoundGetSpout(cs);
>
>     // Get a pointer to the dataBuffer of the AudioBufferList
>         AudioUnitSampleType *outL = (AudioUnitSampleType
> *)ioData->mBuffers[0].mData;
>     AudioUnitSampleType *outR = (AudioUnitSampleType
> *)ioData->mBuffers[1].mData;
>
>         // Perform ksmps bock
>     if(!ret) {
>         ret = csoundPerformKsmps(cs);
>
>     } else {
>         cdata->running = false;
>     }
>
>         // Symple copy spout in iOs buffer
>         for (UInt32 i = 0; i < ksmps; i++) {
>
>         outL[i] = (AudioUnitSampleType) (MYFLT)(spout[i * nchnls] * coef);
>         outR[i] = (AudioUnitSampleType) (MYFLT)(spout[(i * nchnls) + 1] *
> coef);
>     }
>
>     cdata->ret = ret;
>     return  noErr;
>
>
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/csoundPerformKsmp-question-proposal-tp1124595p5732903.html
> Sent from the Csound - Dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&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_______________________________________________
------------------------------------------------------------------------------
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


Date2014-03-04 23:21
FromVictor Lazzarini
SubjectRe: [Cs-dev] csoundPerformKsmp() question/proposal
yes, the iOS IO and the coreaudio module are implemented differently. For instance, in iOS, the callback runs performKsmps(), in
the OSX coreaudio module there is a circular buffer to connect the callback and the processing thread.
On 4 Mar 2014, at 23:10, Andres Cabrera  wrote:

> Right.
> 
> I have seen these issues with the performace thread. So maybe the issues are not the same.
> 
> Cheers,
> Andrés
> 
> 
> On Tue, Mar 4, 2014 at 3:06 PM, Victor Lazzarini  wrote:
> How is the pause done (using CsoundPerformanceThread()?)
> 
> Victor
> On 4 Mar 2014, at 21:44, Andres Cabrera  wrote:
> 
> > Hi,
> >
> > I have noticed this problem with coreaudio (not a porblem with portaudio or jack), that the buffers are not flushed to 0 when playing is paused. >>From what I looked, it's not trivial to fix, but maybe someone else can look.
> >
> > Cheers,
> > Andrés
> >
> >
> > On Sat, Mar 1, 2014 at 11:55 AM, scarbo  wrote:
> > Hello everybody, I have this gib problem:
> > This is the callback in my iOs app.
> > The code work fine as expected in realtime, also when I run application
> > through Cubasis Inter-Audio app work fine but when I freeze in Cubasis
> > (audio callback is called as soon possible), the incoming audio is
> > truncated, stuttering in the waveform. Could be something related to
> > csoundPerformKsmps thread?
> > Thanks in advances.
> >
> >
> >     csdata *cdata = (csdata *) inRefCon;
> >     int ret = cdata->ret, nchnls = cdata->nchnls;
> >     float coef = (float) INT_MAX / csoundGet0dBFS(cdata->cs);
> >     CSOUND *cs = cdata->cs;
> >
> >     int ksmps = csoundGetKsmps(cs);
> >     MYFLT *spin = csoundGetSpin(cs);
> >     MYFLT *spout = csoundGetSpout(cs);
> >
> >     // Get a pointer to the dataBuffer of the AudioBufferList
> >         AudioUnitSampleType *outL = (AudioUnitSampleType
> > *)ioData->mBuffers[0].mData;
> >     AudioUnitSampleType *outR = (AudioUnitSampleType
> > *)ioData->mBuffers[1].mData;
> >
> >         // Perform ksmps bock
> >     if(!ret) {
> >         ret = csoundPerformKsmps(cs);
> >
> >     } else {
> >         cdata->running = false;
> >     }
> >
> >         // Symple copy spout in iOs buffer
> >         for (UInt32 i = 0; i < ksmps; i++) {
> >
> >         outL[i] = (AudioUnitSampleType) (MYFLT)(spout[i * nchnls] * coef);
> >         outR[i] = (AudioUnitSampleType) (MYFLT)(spout[(i * nchnls) + 1] *
> > coef);
> >     }
> >
> >     cdata->ret = ret;
> >     return  noErr;
> >
> >
> >
> >
> >
> > --
> > View this message in context: http://csound.1045644.n5.nabble.com/csoundPerformKsmp-question-proposal-tp1124595p5732903.html
> > Sent from the Csound - Dev mailing list archive at Nabble.com.
> >
> > ------------------------------------------------------------------------------
> > Flow-based real-time traffic analytics software. Cisco certified tool.
> > Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> > Customize your own dashboards, set traffic alerts and generate reports.
> > Network behavioral analysis & security monitoring. All-in-one tool.
> > http://pubads.g.doubleclick.net/gampad/clk?id=126839071&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
> 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-04 23:30
FromVictor Lazzarini
SubjectRe: [Cs-dev] csoundPerformKsmp() question/proposal
OK, the pause issue is fixed now in GIT. Thanks for alerting me to it.

Victor
On 4 Mar 2014, at 23:21, Victor Lazzarini  wrote:

> yes, the iOS IO and the coreaudio module are implemented differently. For instance, in iOS, the callback runs performKsmps(), in
> the OSX coreaudio module there is a circular buffer to connect the callback and the processing thread.
> On 4 Mar 2014, at 23:10, Andres Cabrera  wrote:
> 
>> Right.
>> 
>> I have seen these issues with the performace thread. So maybe the issues are not the same.
>> 
>> Cheers,
>> Andrés
>> 
>> 
>> On Tue, Mar 4, 2014 at 3:06 PM, Victor Lazzarini  wrote:
>> How is the pause done (using CsoundPerformanceThread()?)
>> 
>> Victor
>> On 4 Mar 2014, at 21:44, Andres Cabrera  wrote:
>> 
>>> Hi,
>>> 
>>> I have noticed this problem with coreaudio (not a porblem with portaudio or jack), that the buffers are not flushed to 0 when playing is paused. >>From what I looked, it's not trivial to fix, but maybe someone else can look.
>>> 
>>> Cheers,
>>> Andrés
>>> 
>>> 
>>> On Sat, Mar 1, 2014 at 11:55 AM, scarbo  wrote:
>>> Hello everybody, I have this gib problem:
>>> This is the callback in my iOs app.
>>> The code work fine as expected in realtime, also when I run application
>>> through Cubasis Inter-Audio app work fine but when I freeze in Cubasis
>>> (audio callback is called as soon possible), the incoming audio is
>>> truncated, stuttering in the waveform. Could be something related to
>>> csoundPerformKsmps thread?
>>> Thanks in advances.
>>> 
>>> 
>>>    csdata *cdata = (csdata *) inRefCon;
>>>    int ret = cdata->ret, nchnls = cdata->nchnls;
>>>    float coef = (float) INT_MAX / csoundGet0dBFS(cdata->cs);
>>>    CSOUND *cs = cdata->cs;
>>> 
>>>    int ksmps = csoundGetKsmps(cs);
>>>    MYFLT *spin = csoundGetSpin(cs);
>>>    MYFLT *spout = csoundGetSpout(cs);
>>> 
>>>    // Get a pointer to the dataBuffer of the AudioBufferList
>>>        AudioUnitSampleType *outL = (AudioUnitSampleType
>>> *)ioData->mBuffers[0].mData;
>>>    AudioUnitSampleType *outR = (AudioUnitSampleType
>>> *)ioData->mBuffers[1].mData;
>>> 
>>>        // Perform ksmps bock
>>>    if(!ret) {
>>>        ret = csoundPerformKsmps(cs);
>>> 
>>>    } else {
>>>        cdata->running = false;
>>>    }
>>> 
>>>        // Symple copy spout in iOs buffer
>>>        for (UInt32 i = 0; i < ksmps; i++) {
>>> 
>>>        outL[i] = (AudioUnitSampleType) (MYFLT)(spout[i * nchnls] * coef);
>>>        outR[i] = (AudioUnitSampleType) (MYFLT)(spout[(i * nchnls) + 1] *
>>> coef);
>>>    }
>>> 
>>>    cdata->ret = ret;
>>>    return  noErr;
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context: http://csound.1045644.n5.nabble.com/csoundPerformKsmp-question-proposal-tp1124595p5732903.html
>>> Sent from the Csound - Dev mailing list archive at Nabble.com.
>>> 
>>> ------------------------------------------------------------------------------
>>> Flow-based real-time traffic analytics software. Cisco certified tool.
>>> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
>>> Customize your own dashboards, set traffic alerts and generate reports.
>>> Network behavioral analysis & security monitoring. All-in-one tool.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&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
>> 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-05 00:03
FromAndres Cabrera
SubjectRe: [Cs-dev] csoundPerformKsmp() question/proposal
AttachmentsNone  None  
That was quick, thanks!

Cheers,
Andrés


On Tue, Mar 4, 2014 at 3:30 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
OK, the pause issue is fixed now in GIT. Thanks for alerting me to it.

Victor
On 4 Mar 2014, at 23:21, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:

> yes, the iOS IO and the coreaudio module are implemented differently. For instance, in iOS, the callback runs performKsmps(), in
> the OSX coreaudio module there is a circular buffer to connect the callback and the processing thread.
> On 4 Mar 2014, at 23:10, Andres Cabrera <mantaraya36@gmail.com> wrote:
>
>> Right.
>>
>> I have seen these issues with the performace thread. So maybe the issues are not the same.
>>
>> Cheers,
>> Andrés
>>
>>
>> On Tue, Mar 4, 2014 at 3:06 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
>> How is the pause done (using CsoundPerformanceThread()?)
>>
>> Victor
>> On 4 Mar 2014, at 21:44, Andres Cabrera <mantaraya36@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I have noticed this problem with coreaudio (not a porblem with portaudio or jack), that the buffers are not flushed to 0 when playing is paused. >>From what I looked, it's not trivial to fix, but maybe someone else can look.
>>>
>>> Cheers,
>>> Andrés
>>>
>>>
>>> On Sat, Mar 1, 2014 at 11:55 AM, scarbo <alessandropetrolati@me.com> wrote:
>>> Hello everybody, I have this gib problem:
>>> This is the callback in my iOs app.
>>> The code work fine as expected in realtime, also when I run application
>>> through Cubasis Inter-Audio app work fine but when I freeze in Cubasis
>>> (audio callback is called as soon possible), the incoming audio is
>>> truncated, stuttering in the waveform. Could be something related to
>>> csoundPerformKsmps thread?
>>> Thanks in advances.
>>>
>>>
>>>    csdata *cdata = (csdata *) inRefCon;
>>>    int ret = cdata->ret, nchnls = cdata->nchnls;
>>>    float coef = (float) INT_MAX / csoundGet0dBFS(cdata->cs);
>>>    CSOUND *cs = cdata->cs;
>>>
>>>    int ksmps = csoundGetKsmps(cs);
>>>    MYFLT *spin = csoundGetSpin(cs);
>>>    MYFLT *spout = csoundGetSpout(cs);
>>>
>>>    // Get a pointer to the dataBuffer of the AudioBufferList
>>>        AudioUnitSampleType *outL = (AudioUnitSampleType
>>> *)ioData->mBuffers[0].mData;
>>>    AudioUnitSampleType *outR = (AudioUnitSampleType
>>> *)ioData->mBuffers[1].mData;
>>>
>>>        // Perform ksmps bock
>>>    if(!ret) {
>>>        ret = csoundPerformKsmps(cs);
>>>
>>>    } else {
>>>        cdata->running = false;
>>>    }
>>>
>>>        // Symple copy spout in iOs buffer
>>>        for (UInt32 i = 0; i < ksmps; i++) {
>>>
>>>        outL[i] = (AudioUnitSampleType) (MYFLT)(spout[i * nchnls] * coef);
>>>        outR[i] = (AudioUnitSampleType) (MYFLT)(spout[(i * nchnls) + 1] *
>>> coef);
>>>    }
>>>
>>>    cdata->ret = ret;
>>>    return  noErr;
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://csound.1045644.n5.nabble.com/csoundPerformKsmp-question-proposal-tp1124595p5732903.html
>>> Sent from the Csound - Dev mailing list archive at Nabble.com.
>>>
>>> ------------------------------------------------------------------------------
>>> Flow-based real-time traffic analytics software. Cisco certified tool.
>>> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
>>> Customize your own dashboards, set traffic alerts and generate reports.
>>> Network behavioral analysis & security monitoring. All-in-one tool.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&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
>> 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