Page 1 of 5

Raspberry Pi and music production

Posted: Fri Jan 04, 2013 2:23 pm
by autostatic
Recently a patch was submitted to the JACK bugtracker to fix the infamous bus error with Jack2. Unfortunately the bugtracker is down at the moment but a similar patch was sent to the Jack-Devel list a few weeks later. With this patch it is possible to run Jack2 and an external USB interface with no problems. So the Raspberry Pi could now be used as a synth module, a guitar amp simulator or an effects box.

To get Jack2 to run on the RPi:

Code: Select all

wget http://jack-audio.10948.n7.nabble.com/attachment/15962/0/jack2_armel.diff
apt-get install dpkg-dev
apt-get source jackd2
apt-get build-dep jackd2
cd jackd2-1.9.8~dfsg.4+20120529git007cdc37
patch -p1 -i ../jack2_armel.diff
dpkg-source --commit
dpkg-buildpackage -rfakeroot -uc -b
cd ..
sudo dpkg -i libjack-jackd2-0_1.9.8~dfsg.4+20120529git007cdc37-5_armhf.deb jackd2_1.9.8~dfsg.4+20120529git007cdc37-5_armhf.deb
Now add the following lines to /etc/dbus-1/system.conf if you want to use JACK without X:

Code: Select all

  <policy user="pi">
       <allow own="org.freedesktop.ReserveDevice1.Audio0"/>
       <allow own="org.freedesktop.ReserveDevice1.Audio1"/>
  </policy>
And restart dbus:

Code: Select all

sudo service dbus restart
Now remount /dev/shm:

Code: Select all

sudo mount -o remount,size=128M /dev/shm
And if you want to run JACK without X:

Code: Select all

export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
Alternatively you could compile Jack2 without the --dbus option so it doesn't depend on dbus at all. Edit the debian/rules file and delete the --dbus option from the configure flags.

Now you can fire up JACK but not in full-duplex, only capture or playback, so use -C or -P. If you want full duplex than you'll have to do without the ethernet connection. The NIC on the RPi shares the same USB bus as the two USB ports. When active this apparently sucks up so much bandwidth that an USB audio interface can't do full duplex anymore. Also make sure you're using a powerful power supply. The RPi will work with 700mA but when you also want to connect an USB audio interface you need a power supply with a higher amperage. I found a cheap one that has an amperage of 2A and with this power supply my Edirol UA-25 works great: http://rosengroups.com/product.php?act=page&id=87
I got this one from a local construction market (Gamma) for less than €5,-.

Jeremy

¿What programs work decently?

Posted: Wed Jan 23, 2013 6:17 pm
by gazpacho
Great post.
At last jack is working which opens the way for lots of audio programs that need it. I have used a cheap usb midi connector to plug my good hammer action keyboard but with only 10 sounds and midi in/out to the raspberry, and from it to an external GM sound module. It worked fine giving the option to split and expand the keyboard' s abilities with qmidiroute and vmpk doing the midi control. Seq24 went fine, and I'm looking forward to other simple (not CPU thirsty) sequencing programs, like NON sequencer. I had terrible results trying to generate sounds with fluidsynth to hdmi and also to a usb audio (not pro-audio device), but anyway for now I'm happy about the only midi "managing" setup.
So now that jack works, the question is ¿How far can it go in performance, what can be expected?.
In regard to the way of controlling the pi, the hdmi option to a monitor/TV with audio and usb keyboard+pad would be the standard. The other way is using vnc or remote X via the ethernet network interface, but it interferes with the usb as noted in the post. So in both cases, to control the pi one has to deal with the usb and might affect another usb-audio device hooked to the pi. I understand one should expect from the pi only playback or capture abilities, not both.
Also there is the question of the need of a low latency kernel, or even a real time one. ¿Is it true that no real time kernel is possible due to the lack of a clock on the pi?
I would like to encourage those playing with their raspberry to post their findings on the use for audio, mainly which audio generation programs might work acceptably like: amsynth, fluidsynth, ZynAddSubFX, yoshimi, horgand, aeolus, gnorgan, etc. With this one can foresee what arm devices can deliver, hoping soon cheap tablets run linux.

