Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run on Bela v0.3.2 #3

Closed
jarmitage opened this issue May 17, 2018 · 3 comments
Closed

Unable to run on Bela v0.3.2 #3

jarmitage opened this issue May 17, 2018 · 3 comments

Comments

@jarmitage
Copy link

Following the README as far as

root@bela:~/Bela/scripts# ./build_pyo.sh ../../pyo-bela/examples/music-box.py ../../pyo-bela/common/

Running /root/Bela/projects/music-box/music-box
Error: no audio callback defined. Make sure you set settings->render to point to your audio callback
Error: unable to initialise audio
Fatal Python error: PyEval_AcquireThread: NULL new thread state
Aborted
Makefile:504: recipe for target 'runonly' failed
make: *** [runonly] Error 134
Connection to 192.168.7.2 closed.

I'm guessing something has probably changed since v0.1.0a stable 2016.07.23? @giuliomoro

@giuliomoro
Copy link
Contributor

giuliomoro commented May 17, 2018

You need to add three lines to the main.cpp file, as per this commit:

BelaPlatform/Bela@8044c2d#diff-175a58b551ef8744df9a5c258d580f8f

Not sure why that main.cpp is needed anyhow, @belangeo ? Do you require the Bela blocksize to be 32?

If all you need is to specify some extra default settings, I'd recommend you get rid of the main.cpp file and set the default settings in a function
void Bela_userSettings(BelaInitSettings *settings) inside render.cpp, e.g.:

void Bela_userSettings(BelaInitSettings *settings)
{
	settings->periodSize = 32;
	settings->numAnalogInChannels = 8;
	settings->numAnalogOutChannels = 8;
	settings->analogOutputsPersist = 0;
}

(the last setting was not included in @belangeo's main.cpp, but it saves a bit of memory copying, which could be helpful).

In case you are willing to re-factor slightly the code in render(), you could also add
settings->uniformSampleRate = 1;, so that the analog channels are resampled in the backend and come into render() at the same rate as the audio channels.

Last, looking forward a couple of weeks to the release of Bela Mini, you want to make sure it all works fine when there are no analog out channels. In particular line

    pyo.analogout(context->analogOut);

in render.cpp will have to be conditionally excluded (as analogOut will be NULL). Not sure if this is going to break anything inside pyo though?

@jarmitage
Copy link
Author

Can confirm that adding those three lines fixes, thanks

@belangeo
Copy link
Owner

All done! Thanks Giulio for the hints!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants