Re: [linux-audio-dev] analysis/resynthesis environment: python?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] analysis/resynthesis environment: python?
From: Tim Goetze (tim_AT_quitte.de)
Date: Sat Aug 17 2002 - 13:48:53 EEST


Brian Redfern wrote:

>I wonder if anyone has tried the perl DSP.pm module, or if these scripting
>languages are just too slow, I just wonder if basically everything must be
>done in C/C++, I have played with javasound, but it requires a large
>buffer for clean playback, kinda killing any hope for decent latency. I'm
>hungry to get Tritonous to work, that really seems like the best bet for
>doing audio programming on linux with something besides just C.

Can only tell you about Python, but I suspect Perl works much the
same because both weren't designed from the start to run multi-
threaded afaik.

Python has one lock that serializes the execution of *all* Python code
within one interpreter object (= namespace). Opening a second inter-
preter within the same process is not an option because the Python GC
allocator is not threadsafe. Therefore if you want to do 'realtime'
audio DSP, you'd have to run single-threaded if you're after the
minimum latency achievable with such a system.

I'll probably implement a different solution, that is to run the C++
core at low latency, collect 'n' cycles of audio signal and pass those
in one array to a Python DSP prototype. This would be adding n * (core
frames/cycle) to the processing latency.

If you're brave, don't have other Python threads holding the BPL (Big
Python Lock ;) and have a very simple DSP routine, you might get away
with setting 'n' to one.

Hopefully. :)

tim


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sat Aug 17 2002 - 13:48:07 EEST