Csound Csound-dev Csound-tekno Search About

[Csnd] Opcode plugin on linux problem

Date2013-11-06 19:27
FromSimonKenny
Subject[Csnd] Opcode plugin on linux problem
Hi all

I'm testing a plugin that I've written. It works fine on OSX and now I'm
testing it on Linux. I've gotten my code to build into a shared object
library but I'm not having any success adding this to the csound runtime
program. When I use the --opcode-lib option to add the library I just get

...
Creating orchestra
Creating score
Loading command-line libraries:
rtaudio: ALSA module enabled
rtmidi: ALSA Raw MIDI module enabled
....

Which is followed by an error message when the parser reaches CSD code which
uses my opcode. I notice that there is no output giving an error (or
otherwise) after "Loading command-line libraries:". Incidentally if I use an
incorrect file name, i.e. --opcode-lib=adsada.so the output is the same.

Basically I've no idea how to find out why the library isn't being loaded as
there's no error information. Anyone any idea how I might be able to do
this?


Thanks for your time
Simon 



--
View this message in context: http://csound.1045644.n5.nabble.com/Opcode-plugin-on-linux-problem-tp5729221.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-11-06 19:48
FromMichael Gogins
SubjectRe: [Csnd] Opcode plugin on linux problem
Maybe your plugin is built for 32 bit sample words but Csound is bulit for 64 bit sample words. Or, your OPCODE6_DIR64 environment variable is not set.

Hope this helps,
Mike


-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Wed, Nov 6, 2013 at 2:27 PM, SimonKenny <digithree@gmail.com> wrote:
Hi all

I'm testing a plugin that I've written. It works fine on OSX and now I'm
testing it on Linux. I've gotten my code to build into a shared object
library but I'm not having any success adding this to the csound runtime
program. When I use the --opcode-lib option to add the library I just get

...
Creating orchestra
Creating score
Loading command-line libraries:
rtaudio: ALSA module enabled
rtmidi: ALSA Raw MIDI module enabled
....

Which is followed by an error message when the parser reaches CSD code which
uses my opcode. I notice that there is no output giving an error (or
otherwise) after "Loading command-line libraries:". Incidentally if I use an
incorrect file name, i.e. --opcode-lib=adsada.so the output is the same.

Basically I've no idea how to find out why the library isn't being loaded as
there's no error information. Anyone any idea how I might be able to do
this?


Thanks for your time
Simon



--
View this message in context: http://csound.1045644.n5.nabble.com/Opcode-plugin-on-linux-problem-tp5729221.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug trackers
csound6:
            https://sourceforge.net/p/csound/tickets/
csound5:
            https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2013-11-06 20:22
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re: plugins on Linux
AttachmentsNone  

Date2013-11-06 20:41
FromSimonKenny
Subject[Csnd] Re: Opcode plugin on linux problem
Hi Mike

Thanks for your reply. Actually I was compiling for a 32bit architecture
without thinking. I assume Csound is built for x64 as that's I'm running
Ubuntu 64bit. Totally forgot about that. However after re-building for x64
there is no change in how Csound responds. The opcode plugin shared object
library is in the current directory when I run the Csound binary so I don't
see how the OPCODE6_DIR64 variable would effect it's working unless I'm
missing something?

By the way my build command is as follows in case that shows up something:

g++ -shared -I
/home/digithree/Documents/Leap/LeapDeveloperKit/LeapSDK/include -I
/usr/local/include/csound -o libLeapIntoCsound.so LeapIntoCSound.cpp -L
/home/digithree/Documents/Leap/LeapDeveloperKit/LeapSDK/lib/x64 -lLeap -fPIC
-m64

