electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
Trying to get Chuck working with Fedora 11
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [15 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
steevithak



Joined: Aug 15, 2009
Posts: 12
Location: Dallas, TX

PostPosted: Sat Aug 15, 2009 9:29 am    Post subject: Trying to get Chuck working with Fedora 11 Reply with quote  Mark this post and the followings unread

I'm new at this and not having much luck getting chuck to work. I run Redhat Fedora 11 GNU/Linux. I downloaded the chuck-1.2.1.2-1.fc11.ccrma.i586 RPM file. I installed it on my system with no problems or error messages.

when I try to run chuck files that a friend gave me as examples, they cause chuck to segfault. I'm hoping someone can help me diagnose the problem.

Other MIDI and audio programs work fine.

I can run "chuck --help" and I get the expected help screen.

When I run "chuck --probe" I get this output:

$ chuck --probe
[chuck]: found 1 device(s) ...
[chuck]: ------( chuck -- dac1 )---------------
[chuck]: device name = "Jack Server"
[chuck]: probe [success] ...
[chuck]: # output channels = 2
[chuck]: # input channels = 2
[chuck]: # duplex Channels = 2
[chuck]: default device = YES
[chuck]: natively supported data formats:
[chuck]: 32-bit float
[chuck]: supported sample rates:
[chuck]: 48000 Hz
[chuck]:
[chuck]: ------( chuck -- 5 MIDI inputs )------
[chuck]: [0] : "Midi Through Port-0"
[chuck]: [1] : "MidiSport 4x4 MIDI 1"
[chuck]: [2] : "MidiSport 4x4 MIDI 2"
[chuck]: [3] : "MidiSport 4x4 MIDI 3"
[chuck]: [4] : "MidiSport 4x4 MIDI 4"
[chuck]:
[chuck]: ------( chuck -- 6 MIDI outputs )-----
[chuck]: [0] : "Midi Through Port-0"
[chuck]: [1] : "MidiSport 4x4 MIDI 1"
[chuck]: [2] : "MidiSport 4x4 MIDI 2"
[chuck]: [3] : "MidiSport 4x4 MIDI 3"
[chuck]: [4] : "MidiSport 4x4 MIDI 4"
[chuck]: [5] : "System Announcement Reciever"
[chuck]:


This is the chuck file I'm trying to run. I've tried various MIDI ports including both 0 and 1.

//create midi out object
MidiOut mout;
//create a midi message thinger
MidiMsg msg;

// connect to port
if( !mout.open(1) ) { me.exit(); }

while (true)
{
// fill the message with data
144 => msg.data1;
52 => msg.data2;
100 => msg.data3;

mout.send(msg );

1000::ms => now;
}


When I try to run the file, this is what I get:

$ chuck midi_out_simple.ck
Segmentation fault
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
steevithak



Joined: Aug 15, 2009
Posts: 12
Location: Dallas, TX

PostPosted: Sun Aug 16, 2009 7:14 am    Post subject: Re: Trying to get Chuck working with Fedora 11 Reply with quote  Mark this post and the followings unread

Operating from the assumption that the CCRMA ChucK RPM file for Fedora 11 was broken, I removed it, downloaded the Chuck source and built it. The result was the same, whether running my ck file or any of the example ck files. Chuck immediately segaults on anything expect "chuck --help" and "chuck --probe". I've tried building the ALSA, Jack, and OSS versions. The non-ALSA versions complain unless I run them with --silent and still segfault.

Finally I tried adding --verbose and here's the output:

Code:

$ chuck --verbose gomidi2.ck
[chuck]:(2:SYSTEM): setting log level to: 5 (INFORM)...
[chuck]:(2:SYSTEM): initializing virtual machine...
[chuck]:(2:SYSTEM):  | behavior: HALT
[chuck]:(2:SYSTEM):  | locking down special objects...
[chuck]:(2:SYSTEM):  | allocating shreduler...
[chuck]:(2:SYSTEM):  | allocating messaging buffers...
[chuck]:(2:SYSTEM):  | real-time audio: NO
[chuck]:(2:SYSTEM):  | mode: BLOCKING
[chuck]:(2:SYSTEM):  | sample rate: 48000
[chuck]:(2:SYSTEM):  | buffer size: 512
[chuck]:(2:SYSTEM):  | channels in: 2 out: 2
[chuck]:(2:SYSTEM): initializing compiler...
[chuck]:(3:SEVERE):  | initializing type checker...
[chuck]:(3:SEVERE):  |  | adding base classes...
[chuck]:(3:SEVERE):  |  |  | class 'object'
[chuck]:(3:SEVERE):  |  |  | class 'array'
[chuck]:(3:SEVERE):  |  |  | class 'string'
[chuck]:(3:SEVERE):  |  |  | class 'ugen'
[chuck]:(3:SEVERE):  |  |  | class 'uanablob'
[chuck]:(3:SEVERE):  |  |  | class 'uana'
[chuck]:(3:SEVERE):  |  |  | class 'shred'
[chuck]:(3:SEVERE):  |  |  | class 'event'
[chuck]:(3:SEVERE):  |  |  | class 'io'
[chuck]:(3:SEVERE):  |  |  | class 'class'
[chuck]:(3:SEVERE):  | initializing emitter...
[chuck]:(3:SEVERE):  | loading built-in modules...
[chuck]:(3:SEVERE):  |  | module osc...
[chuck]:(3:SEVERE):  |  | module xxx...
[chuck]:(3:SEVERE):  |  | module filter...
[chuck]:(3:SEVERE):  |  | module STK...
[chuck]:(3:SEVERE):  |  | module xform...
[chuck]:(3:SEVERE):  |  | module extract...
[chuck]:(3:SEVERE):  |  | class 'machine'...
[chuck]:(3:SEVERE):  |  | class 'std'...
[chuck]:(5:INFORM):  |  | initializing KBHitManager...
[chuck]:(5:INFORM):  |  | starting kb loop...
[chuck]:(3:SEVERE):  |  | class 'math'...
[chuck]:(3:SEVERE):  |  | class 'opsc'...
[chuck]:(2:SYSTEM): type dependency resolution: MANUAL
[chuck]:(2:SYSTEM): initializing synthesis engine...
[chuck]:(3:SEVERE):  | initializing 'dac'...
[chuck]:(3:SEVERE):  | initializing 'adc'...
[chuck]:(3:SEVERE):  | initializing 'blackhole'...
[chuck]:(2:SYSTEM):  | initializing 'fake-time' audio...
[chuck]:(3:SEVERE):  | allocating buffers for 512 x 2 samples...
[chuck]:(3:SEVERE): starting compilation...
[chuck]:(2:SYSTEM): starting listener on port: 8888...
[chuck]:(2:SYSTEM): running virtual machine...
[chuck]:(3:SEVERE):  | initializing audio buffers...
[chuck]:(3:SEVERE):  | virtual machine running...
Segmentation fault
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
steevithak



Joined: Aug 15, 2009
Posts: 12
Location: Dallas, TX

PostPosted: Sun Aug 16, 2009 8:17 am    Post subject: Re: Trying to get Chuck working with Fedora 11 Reply with quote  Mark this post and the followings unread

I think I may just be talking to myself here. Smile Maybe nobody is using Chuck on GNU/Linux or at least not on Fedora. But maybe this thread can help somebody else who ventures down that path.

Ok, the CCRMA Chuck RPM Fedora 11 segfaults, the compiled from source Chuck segfaults. But I notice Chuck looks like a statically compiled binary, so I downloaded some of the older CCRMA RPMs and extracted only the binary for Chuck. After some experimentation, I found the fairly recent binary from the CCRMA RPM file, chuck-1.2.1.2-1.fc10.i386.rpm actually works. No segfaults and I can run the MIDI example files ok.

My guess is this has something to do with the compilation. My failed compiles were for i686 architecture and the broken CCRMA F11 RPM is compiled for i586. I'm going to experiment some more with compiling from source and try making an i386 binary. Not sure if that will be enough since it's still linking to other i686 compiled libraries on my box but we'll see.

Are there any known bugs involving i386/i586/i686 architectures? I couldn't find a bugzilla or similar bug database for Chuck, could someone point out where it is? Thanks!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
steevithak



Joined: Aug 15, 2009
Posts: 12
Location: Dallas, TX

PostPosted: Sun Aug 16, 2009 9:15 am    Post subject: Trying to get Chuck working with Fedora 11 Reply with quote  Mark this post and the followings unread

Compiling with march=i386 didn't help. My guess is due to the libraries still being i686. Only work around i can see is to find another box where I can install an i386 version of Fedora, compile the static binary there and then move it to my real box.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sun Aug 16, 2009 9:47 am    Post subject: Reply with quote  Mark this post and the followings unread

Actually quite a few people here are using ChucK on Linux, some on fedora, I think. I looked carefully at your posts but I only have experience with versions of Debian and none with Fedora so it's a bit hard for me to know where to start.

Are you by any chance running a 64 bits version? That would quickly explain the whole thing as ChucK so far refuses to work in 64 bits Linux, despite some efforts at remedying that.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
steevithak



Joined: Aug 15, 2009
Posts: 12
Location: Dallas, TX

PostPosted: Sun Aug 16, 2009 10:50 am    Post subject: Reply with quote  Mark this post and the followings unread

$ uname -m
i686

No, not 64 bit. i686 is 32 bit. However, i686 does use some CPU-specific instructions that would not be included in i386 binaries. I'm assuming that's where the breakage is. Looks like ChucK doesn't work on non-i386 architecture, at least not on Fedora 11 compiled with gcc 4.4.0.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sun Aug 16, 2009 1:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hmmm, at that command I get "i686" as well. If it really were a cpu instruction issue I'd imagine GCC should protest somewhere.

The latest version of pure chuck should compile fine with a new version of GCC, however the miniAudicle is lagging a bit and still uses a older version of ChucK which won't work with the more strict demands of newer versions of GCC.

Were you perhaps trying to compile the miniaudicle? If so you could try to compile plain command-line chuck. If that makes a difference I'll explain how to insert the new chuck source into the older mini source.

That wouldn't yet explain why the binary wouldn't work for you still, that bit worries me a bit.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
steevithak



Joined: Aug 15, 2009
Posts: 12
Location: Dallas, TX

PostPosted: Sun Aug 16, 2009 2:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

No, not using miniaudicle, just ChucK. That's hopeful you've got a working i686 compile of ChucK on Ubuntu. That suggests it's not the architecture that's my problem. What does that leave? Maybe I'm using a different version of some critical library. Looking at the versions of libraries that appear to be linked in the make file, I've got:

libasound 2.0.0
libstdc++ 6.0.11
libdl 2.10.1
libm 2.10.1
libsndfile 1.0.17

How does that compare to your Ubuntu i686 build?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
steevithak



Joined: Aug 15, 2009
Posts: 12
Location: Dallas, TX

PostPosted: Sun Aug 16, 2009 2:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

Eureka! I may have found a clue to what's going on. I did a compile with CHUCK_DEBUG set and, to my surprise, it didn't segault but worked fine. I looked at the make file and noticed optimization is turned off for debugging. Normally it's set to -O3 but debug sets it to -O0. I tried a non-debug build with optimization turned off and it worked great with no segfaults.

I tried some experiments at different gcc optimization levels and here's what I've found:

-O3 ChucK segfaults immediately
-O2 ChucK segfaults immediately
-O1 ChucK runs with no problems
-O0 ChucK runs with no problems
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
steevithak



Joined: Aug 15, 2009
Posts: 12
Location: Dallas, TX

PostPosted: Sun Aug 16, 2009 3:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, after a little trial and error I've found the specific optimization that's killing it:

-fstrict-aliasing

So I'm now able to get a good compile and a running binary with -O3 by using this set of options in CFLAGS in the makefile:

CFLAGS?= -O3 -fno-strict-aliasing
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sun Aug 16, 2009 7:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

Great! And good that you documented this!

Hardware-wise anything in the x86 series should work, it's 64 bit CPU's that are the issue, not exotic instructions. Good call to look into the debug settings. I think compiling ChucK for Ubuntu (or any Debian-based system really) is a fairly easy compile as long as you take the latest version; the thing is that GCC has been getting more strict about standards. I wouldn't rule out that you are running a newer version of GCC then others are; Debian can be slow to adopt versions as they want things to be very well tested on a whole slew of platforms, Ubuntu pushes things through more aggressively when they work on x86's but I'm not sure GCC is a big thing for them, they might just follow Debian there.

Sorry I wasn't of more help; I know little about Fedora and tonight I had to help make some local radio.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sun Aug 16, 2009 8:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

I send a link to this to the dev-list. Your version of GCC is newer than the 4.3.3 that I've got here so this probably means a lot more people will have this issue in the near future as other distros upgrade. Hopefully the next version of ChucK will take this into account as these errors really aren't as welcoming to a new instrument as we would ideally be.

At least you're up and running now, welcome to our merry gang!

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
steevithak



Joined: Aug 15, 2009
Posts: 12
Location: Dallas, TX

PostPosted: Mon Aug 17, 2009 1:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yes, Redhat updates Fedora twice a year and stuffs in the absolute latest versions of everything including gcc. It's great when you need the latest hardware support but the downside is that it acts as an early warning system by breaking in cases like this well before the more conservative GNU/Linux distros. :)

Thanks for the hint about the dev-list. I found it and subscribed. I'm adding some new MIDI features to the code and it'll be interesting to run the changes by the developers and see if it's something they want to incorporate. I need it for my application but I don't know if MIDI is really used that much by ChucK users in general.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Mon Aug 17, 2009 3:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

Well, the nice thing is that MIDI wouldn't get in the way of those who don't use it either.

The current system always seemed needlessly technical to me for casual usage though admittedly when everything is just int you could record a stream of
MIDI if you really wanted to. It was a bit of a surprise to hear the underlying library does use nice names, I don't see much advantage to going back and forth like that.

I'm not sure how much it's currently used, maybe not that many people still use a rack of MIDI gear but it would also be useful with the now popular plugins and DAW's... maybe not that many people use it now because the current situation looks a bit scary... that's pure speculation but I see no reason at all to add an more pleasant to deal with layer to the current implementation.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
wmonk



Joined: Sep 15, 2008
Posts: 528
Location: Enschede, the Netherlands
Audio files: 15

PostPosted: Thu Aug 20, 2009 4:21 am    Post subject: Reply with quote  Mark this post and the followings unread

Ooh, missed this one. I use chuck on Fedora 10, because most of the CCRMA rpms are for 10, and it's a bit more stable. Compiled chuck and miniaudicle myself and build an RPM.

Great you got it worked! Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [15 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use