Giter Site home page Giter Site logo

Comments (12)

nwhetsell avatar nwhetsell commented on June 18, 2024

Can you try running the tests and seeing whether they all pass? To do this:

  1. cd to your csound-api folder (looks like /home/olimex/guitarFX/node_modules/csound-api).

  2. Install the bindings package by running:

    npm install bindings
  3. If you don’t have it already, install Jasmine globally by running:

    npm --global install jasmine
  4. Run:

    npm test

PerformAsync has coverage in the tests (which are passing), but it’ll be good to check first whether the tests pass on your end.

from csound-api.

flxb8 avatar flxb8 commented on June 18, 2024

thx for the quick reply. this is the result:

> [email protected] test /home/olimex/guitarFX/node_modules/csound-api
> jasmine

node: symbol lookup error: /home/olimex/guitarFX/node_modules/csound-api/build/Release/csound-api.node: undefined symbol: __atomic_load_16
npm ERR! Test failed.  See above for more details.

from csound-api.

nwhetsell avatar nwhetsell commented on June 18, 2024

So no tests run?

I’m trying to build csound-api with Csound 6.04.0 on Travis CI, but something weird is going on and the builds are timing out. I’ll try again when Travis is back up, but in the meantime, what’s the output when you run

gcc -v

from csound-api.

flxb8 avatar flxb8 commented on June 18, 2024

no this was the only output of npm test

olimex@guitarFX:~/guitarFX$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/5/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-arm64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-arm64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-arm64 --with-arch-directory=aarch64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)

from csound-api.

nwhetsell avatar nwhetsell commented on June 18, 2024

For what it’s worth, csound-api is building with Csound 6.04.0 on Travis CI with Node.js 10, 9, 8, and 6.

What’s the output when you build csound-api by running

node-gyp rebuild --verbose

from csound-api.

flxb8 avatar flxb8 commented on June 18, 2024

thats the build output:

olimex@guitarFX:~/guitarFX/node_modules/csound-api$ node-gyp rebuild --verbose
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/bin/node', '/usr/bin/node-gyp', 'rebuild', '--verbose' ]
gyp info using [email protected]
gyp info using [email protected] | linux | arm64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.12\n"
gyp verb get node dir no --target version specified, falling back to host node version: 10.0.0
gyp verb command install [ '10.0.0' ]
gyp verb install input version string "10.0.0"
gyp verb install installing version: 10.0.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 10.0.0
gyp verb build dir attempting to create "build" dir: /home/olimex/guitarFX/node_modules/csound-api/build
gyp verb build dir "build" dir needed to be created? /home/olimex/guitarFX/node_modules/csound-api/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /home/olimex/guitarFX/node_modules/csound-api/build/config.gypi
gyp verb config.gypi checking for gypi file: /home/olimex/guitarFX/node_modules/csound-api/config.gypi
gyp verb common.gypi checking for gypi file: /home/olimex/guitarFX/node_modules/csound-api/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/olimex/guitarFX/node_modules/csound-api/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/olimex/.node-gyp/10.0.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/olimex/.node-gyp/10.0.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/olimex/.node-gyp/10.0.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/olimex/guitarFX/node_modules/csound-api',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture arm64
gyp verb node dev dir /home/olimex/.node-gyp/10.0.0
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/olimex/guitarFX/node_modules/csound-api/build'
  g++ '-DNODE_GYP_MODULE_NAME=csound-api' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/olimex/.node-gyp/10.0.0/include/node -I/home/olimex/.node-gyp/10.0.0/src -I/home/olimex/.node-gyp/10.0.0/deps/uv/include -I/home/olimex/.node-gyp/10.0.0/deps/v8/include -I../node_modules/nan  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/csound-api/src/csound-api.o.d.raw   -c -o Release/obj.target/csound-api/src/csound-api.o ../src/csound-api.cc
  g++ -shared -pthread -rdynamic  -Wl,-soname=csound-api.node -o Release/obj.target/csound-api.node -Wl,--start-group Release/obj.target/csound-api/src/csound-api.o -Wl,--end-group -lcsound64
  rm -rf "Release/csound-api.node" && cp -af "Release/obj.target/csound-api.node" "Release/csound-api.node"
make: Leaving directory '/home/olimex/guitarFX/node_modules/csound-api/build'
gyp info ok 

from csound-api.

nwhetsell avatar nwhetsell commented on June 18, 2024

And what’s the output of

g++ -v

from csound-api.

flxb8 avatar flxb8 commented on June 18, 2024
olimex@guitarFX:~$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/5/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-arm64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-arm64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-arm64 --with-arch-directory=aarch64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 

from csound-api.

nwhetsell avatar nwhetsell commented on June 18, 2024

The major difference I see is that the architecture used on Travis CI is x64 (and g++ -v shows Target: x86_64-linux-gnu), but your architecture is arm64 (and g++ -v shows Target: aarch64-linux-gnu). I don’t have access to a machine with that architecture, so it’s impossible for me to reproduce this. A Google search for “arm 64 __atomic_load_16” shows some results that suggest adding -latomic might resolve the issue. I think you can try this by changing

