Exit BeagleBone Black, hello Cubieboard2!

Put up my BeagleBone Black for sale. It was gathering dust, somehow this board doesn’t appeal to me. Biggest drawback is that it seems to be very picky with power adapters. If you don’t use a linear power adapter USB devices might not work properly. And that was exactly the issue I was facing, I just couldn’t get my USB audio interfaces to work on the BBB. So I lost interest because well, that’s what I bought the device for, to get sound out of it with the help of an USB audio interface. Add to this that there is no realtime kernel or RT patchset available for the BBB and that the BBB is quite a complex little device (it’s actually a REAL dev board). It would’ve cost me too much time to completely fathom it. No bad feelings though, the BBB is a very nice product and it sure has the slickest looks of all ARM SoC dev boards around.

Also I got a Cubieboard2 in recently. And that board has absorbed me for the last week and a half. It’s quite easy to set up (not as easy as the RPi though), has a lot of IO (yes, it has audio in and out!) and it blows both the RPi and BBB away when it comes to performance with its dual core A20 Allwinner SoC that can easily be overclocked to 1.2 GHz. Alas, no realtime kernel or RT patchset either but hey, I managed to get a RT kernel running on a Rockchip RK3066 based device so I could at least give it a try. And it worked out well. I’m now running a 3.4.61-rt77 kernel on it with a custom Debian Wheezy installation. This time I used git to keep track of the modifications I made so it was a lot easier to create a usable diff. I also patched the driver for the onboard audio codec because the hardcoded defaults were just unusable for realtime audio. Minimum number of periods was 4 and minimum buffer size was 1024. Don’t ask me why. So I’ve changed these to 2 and 16 respectively and managed to get JACK running at a respectable -p64 -n2 -r44100. Fired up some JACK clients and this little monster keeps up very well. USB audio interfaces are no problem either, I can run my Edirol UA25 in Advanced mode with -p64 -n3 -r48000 without any hitch. This is probably because the Cubieboard2 doesn’t use a Synopsys DesignWare OTG controller with out-of-tree dwc_otg drivers like the RPi but a better supported USB controller. At the moment the Cubieboard2 is the nicest ARM dev board I have laid my hands on so far.


text-align: center;

Cubieboard2

RT patchset 3.4.61-rt77 for linux-sunxi, sunxi-3.4 branch

Low latency defaults patch for sunxi-codec driver

Exit BeagleBone Black, hello Cubieboard2!

