Csound Csound-dev Csound-tekno Search About

[Csnd] question regarding GUI xruns

Date2009-11-11 21:48
FromAaron Johnson
Subject[Csnd] question regarding GUI xruns
Hi all,

I'm going through some of the realtime examples of Iain McCurdy; the DrumSequencerVariableLength.csd example in particular raises the question: does Csound have the correct architecture for professional realtime work with the GUI? It seems that in many examples, even with an otherwise correct low-latency setup, that I'm getting crackling and xruns when I merely move a window. Worse, in timed sequenced instrument like the 'DrumSequencer', 'time' slows down to a near stop while GUI events are redrawn.

I also get crackles/xruns when I drag a window or switch windows and have another sequencer application trigger an FLTK live MIDI instrument.

It doesn't seem to happen in other apps, so I'm wondering if there is something wrong with the way FLTK is woven into the engine....perhaps better threading architecture is called for? I know that has worked for me in a Python/TK app I've written that involved accurate timing. Separation of GUI and audio threads was a very powerful discovery for me.

I would like to use Csound as a MIDI triggered engine for a multimedia event, but right now, it's completely off the table until I can get rid of crackling and xruns. Any insight or help would be appreciated.

FYI, I'm running Ubuntu 9.04 (Jaunty) on an Asus EeePC 1000H, Csound 5.10

Best,
AKJ
--

Aaron Krister Johnson
http://www.akjmusic.com
http://www.untwelve.org


Date2009-11-11 21:59
FromRory Walsh
Subject[Csnd] Re: question regarding GUI xruns
I don't use the fltk widgets but if you have experience using python
why not just build your GUI frontend using that and some GUI library
such as tk?? Just a thought..

Rory.


2009/11/11 Aaron Johnson :
> Hi all,
>
> I'm going through some of the realtime examples of Iain McCurdy; the
> DrumSequencerVariableLength.csd example in particular raises the question:
> does Csound have the correct architecture for professional realtime work
> with the GUI? It seems that in many examples, even with an otherwise correct
> low-latency setup, that I'm getting crackling and xruns when I merely move a
> window. Worse, in timed sequenced instrument like the 'DrumSequencer',
> 'time' slows down to a near stop while GUI events are redrawn.
>
> I also get crackles/xruns when I drag a window or switch windows and have
> another sequencer application trigger an FLTK live MIDI instrument.
>
> It doesn't seem to happen in other apps, so I'm wondering if there is
> something wrong with the way FLTK is woven into the engine....perhaps better
> threading architecture is called for? I know that has worked for me in a
> Python/TK app I've written that involved accurate timing. Separation of GUI
> and audio threads was a very powerful discovery for me.
>
> I would like to use Csound as a MIDI triggered engine for a multimedia
> event, but right now, it's completely off the table until I can get rid of
> crackling and xruns. Any insight or help would be appreciated.
>
> FYI, I'm running Ubuntu 9.04 (Jaunty) on an Asus EeePC 1000H, Csound 5.10
>
> Best,
> AKJ
> --
>
> Aaron Krister Johnson
> http://www.akjmusic.com
> http://www.untwelve.org
>
>


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-11 22:00
FromRory Walsh
Subject[Csnd] Re: question regarding GUI xruns
By the way, I've seen some of the fltk/csound Iain uses in his real
time compositions and they're far more complex than anything on his
site yet I've never heard a drop out? Could it be to do with your
csound settings I wonder?

2009/11/11 Rory Walsh :
> I don't use the fltk widgets but if you have experience using python
> why not just build your GUI frontend using that and some GUI library
> such as tk?? Just a thought..
>
> Rory.
>
>
> 2009/11/11 Aaron Johnson :
>> Hi all,
>>
>> I'm going through some of the realtime examples of Iain McCurdy; the
>> DrumSequencerVariableLength.csd example in particular raises the question:
>> does Csound have the correct architecture for professional realtime work
>> with the GUI? It seems that in many examples, even with an otherwise correct
>> low-latency setup, that I'm getting crackling and xruns when I merely move a
>> window. Worse, in timed sequenced instrument like the 'DrumSequencer',
>> 'time' slows down to a near stop while GUI events are redrawn.
>>
>> I also get crackles/xruns when I drag a window or switch windows and have
>> another sequencer application trigger an FLTK live MIDI instrument.
>>
>> It doesn't seem to happen in other apps, so I'm wondering if there is
>> something wrong with the way FLTK is woven into the engine....perhaps better
>> threading architecture is called for? I know that has worked for me in a
>> Python/TK app I've written that involved accurate timing. Separation of GUI
>> and audio threads was a very powerful discovery for me.
>>
>> I would like to use Csound as a MIDI triggered engine for a multimedia
>> event, but right now, it's completely off the table until I can get rid of
>> crackling and xruns. Any insight or help would be appreciated.
>>
>> FYI, I'm running Ubuntu 9.04 (Jaunty) on an Asus EeePC 1000H, Csound 5.10
>>
>> Best,
>> AKJ
>> --
>>
>> Aaron Krister Johnson
>> http://www.akjmusic.com
>> http://www.untwelve.org
>>
>>
>


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-11 22:19
FromBrian Redfern
Subject[Csnd] Re: question regarding GUI xruns
Are you using the realtime low latency kernel on Ubuntu? I've gotten
good results with 64Studio but had some issues with Ubuntu.

