Author |
Message |
rumpofsteelskin
Joined: Apr 22, 2009 Posts: 52 Location: brighton, uk
|
Posted: Mon Mar 13, 2017 10:53 am Post subject:
starting with arm |
 |
|
I've decided to have a go at programming some ARM based DSP synths - to get to know more about DSP and 32 bit processors.
Does anyone have recommendations for a good dev board, debugger, IDE etc? I've done a fair bit of 8bit programming but I don't know much about this.. I want it to be affordable but also I don't want to reach limitations too quickly, i'm hoping ill get a lot of use out of it
What are good 'net resources for simple (and useful!) music applications? I learnt DSP and programming at university but my skills are pretty rusty as I do mostly analogue stuff now
any suggestions much appreciated! |
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Mon Mar 13, 2017 12:12 pm Post subject:
|
 |
|
I've been using the Raspberry Pi 3, which is $35 (just the populated board, need PSU et al). It doesn't have high quality on board audio, but I bought Wolfson boards for them (I have 4). So the price for good audio on the Rpi3 is around $100. Runs Linux. I program in C and use ALSA. The CPU is a 4 core ARM that can run at 1200 MHz. The CPU cores all have their own NEON FPU. I've been able to get polyphonic MIDI synthesizers running with between 16 and 64 voices depending on voice complexity. I looked at using it in bare metal mode, but I was put off by the hassle of writing my own bootloader code (which runs in the GPU). I've not had latency issues using ALSA. The Raspberry Pi 4 is soon to be released which is claimed to be able to run at 1800 MHz. I also have a Pi 2 which runs (overclocked) at 1000 MHz and it performs quite well too with the audio boards I have. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
Back to top
|
|
 |
rumpofsteelskin
Joined: Apr 22, 2009 Posts: 52 Location: brighton, uk
|
Posted: Mon Mar 13, 2017 12:21 pm Post subject:
|
 |
|
i was thinking of going for a bare metal kind of thing - single core, no os, like an STM dev board or suchlike. Then again, maybe I could just go for a raspberry pi - would that be much of a jump from doing bare metal stuff on 8bit processors? I only know C and I'm not sure I want to get bogged down with linux but, maybe it would be a good thing to learn.. |
|
Back to top
|
|
 |
gdavis
Joined: Feb 27, 2013 Posts: 359 Location: San Diego
Audio files: 1
|
Posted: Mon Mar 13, 2017 1:42 pm Post subject:
|
 |
|
I can't recommend any specific resources, but just from doing my own web searches there seems to be a lot more support out there from people doing Linux based stuff. I wouldn't say it's a "jump" from bare metal as much as it is just a different set of resources available. You're interacting with the OS instead of directly with the hardware, but either way you need to study the interface and architecture of the platform.
The nice thing about the OS approach is it saves you from a lot of low level programming. Drivers are often available that let you get up and running more easily with complex things like audio and graphics, letting you focus more on the "fun" stuff. C programming is very well supported in Linux. With something like the Pi, you can work directly on the board so you don't have to rely on an IDE on another machine. Then again, you may prefer a nice GUI IDE over Vim on Linux
On the other hand you may prefer interacting more directly with the hardware, not spending time setting up an OS and relying on a lot of other peoples software. But you'll be spending time on more mundane stuff. I spend a fair amount of time coding to set up the audio codec to get sound out and I've spent the last couple months writing a bare metal USB host stack just so I can connect a USB MIDI controller to my synth
I enjoy the Linux environment a lot, but I've only used it on full computers, not on embedded processors or for synths. If you've never used a Unix type OS there will be a learning curve. I think it really just comes down to how you want to spend your time and effort. _________________ My synth build blog: http://gndsynth.blogspot.com/ |
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 224
|
Posted: Mon Mar 13, 2017 2:22 pm Post subject:
|
 |