Re: Raspberry Pi and music production

Posted: Mon Feb 04, 2013 5:57 pm
by i2productions
I don't check this forum enough. The only reason I found it was your post a month ago back to the request for an ARM forum. Anyway, I've put in my order for Raspberry Pi with amazon last night and am expecting it in 2 days. This is I'm ordering will hopefully become my permanent XBMC server(so my kid can finally watch disney movies on the xbox while I'm working on audio!) I also want to do some serious testing of this as an audio tool. This is the most encouranging thread I've found yet about it. I've found people reporting half working setups on the rasp pi forums.

I would also imagine if I use an external USB device that has it's own power supply I won't have to upgrade the raspberry pi power supply?

The other great question. Any word on guitarix? I would imagine this is one of the first things you tried, AutoStatic. My testing is for some friends that are looking for a small stage computer that they can run headless guitarix and maybe a headless linux sampler, to all be controlled from an onstage foot controller. I showed them Raspberry Pi, and told them I thought with some time to tweak, that it could be a low cost option for them.

Great getting started tutorial! Can't wait to try it! Will report my finds here.

Re: Raspberry Pi and music production

Posted: Thu Feb 07, 2013 5:42 am
by i2productions
Got my pi today. Still haven't gotten JACK to work via your guide, or any other, but I had my external USB interface connected once, I'm confident I'll get it. Already overclocked the little beast to 1Ghz, and what a difference it makes! Already tried the hackaday trick to turn your pi into an fm transmitter with nothing more than a 20cm piece of wire(and it's powerful too!) I've succesfully gotten it to run of the portable 2 AA battery cellphone charger I own making it truely portable. This little things has a lot of promise. I'm writing this on it now. My enclosed sound dampened mixing space is so quite without the fan noise of my audio workstation PC. I can't wait to see what this can do. If I can make it bend to my will, my intentions are to create a custom single-space audio rack mount computer! If all goes well it will have 2 XLR inputs, 4 1/4" mono inputs, 2 1/4 " mono outputs, 1 1/4" stereo headphone output, MIDI I/O, S/PDIF I/O, HDMI Out, Composite Video Out, 4 user accesible USB Ports, Ethernet, Built-in Wi-fi, and SD card slot! It seems like I can achieve this for under $200. Then I stuff it with a JACK and a few lightweight apps for audio use. It could be used as a standalone headless fx-processor. It could be used for MIDI synth, both master and slave applications. It could be used for basic 4-track at the same time recording in the studio. Million and one uses in a low cost rack mountable piece!

Re: Raspberry Pi and music production

Posted: Thu Feb 07, 2013 1:50 pm
by Alwaysanewb
I think it's awesome that you posted that on a rassberry pi. If you start building your idea make sure to post your porgress with pics. I want to see one of those bad boys in a 19u rack.

Re: Raspberry Pi and music production

Posted: Thu Feb 07, 2013 5:02 pm
by i2productions
It'll take at least a few weeks, if not a month or so. Initial tests have been encouraging. Still deciding of audio interface to couple it with in the rack case. I was originally thinking USB, it then I found some custom sound boards that can be made to communicate or the Rpi GPIO pins, and I can get up to 8in/8out for $400 for just the audio interface. So I'm exploring many options. Only a mattet of time before I figure it all out.