On Wed, Nov 11, 2009 at 1:48 PM, Aaron Johnson  wrote:
> Hi all,
>
> I'm going through some of the realtime examples of Iain McCurdy; the
> DrumSequencerVariableLength.csd example in particular raises the question:
> does Csound have the correct architecture for professional realtime work
> with the GUI? It seems that in many examples, even with an otherwise correct
> low-latency setup, that I'm getting crackling and xruns when I merely move a
> window. Worse, in timed sequenced instrument like the 'DrumSequencer',
> 'time' slows down to a near stop while GUI events are redrawn.
>
> I also get crackles/xruns when I drag a window or switch windows and have
> another sequencer application trigger an FLTK live MIDI instrument.
>
> It doesn't seem to happen in other apps, so I'm wondering if there is
> something wrong with the way FLTK is woven into the engine....perhaps better
> threading architecture is called for? I know that has worked for me in a
> Python/TK app I've written that involved accurate timing. Separation of GUI
> and audio threads was a very powerful discovery for me.
>
> I would like to use Csound as a MIDI triggered engine for a multimedia
> event, but right now, it's completely off the table until I can get rid of
> crackling and xruns. Any insight or help would be appreciated.
>
> FYI, I'm running Ubuntu 9.04 (Jaunty) on an Asus EeePC 1000H, Csound 5.10
>
> Best,
> AKJ
> --
>
> Aaron Krister Johnson
> http://www.akjmusic.com
> http://www.untwelve.org
>
>


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-11 23:09
FromIain McCurdy
Subject[Csnd] RE: question regarding GUI xruns
Hi Aaron,

In the example you mention disabiling (or reducing the refresh rate of) the animated green bars should reduce the GUI load. I don't seem to be getting the same level of performance problems that you are however. You are right that Csound is a little sensitive to window dragging and resizing. This is, as you suggest, a problem with how FLTK has been integrated into Csound5 - in the original Csoundav implementation of FLTK widgets there is no problem with dragging and resizing. I suspect the only person who could fix this in Csound5 this would be Gabriel Maldonado.

Bye,
Iain


Date: Wed, 11 Nov 2009 15:48:08 -0600
From: aaron@akjmusic.com
To: csound@lists.bath.ac.uk
Subject: [Csnd] question regarding GUI xruns

Hi all,

I'm going through some of the realtime examples of Iain McCurdy; the DrumSequencerVariableLength.csd example in particular raises the question: does Csound have the correct architecture for professional realtime work with the GUI? It seems that in many examples, even with an otherwise correct low-latency setup, that I'm getting crackling and xruns when I merely move a window. Worse, in timed sequenced instrument like the 'DrumSequencer', 'time' slows down to a near stop while GUI events are redrawn.

I also get crackles/xruns when I drag a window or switch windows and have another sequencer application trigger an FLTK live MIDI instrument.

It doesn't seem to happen in other apps, so I'm wondering if there is something wrong with the way FLTK is woven into the engine....perhaps better threading architecture is called for? I know that has worked for me in a Python/TK app I've written that involved accurate timing. Separation of GUI and audio threads was a very powerful discovery for me.

I would like to use Csound as a MIDI triggered engine for a multimedia event, but right now, it's completely off the table until I can get rid of crackling and xruns. Any insight or help would be appreciated.

FYI, I'm running Ubuntu 9.04 (Jaunty) on an Asus EeePC 1000H, Csound 5.10

Best,
AKJ
--

Aaron Krister Johnson
http://www.akjmusic.com
http://www.untwelve.org



View your other email accounts from your Hotmail inbox. Add them now.