|
rumpofsteelskin wrote: | i was thinking of going for a bare metal kind of thing - single core, no os, like an STM dev board or suchlike. Then again, maybe I could just go for a raspberry pi - would that be much of a jump from doing bare metal stuff on 8bit processors? I only know C and I'm not sure I want to get bogged down with linux but, maybe it would be a good thing to learn.. |
As gdavis says, the OS being there provides a lot of "already available" resources which are going to be difficult at best to troubleshoot in bare metal, not the least of which is the GPU stuff. I did already have a background with using Linux, but I had to learn ALSA from scratch (ALSA is the bit that lets you program against the sound driver so that all you need is to give it a buffer full of samples and it plays them). There is free information available on the web - in fact - I started with test program source code (in plain C) that is on the ALSA Project website. The test program played a continuous sinewave tone. Looking at that code and reading on the site allowed be to create synthesizer code based on the guts of the test program. One thing I should mention about the Rpi ARM CPU - the NEON FPU supports single precision floating point. After writing 5 MIDI synths, I found sing prec float to be more than adequate especially since I had previously been doing work on a dsPIC in 16 bit fixed point (assembly language). Moving from 16 bits to 24 bit mantissa float was like a breath of fresh air with the extra 8 bits of mantissa headroom added to the fact that the exponent increases range. The gcc compiler installed uses the NEON instructions for floats (I checked the disassembled output file). I do all of the compile and souce code edit work on the Raspberry Pi itself which makes for a fast edit-compile-test cycle and no head scratching over weirdness of cross-compile on another box plus the transfer of files each time you do a edit-compile-test cycle.
As for the jump from 8 bit CPU bare metal - there's no comparison really. The Rpi3 will smoke any 8 bit out there. My synths will all run headless too, I don't depend on a GUI interface, but with QT it's certainly possible to do that. One nice thing about an OS is the ability to print values to the screen or write to a file. Those resources are right there, just say printf(). 8 bit CPUs will need to have the code compiled on a PC and sent to it over USB, where as I mentioned, that's not necessary if you use gcc on the pi itself. I use an ssh connection to talk to the pi. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
Back to top
|
|
 |
rumpofsteelskin
Joined: Apr 22, 2009 Posts: 52 Location: brighton, uk
|
Posted: Mon Mar 13, 2017 3:43 pm Post subject:
|
 |
|
hmm, yeah, that's good advice.... I don't know which to choose now! So many options. I enjoy the gritty parts of setting up hardware etc. but maybe I should opt for something I can get stuff done with quickly
I was thinking of programs about the same complexity as the mutable instruments stuff - I know Olivier uses the STM chips, and that a lot of other applications are based around those or use the same ARM cortex. Making stuff like oscillators and filters on these chips - I think - would be a good step up from where I am now.
On the other hand, the Linux stuff sounds like it could be a lot of fun and would also be more flexible for other stuff should I feel like experimenting.
...and I need to leave enough time to go to work |
|
Back to top
|
|
 |
BobTheDog

Joined: Feb 28, 2005 Posts: 4040 Location: England
Audio files: 32
G2 patch files: 15
|
Posted: Thu Mar 30, 2017 1:45 am Post subject:
|
 |
|
It might be worth you having a look at this as well: http://bela.io/
Plugs into a beaglebone black with Xenomai Linux which gives you hard real time scheduling.
With the basic board you get stereo I/O and 16 analog I/O and 16 digital I/O all running at audio rate.
The BB Black only has an A8 running at 1Ghz though. |
|
Back to top
|
|
 |
wmonk
Joined: Sep 15, 2008 Posts: 528 Location: Enschede, the Netherlands
Audio files: 15
|
Posted: Sat May 06, 2017 1:35 pm Post subject:
|
 |
|
I can recommend the STM32F4 series for a more embedded feel, as the first upgrade from 8-bit microcontrollers. (used F2 and F3 as well, but not for DSP work). The development boards are pretty cheap (Nucleo series) and some even have an embedded codec (Discovery board) so you don't need to add a shield.
To teach a few fellow students we used the Eclipse IDE with GNU ARM Eclipse plugins. See http://gnuarmeclipse.github.io/
But when not explaining code to my mates, I rather use plain gcc, openocd and a text editor. _________________ Weblog! |
|
Back to top
|
|
 |
|