I will also create a custom audio studio "distro", .IMG file for the pie that I will share with the world also. Setting this thing up for production is not easy, but its so cheap that others shouldnt be denied the oppurtunity to play with something this cool, just because they're not tech savy enough. I'm going to try ARCH for ARM today, and see if its any better of a distro.(screwed the boot before I went to bed trying to overclock arch. Worked fine in Raspian, but at h doesn't like the straight 1Ghx OC.

Re: Raspberry Pi and music production

Posted: Thu Feb 07, 2013 10:05 pm
by i2productions
Still testing new and fun things. Arch for ARM I'm finding is much nicer than Raspian. Glad I got in depth with Arch a few months ago. I determined on my audio workstation that kxstudio was still a better choice in the long run that Arch was a close second as far as studio use. Now, I have to say it is boss on ARM! You still have access to the AUR! Though most packages won't install correctly. Some will install fine it you modify the pkg file during install and adding arch=('armv6h') will allow you to install some packages from AUR without issues. A fair number of fairly popular packages have already been ported in the main ARCH ARM repo. e17 with Arch is an amazing combination for the Rpi. It's lightweight, yet featurerich. After installing a few lxde packages to round the whole things out, it makes for a nice base OS. Still haven't gotten JACK to behave properly on any OS, but I can connect to my external USB audio interface, just not use any JACK apps without it crashing. Will keep reporting as the whole things comes together more. I'm compiling a build guide as I go, and will have .img files to distribute soon that will come with tweaked versions of audio production packages. It will go along with my YALS desktop ISO's, as YALS-Rpi!

Re: Raspberry Pi and music production

Posted: Fri Feb 08, 2013 2:20 am
by Alwaysanewb
does that razz pi use pulse audio?

Re: Raspberry Pi and music production

Posted: Fri Feb 08, 2013 2:59 am
by i2productions
by default in most of the OS img's yes it works by default. Or, as I've found, can be removed for just ALSA. Still haven't broken the will of JACK yet, but I finally got audio out of my USB card from an mp3 played in vlc. So, encouraging. I'm not quite sure why I'm so impressed by this piece of hardware with the processing power of an original xbox gaming console, but it seems so elegant once you get into it. The packages are still bleeding edge, rough around the edges, but it's getting there. Libre office works without a hitch, gaming emulator, and media software work. Youtube is nearly impossible as is any dream of getting flash to work correctly. Getting JACK to start and work correctly makes me feel like I'm back in 2005 when I first started using JACK and it was much more difficult to configure and get to work. 1 step at a time!

Re: Raspberry Pi and music production

Posted: Fri Feb 08, 2013 5:53 am
by tatch
i2productions wrote: I'm not quite sure why I'm so impressed by this piece of hardware with the processing power of an original xbox gaming console, but it seems so elegant once you get into it.!
Probably because it runs linux ;) and being that small has got to be neat. Rpi seems real fun, I will almost certainly nab one eventually.

Re: Raspberry Pi and music production

Posted: Fri Feb 08, 2013 6:04 am
by i2productions
Just found another piece that should fit snugly into the 19" 1 RU specification for a front panel display. Use this onstage for very basic setup functions and last minute tweaks without a real monitor. It wouldn't ever need to be totally headless! Wouldn't add much cost to the unit either!

http://www.adafruit.com/products/910

Re: Raspberry Pi and music production

Posted: Fri Feb 08, 2013 6:44 pm
by hinekyle
I am attempting to get Raspberry Pi (RPI) to receive audio in the form of dual XLR inputs. So far the only solution is to use an external usb audio mixer. Is there any way to utilize GPIO to add XLR or RCA inputs?

Re: Raspberry Pi and music production

Posted: Sat Feb 09, 2013 10:21 am
by i2productions
In theory yes. Someone on another message board had an idea and even had a d/a a/d board recommendation. I'll see if I can find the post again tommorow and post the link. But in theory it is possible. I mean I was able to broadcast fm radio over GPIO 4 with only 20 cm of wire and a simple python script. Many things are possible on this little beast!

Re: Raspberry Pi and music production

Posted: Sat Feb 09, 2013 12:01 pm
by steevc
Here's a Pi running Pure Data being used for guitar effects. He's got a cool Arduino-based control system

http://guitarextended.wordpress.com/201 ... d-arduino/

Re: Raspberry Pi and music production

Posted: Sat Feb 09, 2013 6:16 pm
by i2productions
I've seen it. Nice setup, but pure data doesn't.really interest me. Though this guy(with a whole lot of effort) has it down!