(it's a Leap Motion plugin as you might have guessed!)


Thanks for your time
Simon



--
View this message in context: http://csound.1045644.n5.nabble.com/Opcode-plugin-on-linux-problem-tp5729221p5729227.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-11-06 20:44
FromSimonKenny
Subject[Csnd] Re: plugins on Linux
Hi jpff

-v doesn't give me much extra information, except the output now reads:

...
STARTING FILE
Creating options
decode_long opcode-lib=libLeapIntoCsound.so
Creating orchestra
Creating score
Loading command-line libraries:
rtaudio: ALSA module enabled
rtmidi: ALSA Raw MIDI module enabled
Calling preprocess on >>
...

and then proceeds to attempts to parse the CSD program in extreme detail
until it reaches the line containing my opcode. Thanks though



--
View this message in context: http://csound.1045644.n5.nabble.com/Opcode-plugin-on-linux-problem-tp5729221p5729228.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-11-06 21:56
FromMichael Gogins
SubjectRe: [Csnd] Re: Opcode plugin on linux problem
I did not say 64 bit or 32 bit computer architecture, I said 32 bit sample word size or 64 sample word size. These are not the same thing. This is always confusing for people who are new to Csound, or even to people who are not so new.\

When you run Csound, it prints out:

C:\Users\michael.gogins>csound
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.01.0 (double samples) Oct 20 2013
libsndfile-1.0.25
Usage:  csound [-flags] orchfile scorefile
Legal flags are:
--help  print long usage options
-U unam run utility program unam
-C      use Cscore processing of scorefile

et cetera. (double samples) above refers to 64 bit sample word size, not CPU architecture. For double samples, you need OPCODE6_DIR64. For 32 bit (single precision) samples, you need OPCODE6_DIR.

Hope this helps,
Mike


-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Wed, Nov 6, 2013 at 3:41 PM, SimonKenny <digithree@gmail.com> wrote:
Hi Mike

Thanks for your reply. Actually I was compiling for a 32bit architecture
without thinking. I assume Csound is built for x64 as that's I'm running
Ubuntu 64bit. Totally forgot about that. However after re-building for x64
there is no change in how Csound responds. The opcode plugin shared object
library is in the current directory when I run the Csound binary so I don't
see how the OPCODE6_DIR64 variable would effect it's working unless I'm
missing something?

By the way my build command is as follows in case that shows up something:

g++ -shared -I
/home/digithree/Documents/Leap/LeapDeveloperKit/LeapSDK/include -I
/usr/local/include/csound -o libLeapIntoCsound.so LeapIntoCSound.cpp -L
/home/digithree/Documents/Leap/LeapDeveloperKit/LeapSDK/lib/x64 -lLeap -fPIC
-m64

(it's a Leap Motion plugin as you might have guessed!)


Thanks for your time
Simon



--
View this message in context: http://csound.1045644.n5.nabble.com/Opcode-plugin-on-linux-problem-tp5729221p5729227.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug trackers
csound6:
            https://sourceforge.net/p/csound/tickets/
csound5:
            https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2013-11-06 22:28
FromSimonKenny
Subject[Csnd] Re: Opcode plugin on linux problem
Thank you, I am aware of the distinction, I thought you were talking about
architecture. My plugin is set to use double precision floats.

I was able to fix the problem of registration by moving my plugin shared
object file to the /usr/local/lib/csound/plugins-6.0 directory with all the
other plugins and also setting the environment variable as you suggested. I
was then able to get the following error:

WARNING: could not open library
'/usr/local/lib/csound/plugins-6.0/libLeapIntoCsound.so' (libLeap.so: cannot
open shared object file: No such file or directory)

which told me the problem was with resolving a dependency of my plugin.
After registering this dependency (libLeap.so) with the system (by moving it
to /usr/local/lib and executing ldconfig to update the linker list) my
plugin now works.

I very much appreciate your help, thank you again.
Simon



--
View this message in context: http://csound.1045644.n5.nabble.com/Opcode-plugin-on-linux-problem-tp5729221p5729231.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-11-06 22:59
FromMichael Gogins
SubjectRe: [Csnd] Re: Opcode plugin on linux problem

I'm glad I could help,
Mike

On Nov 6, 2013 5:28 PM, "SimonKenny" <digithree@gmail.com> wrote:
Thank you, I am aware of the distinction, I thought you were talking about
architecture. My plugin is set to use double precision floats.

I was able to fix the problem of registration by moving my plugin shared
object file to the /usr/local/lib/csound/plugins-6.0 directory with all the
other plugins and also setting the environment variable as you suggested. I
was then able to get the following error:

WARNING: could not open library
'/usr/local/lib/csound/plugins-6.0/libLeapIntoCsound.so' (libLeap.so: cannot
open shared object file: No such file or directory)

which told me the problem was with resolving a dependency of my plugin.
After registering this dependency (libLeap.so) with the system (by moving it
to /usr/local/lib and executing ldconfig to update the linker list) my
plugin now works.

I very much appreciate your help, thank you again.
Simon



--
View this message in context: http://csound.1045644.n5.nabble.com/Opcode-plugin-on-linux-problem-tp5729221p5729231.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug trackers
csound6:
            https://sourceforge.net/p/csound/tickets/
csound5:
            https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"