20 thoughts on “Exit BeagleBone Black, hello Cubieboard2!

  1. Sandro Ribeiro says:

    Good to hear you got a Cubieboard 2. I have one also, but it is gathering dust. Maybe you could share your kernel patches in official forum (http://www.cubieforums.com). They finally managed to build a kernel with HW video decoding, so merging your patches with this kernel would be awesome. 🙂

  2. John Beavers says:

    Ooooo! I’m very excited to hear this. I’m looking to do about the same as you on a cubieboard2. I was thinking of using fluidsynth instead of amsynth, but I’m open to suggestions.

    Where is the post on the forum about this info, and did you provide patch(es) for the audio driver, too? Also, does the kernel source you used as a base have the GPIO drivers, or is that a patch, too?

    Thanks, I’m fairly new to embedded stuff. I’ve ordered my cubie, but have not received it yet.

    John

  3. Robert Leacroft says:

    Hi Jeremy,

    I am working on full duplex good quality (Opus) Audio over IP using Allwinner A10 on Cubieboard and Olimex (awaiting a Cubieboard2) and quality is perfect but audio latency is the biggest problem; just going in and out of a single board using alsa or jack before I even get to the internet. I would like to try your RT and Driver patches but the links will not connect. Do these patches still exist anywhere?

    Robert
    P.S. I also have a BeagleBone Black for disposal.

  4. Hello Robert, I’ve restored the contents of the cb2.autostatic.com site so the patches are available again. If you have any questions don’t hesitate to contact me.

  5. Gianfranco Ceccolini says:

    Hi Jeremy
    Did you manage to get the Cubie’s audio codec to run at 24bit ?
    The driver states only SNDRV_PCM_FMTBIT_S16_LE but the A20 data sheet states it works with 24bit resolution.
    Kind regards
    Gianfranco

  6. Nau says:

    Hi Jeremy !,

    I’m new in cubieboard world, and this very topic reassured me when I were hesitating on wether buying or not this little wonder.

    My project is to get puredata soft working together with jack in rt mode, and your work represents a big step forward for someone who wants to get such a sharp setup ! Thank you so much.
    I thought I had to set up everything manually when I stumbled upon your cb2 repo and the “drumtuners” image . It boots flawlessly, but can’t login. Could you please tell us more about pwd and login, please ?

    Thank you so much.

    p.s.: we already “met” on TangoStudio forum, and it’s funny to see you’re pushing things forward with cubieboard too ! TS switched from Ubuntu to Debian, if you’re still interested in this, for desktop computers of course …

    Thank you !

    Nau

  7. Nau says:

    Hi there,

    I’m somewhat frustrated because I spent a lot of time to try to start jackd2 on my cubie2 using your “drumtuners” image. I know that this image is maybe not meant to be “plug and play”, but the rt and audio driver patches seem to be incorporated. Soo nice !

    I followed the (again, patched) jackd2 installation procedure seen at http://www.cubieforums.com/index.php/topic,958.msg5885.html?PHPSESSID=q2sopsosa3rbd7h0j04br8cn47#msg5885 , and tried many variants of jackd command lines.
    The behaviour of jackd2 becomes sometimes unpredictable to me, here is an example:

    1) after a “jackd -r -d alsa -p 64 -n 2 -r 44100 &”, there are no error message, and jackd can be seen in the tasks using a “ps -e” command. But after a “jack_lsp” or “/usr/bin/patchage” command I get an error saying
    “Allocate: can’t check in named semaphore name = jack_sem.0_default_Patchage err = No space left on device
    Cannot allocate synchro
    JackPosixSemaphore::Destroy semaphore == NULL
    Cannot create new client

    from jackd. Dead end.

    2) After that I change the “-r” to become “-R” in the command line (had killed jackd before), and same scenario as before, just one more line to read in jackd messages informing that jackdmp runs in realtime with a priority of 10 (default). Cannot connect any client anyway.

    3) Now I add “-P 75” to my previous command line, and now jackd doesn’t load anymore, I get a different error: “Cannot lock down 82278944 byte memory area (Cannot allocate memory)”. (wasn’t this one of the errors covered by the patch ?)

    4) and now, the weird : when I try to run jackd with the command line used in 1) (not realtime,thus) jackd doesn’t start anymore, and now gives the error mentionned at 3).

    A kind of “memory effect”.

    The more frustrating among all is that ONE TIME it worked, I could see system inputs and outputs in patchage, fire up yoshimi and hear sound ! But never got it to work again, never.

    I guess I should configure my system further (there’s no .asoundrc nor .jackdrc file, for instance), any hint ? should everything be launched by the user or some with a sudo (I can’t login as root, I noticed). Topic http://comments.gmane.org/gmane.comp.audio.jackit/28474 makes me dubious on permissions.

    I also tried using “~/bin/jackstart” but it gave me hundreds of stderr lines I can’t reproduce now (due to this weird memory effect). And the arguments passed to jackstart seem to be ignored, though I couldn’t find where the defaults settings were stored (a rtprio of 84, for instance, as when I launch jackd with a “-R” argument it gives a default rtprio of 10).

    How do you use it? What do you think ?

    Sorry, I’m sorry for the flood.

    Thank you,

    nau

  8. Hello Nau, I didn’t test the image with X, only with the CLI. If you run into @/dev/shm@ (memory) related issues the easiest workaround is to reboot the Cubieboard. Another workaround is to remount @/dev/shm@ before you start working with JACK:
    @sudo mount -o remount,size=128M /dev/shm@
    My patched version of JACK works around ARM and packed structs, not any memory issues. -R is a default parameter of jackd, so no need to add it. If you don’t use QjackCtl there’s also no .jackdrc. You don’t need a .asoundrc file. I’d strongly suggest to read the jackd man page with regard to the usage of JACK parameters. jackstart is a startup script that doesn’t take any parameters. The image is already tuned and tweaked and Jack2 should work without issues when using the jackstart script. I guess that should get you going, otherwise send me a mail (jeremy[at]autostatic.com) if there are any further questions.

  9. Nau says:

    Thank you Jeremy.

    I first tried CLI only for three days or some, and nothing worked. I couldn’t convice myself that jack was running but didn’t accept any connection so I wanted to install X server to “see it with my own eyes” and get graph clients to test (I know, this is a bit stupid).
    And jack.org is down for days…

    I didn’t notice that jackstart actually was a script, quite confused by this page : http://ccrma.stanford.edu/planetccrma/man/man1/jackstart.1.html .

    Tonite I will overwrite my sd with drumtuners and strictly follow your indications…fingers crossed !

    Thanks,

    Nau

  10. Nau says:

    Hi there,

    indeed the ‘jackstart’ script odes the job in playback only.
    But I couldn’t manage getting the input to work. When I launch jackd in duplex mode it doesn’t complain, but the audio playback gets dirty from time to time, especially if I move the usb mouse. First I thought it was just a problem of too small -p and -n values, but afterwads I noticed I couldn’t get anything useful from my audio input. A ‘meterbridge’ applet doesn’t show any vumeter reaction when signal is coming in I can only see a kinda fake background noise volume that increases o decreases when I tweak levels within ‘alsamixer’.
    The input devices were a headphone mic and a piezo on a violin, and even though they could need a preamp I can’t imagine that no signal at all could be observed. (the input of the cubie2 is sometimes referred as “line in” or “mic in” in online forums). Sorry, I couldn’t find a post saying “yes, the input is working with jack”…[resolved]

    I tried an usb soundcard with ease in duplex and 2×128 buffer and a big “puredata’ patch, works fine. I tried to optimize using the rtirq-init script, worked fine. I launch my applications with a manually set rt priority. I’m gonna try ‘realtimeconfigquickscan’ to see if the system can be tweaked further.

    And among other things my ram is about 650mb (‘free’ command), and that seems a bit low. I guess that some memory is allocated for the graphics, so I get back to the point that console is lighter than a graphical environment (LXDE). I’m gonna see if changing screen resolution will free some memory up. And as a stupid common desktop user I wonder whether it’s possible to run in console mode and then only open grapical windows when needed (I see that as a classical rudimentary x11 use). This could be a nice way to save memory.

    In the case of a graphical desktop use, dou you think that mali acceleration could be installed with a gain in efficiency (mem, cpu) of audio applications ?

    Thank you again, this image is very nice and brought me a lot.

    Arnaud

  11. Bhabani says:

    As you suggested it has Audio I/O . can i use it for speech recognition application? Will it be fast enough to carry out the speech recognition tax using CMUSPHINX toolbox? Any idea ..

    My raspi is pretty slow to handel it and also the accuracy also drops down due to slow processing..

Leave a Reply

Your email address will not be published. Required fields are marked *