Csound API rtaudio error
Date | 2016-03-26 02:33 |
From | Emmett Palaima |
Subject | Csound API rtaudio error |
unknown rtaudio module: 'PortAudio', using dummy module rtaudio: dummy module enabled Really unsure why this is happening, I'm on a mac so PortAudio should be the correct rtaudio module. I know my csd is running because I added a printks statement which succeeds in printing to the terminal. Tried selecting port audio both in my csd and in the command line. I've included all the code I am using, please let me know if you see anything. Here is my csd: <CsoundSynthesizer> <CsOptions> -odac1 -+rtaudio=PortAudio </CsOptions> <CsInstruments> sr = 44100 ksmps = 128 nchnls = 2 0dbfs = 1.0 turnon 1 instr 1 printks "i'm on", 1 a1 oscil .8, 440 outs a1, a1 endin </CsInstruments> <CsScore> </CsScore>
</CsoundSynthesizer> Here is the example code from the manual that I am running: Run with command line ./apitest "csdfilename" #include <stdio.h> #include <csound/csound.h> uintptr_t csThread(void *clientData); typedef struct { int result; CSOUND *csound; int PERF_STATUS; } userData; int main(int argc, char *argv[]) { int finish; void *ThreadID; userData *ud; ud = (userData *)malloc(sizeof(userData)); MYFLT *pvalue; ud->csound = csoundCreate(NULL); ud->result = csoundCompile(ud->csound, argc, argv); if (!ud->result) { ud->PERF_STATUS = 1; ThreadID = csoundCreateThread(csThread, (void *)ud); } else { return 1; } /* keep performing until user types a number and presses enter */ scanf("%d", &finish); ud->PERF_STATUS = 0; csoundDestroy(ud->csound); free(ud); return 0; } /* performance thread function */ uintptr_t csThread(void *data) { userData *udata = (userData *)data; if (!udata->result) { while ((csoundPerformKsmps(udata->csound) == 0) && (udata->PERF_STATUS == 1)); csoundDestroy(udata->csound); } udata->PERF_STATUS = 0; return 1; } |
Date | 2016-03-26 08:34 |
From | Rory Walsh |
Subject | Re: Csound API rtaudio error |
Have you tried removing portaudio from the CsOptions? Just use -odac and I think Csound will simply choose the default audio drivers on OSX. On 26 March 2016 at 02:33, Emmett Palaima <epalaima@berklee.edu> wrote:
|
Date | 2016-03-26 12:40 |
From | jpff |
Subject | Re: Csound API rtaudio error |
portaudio not PortAudio On Sat, 26 Mar 2016, Rory Walsh wrote: > Have you tried removing portaudio from the CsOptions? Just use -odac and I > think Csound will simply choose the default audio drivers on OSX. > > On 26 March 2016 at 02:33, Emmett Palaima |
Date | 2016-03-26 15:48 |
From | Emmett Palaima |
Subject | Re: Csound API rtaudio error |
I have tried both of those actually, I added the -+rtaudio=portaudio after I was getting no output with just -odac in the header. I tried both capitalized and non capitalized just to make sure. PortAudio is the name they give in the csound command line flags page so I was a little confused. > On Mar 26, 2016, at 8:40 AM, jpff |
Date | 2016-03-26 17:41 |
From | Rory Walsh |
Subject | Re: Csound API rtaudio error |
You may need to set OPCODE6DIR64? I had similar issues on OSX recently. My app could find the Csound library but none of the auxiliary libs. On 26 Mar 2016 16:48, "Emmett Palaima" <epalaima@berklee.edu> wrote:
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
I have tried both of those actually, I added the -+rtaudio=portaudio after I was getting no output with just -odac in the header. I tried both capitalized and non capitalized just to make sure. PortAudio is the name they give in the csound command line flags page so I was a little confused. |
Date | 2016-03-26 17:46 |
From | Emmett Palaima |
Subject | Re: Csound API rtaudio error |
How do I set the opcode directory in c? The only examples I can find of this are python. On Sat, Mar 26, 2016 at 1:41 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
|
Date | 2016-03-26 17:54 |
From | Rory Walsh |
Subject | Re: Csound API rtaudio error |
You don't need to set it in C. You can set it from the command line using 'export'. On 26 Mar 2016 18:46, "Emmett Palaima" <epalaima@berklee.edu> wrote:
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
|
Date | 2016-03-26 18:05 |
From | Emmett Palaima |
Subject | Re: Csound API rtaudio error |
Would I do that as part of the command line running my compiled c file or would I run it beforehand. Do you have an example command line? On Sat, Mar 26, 2016 at 1:54 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
|
Date | 2016-03-26 18:26 |
From | Rory Walsh |
Subject | Re: Csound API rtaudio error |
You can try something like: export OPCODE6DIR64="path to Csound opcodes" Note that it will only be valid for the current session. Csound checks this environment variable on startup, if it is not there, Csound may not find certain plugin opcodes. I have to say at this stage that I've very little OSX experience! But i'm happy to throw out suggestions. On 26 March 2016 at 18:05, Emmett Palaima <epalaima@berklee.edu> wrote:
|
Date | 2016-03-26 18:48 |
From | Emmett Palaima |
Subject | Re: Csound API rtaudio error |
I just tried this, in the terminal I ran: export OPCODE6DIR64=/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64 then ./apitest I got the same result. Is the export command supposed to be something different between c and python perhaps? Thank you everyone for their help. I really appreciate it. On Sat, Mar 26, 2016 at 2:26 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
|
Date | 2016-03-26 19:10 |
From | Rory Walsh |
Subject | Re: Csound API rtaudio error |
export is a shell command that sets a system variable. It has nothing to do with Python. Your command looks right to me. I'm afraid I'm out of ideas. I got stuck with this before but setting the OPCODE6DIR64 worked for me. When you leave out any mention of rtudio and try ./apitest what does your app return? Can you copy and paste it here? You've tried just "-odac"? On 26 March 2016 at 18:48, Emmett Palaima <epalaima@berklee.edu> wrote:
|
Date | 2016-03-26 19:43 |
From | jpff |
Subject | Re: Csound API rtaudio error |
ysetenv("OPCODE6DIR", "MY_VAUE"0, 1) Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-03-26 19:48 |
From | jpff |
Subject | Re: Csound API rtaudio error |
Apologies - typos setenv("OPCODE6DIR63", "my_directory", 1) On Sat, 26 Mar 2016, jpff wrote: > ysetenv("OPCODE6DIR", "MY_VAUE"0, 1) > > Csound mailing list > Csound@listserv.heanet.ie > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-03-26 21:17 |
From | joachim heintz |
Subject | Re: Csound API rtaudio error |
you probably mean "OPCODE6DIR64" ? On 26/03/16 20:48, jpff wrote: > Apologies - typos > setenv("OPCODE6DIR63", "my_directory", 1) > > > On Sat, 26 Mar 2016, jpff wrote: > >> ysetenv("OPCODE6DIR", "MY_VAUE"0, 1) >> >> Csound mailing list >> Csound@listserv.heanet.ie >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND >> Send bugs reports to >> https://github.com/csound/csound/issues >> Discussions of bugs and features can be posted here >> > > Csound mailing list > Csound@listserv.heanet.ie > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here > Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-03-28 19:24 |
From | Emmett Palaima |
Subject | Re: Csound API rtaudio error |
When I leave out the -+rtaudio it returns the following: unknown rtaudio module: 'PortAudio', using dummy module rtaudio: dummy module enabled When I include the -+rtaudio flag it replaces 'PortAudio' with '(whatever audio module I set with the flag)' . -odac vs -odac1 does not seem to make a difference. John, where is that setenv command used? In the terminal before running? Thanks everyone for your help. On Sat, Mar 26, 2016 at 5:17 PM, joachim heintz <jh@joachimheintz.de> wrote: you probably mean "OPCODE6DIR64" ? |
Date | 2016-03-28 20:01 |
From | jpff |
Subject | Re: Csound API rtaudio error |
On Mon, 28 Mar 2016, Emmett Palaima wrote: > When I leave out the -+rtaudio it returns the following: > unknown rtaudio module: 'PortAudio', using dummy module > > rtaudio: dummy module enabled > > When I include the -+rtaudio flag it replaces 'PortAudio' with '(whatever > audio module I set with the flag)' . -odac vs -odac1 does not seem to make a > difference. > > John, where is that setenv command used? In the terminal before running? > That was an answer to how to do it it C, so anywhere before calling any csound API. If you are getting references to PortAudio it tells me that you are not on Linuxfor which alsa is the default, ( As an aside I think this is a bug in bsd and oter un*x style fiing systems that are case sensitive) Do you have any file with names like librt*? I have portaudio as librtpa.so -- but I am not the correct person to help, being 100% Linux site (and an unused Windows XP machine) ==John Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-03-29 09:48 |
From | Rory Walsh |
Subject | Re: Csound API rtaudio error |
As John says you can try placing the call to setenv("OPCODE6DIR64", "/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64", 1) at the start of your main function. That will set OPCODE6DIR64 for that session and should hopefully provide Csound with the info it needs to find the realtime IO libs. Let us know if it works! On 28 March 2016 at 20:01, jpff <jpff@codemist.co.uk> wrote:
|
Date | 2016-03-29 10:42 |
From | Oeyvind Brandtsegg |
Subject | Re: Csound API rtaudio error |
Just my 2c on this, it might be unrelated, but when I tested the new installer for windows I got the same kind of problem. I turns out, for me it was related to several different Csound versions residing in my system. The Csound library included with Cabbage was found before the canonical one, and there were differences in how to access reatime audio and midi between those two versions. Just as a test, could you try running something with rt audio in Csound from the command line? This will confirm that your installed Csound can communicate with the audio device. Then, take a note of the Csound version number and build date (of this Csound version that you run in the terminal). Then when you run your program using the csoundAPI, check that the version number and build date is identical to what you got with command line Csound. If there is a difference, that might well be the source of the problem. If not, then this tip did not matter for your situation. all best Oeyvind 2016-03-29 10:48 GMT+02:00 Rory Walsh |
Date | 2016-03-29 11:10 |
From | Rory Walsh |
Subject | Re: Csound API rtaudio error |
I think this is a slightly different issue as a) it's on OSX, and b) the user is ONLY using the installed version of Csound. Csound will run fine from the command line because it is installed and the Csound CLI knows where the opcode libs are. When building your own Csound frontend we need to tell it where to find the plugin opcodes. At least this is my understanding. I think Victor must be enjoying a few days off at the moment. Otherwise I'm sure he'd had a solution for this! On 29 March 2016 at 10:42, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote: Just my 2c on this, it might be unrelated, but when I tested the new |
Date | 2016-03-29 15:16 |
From | Paul Batchelor |
Subject | Re: Csound API rtaudio error |
It may be that your build of Csound doesnt have portaudio enabled. What OS are you running this on? On Mar 29, 2016 03:11, "Rory Walsh" <rorywalsh@ear.ie> wrote:
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
|