Date2009-11-11 23:18
FromVictor Lazzarini
Subject[Csnd] Re: RE: question regarding GUI xruns
The problem with the 'fix' is that it is a hack and as hacks go, it does not work everywhere.
I studied the code a while ago, it uses an unsupported and unadvisable way of starting a separate thread for GUIs. According to the FLTK developers, it was pure chance it worked (on Windows). It never worked on OSX and there were problems on Linux. For this reason, the FLTK implementation was made single-threaded, and that might have performance issues.

As Rory said here, if you can program in Python, it's better to build up your GUI using the API and something like WxWindows, GTK, Qt or even Tkinter.

Victor 

On 11 Nov 2009, at 23:09, Iain McCurdy wrote:

Hi Aaron,

In the example you mention disabiling (or reducing the refresh rate of) the animated green bars should reduce the GUI load. I don't seem to be getting the same level of performance problems that you are however. You are right that Csound is a little sensitive to window dragging and resizing. This is, as you suggest, a problem with how FLTK has been integrated into Csound5 - in the original Csoundav implementation of FLTK widgets there is no problem with dragging and resizing. I suspect the only person who could fix this in Csound5 this would be Gabriel Maldonado.

Bye,
Iain


Date: Wed, 11 Nov 2009 15:48:08 -0600
From: aaron@akjmusic.com
To: csound@lists.bath.ac.uk
Subject: [Csnd] question regarding GUI xruns

Hi all,

I'm going through some of the realtime examples of Iain McCurdy; the DrumSequencerVariableLength.csd example in particular raises the question: does Csound have the correct architecture for professional realtime work with the GUI? It seems that in many examples, even with an otherwise correct low-latency setup, that I'm getting crackling and xruns when I merely move a window. Worse, in timed sequenced instrument like the 'DrumSequencer', 'time' slows down to a near stop while GUI events are redrawn. 

I also get crackles/xruns when I drag a window or switch windows and have another sequencer application trigger an FLTK live MIDI instrument.

It doesn't seem to happen in other apps, so I'm wondering if there is something wrong with the way FLTK is woven into the engine....perhaps better threading architecture is called for? I know that has worked for me in a Python/TK app I've written that involved accurate timing. Separation of GUI and audio threads was a very powerful discovery for me.

I would like to use Csound as a MIDI triggered engine for a multimedia event, but right now, it's completely off the table until I can get rid of crackling and xruns. Any insight or help would be appreciated.

FYI, I'm running Ubuntu 9.04 (Jaunty) on an Asus EeePC 1000H, Csound 5.10

Best,
AKJ
-- 

Aaron Krister Johnson
http://www.akjmusic.com
http://www.untwelve.org



View your other email accounts from your Hotmail inbox. Add them now.


Date2009-11-12 01:58
FromAaron Krister Johnson
Subject[Csnd] Re: RE: question regarding GUI xruns
Hi Victor, everyone,

Thanks for you fast responses!

As for he API, I figured I would want to get around to working with it at
some point. My issue, however, is that it seems there is a lack of
examples/documentation/tutorials out there about how one goes about this.

Also, is there still an issue with the csd.py library only being good for an
older (I think 2.5) version of Python? Or, have the issues with scons and
swig been resolved?

Hmmm...it seems to me that FLTK, if it can't do threading correctly, at
least on *all* platforms, might be superceded by a better default toolkit in
future versions? :) Just a thought anyway.....

Regarding Ubuntu vs. 64studio, I can't comment, b/c I don't use a 64bit
platform. I do know that I've done everything possible short of sacrificial
offerings to the gods of low-latency to tune my eeebuntu system.....I even
used an outboard USB sound interface (a Lexicon Lambda) to test if the IRQ
sharing between the video and audio cards was the issue (turns out it
wasn't, and Csound still gave me crackles on moves and resizes of windows)

Otherwise, solid and beautiful performance from other apps like ZynAddSubFx,
etc.....

Best,
AKJ


Victor Lazzarini wrote:
> 
> The problem with the 'fix' is that it is a hack and as hacks go, it  
> does not work everywhere.
> I studied the code a while ago, it uses an unsupported and unadvisable  
> way of starting a separate thread for GUIs. According to the FLTK  
> developers, it was pure chance it worked (on Windows). It never worked  
> on OSX and there were problems on Linux. For this reason, the FLTK  
> implementation was made single-threaded, and that might have  
> performance issues.
> 
> As Rory said here, if you can program in Python, it's better to build  
> up your GUI using the API and something like WxWindows, GTK, Qt or  
> even Tkinter.
>