| Good news: Csound can be built to run with Python 2.6 on Sugar on a Stick,
including GUI control, channels, and real-time audio I/O. Bad news: it's not
that easy. But here's how I did it.
Become superuser with 'su' to use yum to update, install, or in some cases
reinstall (if install did not seem to work properly):
cvs
fltk-devel
gcc
gcc-c++
gdb
libjpeg-devel
libpng-devel
libsndfile-devel
lua-devel
pkgconfig
python-devel
scons
swig
Become normal liveuser and do cvs login and update of "csound5" from
/home/liveuser, using instructions for anonymous CVS access from SourceForge
Csound CVS
Since the ALSA library on Sugar on a Stick is not found in /usr/lib but
rather in /lib, I edited custom.py, for the 'linux' case, to include
customLIBPATH.append('/lib')
The normal symbolic link to target libasound.so.2.0.0 with link name plain
old libasound.so, was missing, so I had to create that as well:
su
cd /lib
ln -s libasound.so.2.0.0 libasound.so
exit
Then the following SCons command built Csound and csnd:
./cleanup.sh
scons buildInterfaces=1 buildPythonWrapper=1 buildLuaWrapper=1
dynamicCsoundLibrary=1 usePortAudio=1 useALSA=0
NOTE: the rtpa.so module builds and runs fine if SCons and PortAudio know
that -lasound is really /lib/libasound.so.2.0.0.
NOTE: If I got something wrong, and I had to modify anything, I repeated
./cleanup.sh because SCons has a tendency to remember things we might need
it to forget when we change them!
To run, I had to define some environment variables:
export LD_LIBRARY_PATH=/home/liveuser/csound5
export PYTHON_PATH=/home/liveuser/csound5
export OPCODEDIR=/home/liveuser/csound5
I could run, in /home/liveuser/csound5 where Csound was built, csound
examples/trapped.csd -odac and -otest.wav, as well as python
examples/python/Koch.py. In this last case, Python loaded csnd, generated
the score, and began to render with csnd, but the orchestra failed because I
did not build the Fluidsynth opcodes. I'm quite confident that if the
Fluidsynth opcodes were built, or the Csound orchestra embedded in Koch.py
were edited, it would complete.
Just to prove that you can run a Python GUI embedding Csound with real-time
audio input on Sugar on a Stick, I did this:
su
yum install tkinter
exit
python examples/python/drone.py
wait for the thing to load....
click on 'Play' button...
adjust sliders till I could hear something... I could!
NOTE: I did not install Csound, I ran it from the build directory. But
obviously, you could build it, and then copy the new build over an existing
installation, and things should work.
At any rate, this is enough to prove that it can be gotten to work, and
indicates how. I don't know if this much work is acceptable to you -- it's
certainly not something a child should be asked to do! But, you could get an
installation working, then zip up the relevant files using a shell script
into an archive that you could unzip from the root directory to get an
installation, and set the required environment variables in the user's
.login or .profile or .bashrc or wherever it goes on Sugar on a Stick.
So then, I went back, uninstalled csound-python, reinstalled it, and tried
to get it to work. I didn't finish looking at this, but I did find that
_csnd.so was not installed in Python's site-packages, and that symbolic
links in /usr/lib pointing from the actual .so.N.N had not been created to
plain old .so, which is normally required for this kind of dynamic loading
to work.
It's too bad the package maintainer had not finished and tested the package
for the version of Python on sugar, that would have saved you and I quite a
bit of time.
Hope this helps,
Mike
----- Original Message -----
From: "Art Hunkins"
To:
Cc:
Sent: Saturday, August 01, 2009 9:33 PM
Subject: Re: Current State of OLPC (XO) and Sugar on a Stick
> Actually, I've no idea.
>
> However, that *could* be exactly the problem.
>
> Maybe Peter knows. Peter?
>
> Art Hunkins
>
> ----- Original Message -----
> From:
> To: "Art Hunkins"
> Sent: Saturday, August 01, 2009 9:14 PM
> Subject: Re: Current State of OLPC (XO) and Sugar on a Stick
>
>
>>I know that, but the packages still would not be consistent with Python
>>2.6, would they?
>>
>> Regards,
>> Mike
>>
>> ----- Original Message -----
>> From: "Art Hunkins"
>> To: ; "Peter Robinson"
>> Sent: Saturday, August 01, 2009 6:39 PM
>> Subject: Re: Current State of OLPC (XO) and Sugar on a Stick
>>
>>
>>> Hi, Michael,
>>>
>>> The packages are consistent if you load/update them right.
>>>
>>> The simple way to update/install them both at the same time is simply:
>>> su
>>> yum --enablerepo=updates-testing install csound-python
>>>
>>> I don't know the answer to browsing your hard disk from SoaS - nor the
>>> rest of what may be on your USB drive. What I do, however, is to put
>>> what I want to use/copy (whatever) in Sugar, on another USB drive. You
>>> get to *its* root in Terminal view with:
>>> /media/YOURDRIVENAME
>>>
>>> It will also show up at the bottom of your Journal view (bottom
>>> frame-space).
>>>
>>> Thanks for your help.
>>>
>>> Art Hunkins
>>>
>>> ----- Original Message -----
>>> From:
>>> To: "Art Hunkins" ; "Peter Robinson"
>>>
>>> Sent: Friday, July 31, 2009 11:55 PM
>>> Subject: Re: Current State of OLPC (XO) and Sugar on a Stick
>>>
>>>
>>>> As you note somewhere along the line, the packages for csound and
>>>> csound-python in Fedora are not consistent.
>>>>
>>>> I got Sugar on a Stick running on my netbook. I was planning to copy my
>>>> Eebuntu binaries for the csnd module onto the stick, but I could find
>>>> my hard disk, only the USB stick and only the writeable area for Fedora
>>>> on that.
>>>>
>>>> How do I browse the hard disk so I can copy the files?
>>>>
>>>> I did start setting up a development environment for building Csound
>>>> and csnd on the stick, and I'm pretty sure that is possible. I yummed
>>>> for gcc, swig, libsndfile, python-devel, probably also need
>>>> libsndfile-devel. That and alsa-devel and scons should do it.
>>>>
>>>> Hope this helps,
>>>> Mike
>>>> ----- Original Message -----
>>>> From: "Art Hunkins"
>>>> To: "Peter Robinson"
>>>> Cc:
>>>> Sent: Thursday, July 30, 2009 8:03 PM
>>>> Subject: Re: Current State of OLPC (XO) and Sugar on a Stick
>>>>
>>>>
>>>>> Hello, Peter,
>>>>>
>>>>> Here are the results after issuing the two commands you suggested (see
>>>>> mail below):
>>>>>
>>>>> Both python tests (#2 and #3) fail, in Context 3, with this message:
>>>>> In swig_import_helper, "return _mod" Error: local variable "_mod"
>>>>> referenced before assignment
>>>>>
>>>>> I'm copying this message to Mike Gogins (only), as he is one of the
>>>>> few other people who knows all about this stuff, and may be able to
>>>>> get to the root of what's going on.
>>>>>
>>>>> Take care -
>>>>>
>>>>> Art Hunkins
>>>>>
>>>>> ----- Original Message -----
>>>>> From: "Peter Robinson"
>>>>> To: "Art Hunkins"
>>>>> Sent: Thursday, July 30, 2009 7:08 PM
>>>>> Subject: Re: Current State of OLPC (XO) and Sugar on a Stick
>>>>>
>>>>>
>>>>> Hey Art,
>>>>>
>>>>> A random late night thought as I go to bed.
>>>>>
>>>>> On you new system as the root on the command line try the following 2
>>>>> commands:
>>>>>
>>>>> mv /usr/lib/csound/plugins/libcsnd.so /usr/lib
>>>>> /sbin/ldconfig
>>>>>
>>>>> and then try your tests and just reply directly to me.
>>>>>
>>>>> Peter
>>>>>
>>>>>
>>>>> On Thu, Jul 30, 2009 at 10:42 PM, Art Hunkins
>>>>> wrote:
>>>>>> *Revised* comprehensive test - working with Csound materials
>>>>>> in the context of the OLPC (XO) and Sugar on a Stick. Here are the
>>>>>> results.
>>>>>> I'd appreciate continued help to resolve the outstanding issues.
>>>>>>
>>>>>> Three tests:
>>>>>> Test 1: Running a .csd file from the terminal. ALSA driver specified
>>>>>> Test 2: Running a .csd file from python from the terminal. No audio
>>>>>> driver
>>>>>> specified.
>>>>>> Test 3: Running a .csd file as part of an Activity (python script)
>>>>>> within
>>>>>> Sugar. No driver specified.
>>>>>>
>>>>>> Context 1: On the OLPC (XO) computer (OLPCsound - 5.08.91) - out of
>>>>>> the box
>>>>>> Test 1: ran fine; ALSA driver used
>>>>>> Test 2: ran fine; ALSA driver used
>>>>>> Test 3: ran fine; ALSA driver used
>>>>>> Obviously no problems here - except the limitation to OLPCsound
>>>>>> (5.08)
>>>>>>
>>>>>> I configured a completely new USB stick (in Windows) to run the
>>>>>> remaining
>>>>>> tests.
>>>>>>
>>>>>> Context 2: Sugar on a Stick - out of the box (OLPCsound - 5.08.91) -
>>>>>> no
>>>>>> updates
>>>>>> Test 1: ran fine; ALSA driver used
>>>>>> Test 2: fails - cannot import csnd (note: csound-python is not
>>>>>> present)
>>>>>> Test 3: fails - during import _csnd; in libcsnd.so.5.1: undefined
>>>>>> symbol:
>>>>>> csoundGetInputBuffer
>>>>>> Note: csnd.py, _csnd.so etc. *are* present in the /site-packages
>>>>>> folder
>>>>>>
>>>>>> Context 3: SoaS with updates-testing update csound (to
>>>>>> 5.10.1-9.fc11),
>>>>>> and updates-testing install csound-python (to same version):
>>>>>> Test 1: ran fine; ALSA driver used
>>>>>> Test 1 rerun, with *no driver specified*: fails - "unknown rtaudio
>>>>>> module:
>>>>>> "PortAudio"
>>>>>> This is the new audio driver glitch I referred to in a previous mail.
>>>>>> Note that the original (OLPCsound [5.08]) install doesn't suffer this
>>>>>> problem.
>>>>>> Test 2: fails - error in csnd.py: import _csnd. No module named _csnd
>>>>>> Test 3: fails - error in csnd.py: import _csnd. No module named _csnd
>>>>>>
>>>>>> Notes:
>>>>>> *The Context 3 "upgrade" requires the following (revised) commands to
>>>>>> get
>>>>>> the right (latest) builds of both Csound and csound-python
>>>>>> installed*:
>>>>>> su
>>>>>> yum --enablerepo=updates-testing update csound
>>>>>> yum --enablerepo=updates-testing install csound-python
>>>>>>
>>>>>> Thanks to Peter for correcting me on this, and for his ongoing
>>>>>> efforts to
>>>>>> get this all working.
>>>>>>
>>>>>> Art Hunkins
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>
|