csound-api/binding.gyp

Lines 29 to 31 in e1ee6f6

'libraries': [
'-lcsound64'
]

to

'libraries': [
  '-lcsound64',
  '-latomic'
]

and then running node-gyp rebuild.

If that doesn’t work, I’m really at a loss. I’m guessing that __atomic_load_16 is used by lockfree queues, so it might be worth creating a small lockfree queue test program (or just using this one) and seeing whether that produces a similar issue. If it does, opening an issue here may lead to a way to fix this.

It’s also possible that posting a message at https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND could lead to a solution, but I’m really not sure if there are any users of csound-api who are active on that list.

I’ll leave this issue open in the meantime.

from csound-api.

flxb8 avatar flxb8 commented on June 18, 2024

thanks so much, it works!!!!

another short question, whats the way to go for controlling parameters in csound?
I am new to the csound-api and now i call the .CompileOrc() function and do something like gidepth init 0.54 for each update. Is there a better way? If yes, do you know where I can find some examples?

Thx!
bests!

from csound-api.

nwhetsell avatar nwhetsell commented on June 18, 2024

Just to make sure, using

'libraries': [
  '-lcsound64',
  '-latomic'
]

fixed this?

whats the way to go for controlling parameters in csound?

You might want to have a look at the Channels, Control & Events functions. Unfortunately, the only examples of these that I know of are in csound-api’s tests:

it('populates and deletes channel list', () => {
expect(csound.SetOption(Csound, '--nosound')).toBe(csound.SUCCESS);
expect(csound.CompileOrc(Csound, `
${orchestraHeader}
chn_k "Input", 1
chn_k "Output", 2
`)).toBe(csound.SUCCESS);
expect(csound.Start(Csound)).toBe(csound.SUCCESS);
const channelList = [];
expect(channelList.length).toBe(0);
const channelListLength = csound.ListChannels(Csound, channelList);
expect(channelListLength).toBe(2);
expect(channelList.length).toBe(channelListLength);
let channelInfo = channelList[0];
expect(channelInfo.name).toBe('Input');
expect(channelInfo.type).toBe(csound.CONTROL_CHANNEL | csound.INPUT_CHANNEL);
expect(typeof channelInfo.hints).toBe('object');
channelInfo = channelList[1];
expect(channelInfo.name).toBe('Output');
expect(channelInfo.type).toBe(csound.CONTROL_CHANNEL | csound.OUTPUT_CHANNEL);
expect(typeof channelInfo.hints).toBe('object');
csound.DeleteChannelList(Csound, channelList);
expect(channelList.length).toBe(0);
});
it('sets and gets control channel hints', () => {
const name = 'test';
expect(csound.SetOption(Csound, '--nosound')).toBe(csound.SUCCESS);
expect(csound.CompileOrc(Csound, `chn_k "${name}", 1`)).toBe(csound.SUCCESS);
expect(csound.Start(Csound)).toBe(csound.SUCCESS);
let hints = {
behav: csound.CONTROL_CHANNEL_INT,
dflt: 5,
min: 1,
max: 10,
attributes: 'attributes'
};
expect(csound.SetControlChannelHints(Csound, name, hints)).toBe(csound.SUCCESS);
hints = {};
expect(csound.GetControlChannelHints(Csound, name, hints)).toBe(csound.SUCCESS);
expect(hints.dflt).toBe(5);
expect(hints.min).toBe(1);
expect(hints.max).toBe(10);
expect(hints.attributes).toBe('attributes');
});
it('sets and gets control channel value', () => {
const name = 'test';
csound.SetControlChannel(Csound, name, 42);
const info = {};
expect(csound.GetControlChannel(Csound, name, info)).toBe(42);
expect(info.status).toBe(csound.SUCCESS);
expect(csound.GetControlChannel(Csound, name)).toBe(42);
});

it('receives score events', done => {
const Csound = csound.Create();
expect(csound.SetOption(Csound, '--nosound')).toBe(csound.SUCCESS);
expect(csound.CompileOrc(Csound, orchestraHeader)).toBe(csound.SUCCESS);
expect(csound.Start(Csound)).toBe(csound.SUCCESS);
csound.PerformAsync(Csound, result => {
expect(result).toBeGreaterThan(0);
csound.Destroy(Csound);
done();
});
expect(csound.ScoreEvent(Csound, 'e')).toBe(csound.SUCCESS);
});
it('receives score statement messages', done => {
const Csound = csound.Create();
expect(csound.SetOption(Csound, '--nosound')).toBe(csound.SUCCESS);
expect(csound.CompileOrc(Csound, orchestraHeader)).toBe(csound.SUCCESS);
expect(csound.Start(Csound)).toBe(csound.SUCCESS);
csound.PerformAsync(Csound, result => {
expect(result).toBeGreaterThan(0);
csound.Destroy(Csound);
done();
});
csound.InputMessage(Csound, 'e');
});

from csound-api.

flxb8 avatar flxb8 commented on June 18, 2024

yes adding -latomic and rebuilding it with node-gyp solved the problem!
I'll have a look at the control channels.
thx again!
bests.

from csound-api.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.