Raspberry Pi and music production

Discussion of all things Raspberry Pi / Raspberry Pi 2 related

Moderators: MattKingUSA, khz

hinekyle
Posts: 2
Joined: Thu Feb 07, 2013 4:29 pm

Re: Raspberry Pi and music production

Post by hinekyle »

i2productions, did you find that post with the "d/a a/d board recommendation"?
i2productions
Established Member
Posts: 544
Joined: Sun May 22, 2011 6:14 pm
Location: New Hampshire, US
Been thanked: 1 time

Re: Raspberry Pi and music production

Post by i2productions »

I'll start compiling a list of useful links that I'm going through myself in my project. These links are either to commercial expansion boards. Or forum posts from around the net(most from rpi forums) that describe trials and tribulations with using the Raspberry pi for audio purposes. I'll edit and update with relevant posts.

----------->http://wiki.linuxaudio.org/wiki/raspberrypi<----------- Tutorial with working JACK binaries for Rpi

http://www.raspberrypi.org/phpBB3/viewt ... 38&t=30777
http://www.abelectronics.co.uk/default.aspx
http://www.raspberrypi.org/phpBB3/viewt ... 38&t=31806
http://www.raspberrypi.org/phpBB3/viewt ... 38&t=28774
Last edited by i2productions on Tue Feb 12, 2013 11:36 pm, edited 1 time in total.
i2productions
Established Member
Posts: 544
Joined: Sun May 22, 2011 6:14 pm
Location: New Hampshire, US
Been thanked: 1 time

Re: Raspberry Pi and music production

Post by i2productions »

The Raspberry Pi is finally coming alive! You can thank AutoStatic, the man that started this thread, for finally within the last 24 hours packaging a VERY NICE install of JACK. You will find all the instructions in the post just above this one with all the links, it's the first link! Now, I'm still not 100% there as far as things working correctly, but JACK starts with my USB audio interface now, and I can start guitarix, patchage, ardour, and hydrogen at the same time(with nothing actually loaded.) And it seems pretty snappy on an Rpi overclocked to 1Ghz. VERY encouraging results tonight. It's bed time for me, but I finally feel like tommorow is the day I break this little thing! What I have tested is running hydrogen out into guitarix and then to the system outs(connected via patchage.) Before I even plugged it into guitarix though the sound was distorted and low. So I've still got some issues, but I HAVE JACK MAKING NOISE ON Rpi!

Edit:With playback only selected, this thing is running with jack at 128 buffer, and 44100 sample rate, I've got hydrogen and guitarix working correctly with JACK now. Encouraging. It is very late at night, need sleep, but want to keep tweaking this thing!
Alwaysanewb
Established Member
Posts: 232
Joined: Sat Oct 13, 2012 9:04 pm

Re: Raspberry Pi and music production

Post by Alwaysanewb »

That's awesome jacks on rassberry pi now. Hope to get one sooner or later.
i2productions
Established Member
Posts: 544
Joined: Sun May 22, 2011 6:14 pm
Location: New Hampshire, US
Been thanked: 1 time

Re: Raspberry Pi and music production

Post by i2productions »

Still no full duplex. But I'm very surprised by the amount of processing this thing can do in capture/playback only. I captured 4 simultaneous inputs of analog audio for 1 minute(just hooked up 2 mp3 players for the test and played random tracks.) Didn't get any xruns at 44100, 1024 buffer size. Eventhough no xruns were displayed I did notice digital noise added to the recording anytime I clicked on anything in the system. Which isn't a huge problem, since when you're capturing, you usually don't touch the keyboard/mouse anyway. The other surprising things is the DAW I used for capturing. Ardour 2.8.14! WIth it loaded, and JACK started my system is at 105 megs of loaded RAM. With 512 on board that's still plenty for processing. While capturing the 4 streams of audio the CPU load never got above 50%. On playback of the 4 streams with no processing, CPU never went above 60%. After custom building JACK1, I was able to just download all the other audio software right from the Raspian repos. So far I've tested qjackctl, Ardour, guitarix, hydrogen, patchage, and yoshimi. I have also downloaded all the lv2 and LADSPA plugins I can find in the stock repo(but haven't given them proper testing yet.) Next step after figuring out full-duplex will be to attempt a port of Carla from KXStudio. If this thing had a good easy to use rack, it could do a lot! WIll keep playing and reporting!
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: ¿What programs work decently?

Post by autostatic »

gazpacho wrote: ¿How far can it go in performance, what can be expected?
Don't expect too much ;) We're talking about a device that runs at 1GHz when overclocked with components that are not made for real-time, low-latency audio work. Also some of the components have issues and the fact that most of the components are proprietary doesn't help fixing these issues. But I can get as low as < 3ms and still have headroom to start a JACK client.
gazpacho wrote: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.
Full duplex should work if you disable turbo mode for the nic (or disable the nic altogether) and for my audio interface I had to set the USB speed to high speed (USB1.1) and the interface itself in class compliant mode.
gazpacho wrote:Also there is the question of the need of a low latency kernel, or even a real time one.
The RPi has a PREEMPT low-latency kernel that so far cuts it for me (at least it's PREEMPT on Raspbian).
gazpacho wrote:¿Is it true that no real time kernel is possible due to the lack of a clock on the pi?
No. Afaik there isn't any real-time kernel because of issues with the MMC drivers, or even at a lower level, issues with the USB drivers. You can patch the kernel source just fine and compile it but it won't boot because of these issues. I'd really like to use a RT kernel on the RPi, I think this will allow you to squeeze the most out of the RPi.
i2productions
Established Member
Posts: 544
Joined: Sun May 22, 2011 6:14 pm
Location: New Hampshire, US
Been thanked: 1 time

Re: Raspberry Pi and music production

Post by i2productions »

AutoStatic wrote:gazpacho wrote:
¿How far can it go in performance, what can be expected?
Don't expect too much We're talking about a device that runs at 1GHz when overclocked with components that are not made for real-time, low-latency audio work. Also some of the components have issues and the fact that most of the components are proprietary doesn't help fixing these issues. But I can get as low as < 3ms and still have headroom to start a JACK client.
Still haven't gotten full duplex(may not be easy or possible with this USB interface though it works 100% in every x86 and x64 linux systems I've tested.) So I still don't know what that will do for slowing down the system further. But, everything AutoStatic says is true. If used correctly though, it is very capable. If you try to do anything with the system(even clicking on ANYTHING) while audio is passing through, it slows down the system just enough to produce something worse than an xrun. It usually doesn't incur a buffer underrun and report an xrun, but you will get a noticable digital line "pop"(I also wonder if running headless without X would eliminate this.) But, if you just set up your audio tool chain and leave the thing alone to do whatever it is you want to do, it's very capable of doing low-latency audio processing of all types. You just have to be aware of the limitations, to take advantage of a $35 piece of hardware.
i2productions
Established Member
Posts: 544
Joined: Sun May 22, 2011 6:14 pm
Location: New Hampshire, US
Been thanked: 1 time

Re: Raspberry Pi and music production

Post by i2productions »

FINALLY got full duplex working. First off, I did a fresh SD install of latest raspian again to test out JACK2(been testing JACK1 before.) AutoStatic's binary of JACK2 seems to work just as well as the JACK1 version I've been testing for a few days. The Lexicon Omega has 4 analog ins(simultaneous) and 2 analog outs(simultaneous). With normal linux I'm used to just choosing an interface and starting JACK. I tried setting recognized ins to '2' and outs to '2' and it fired up(though I had to totally disable the ethernet, removing turbo ethernet was not enough.) Capture only of 4 ins works just fine as well. So, this seems to be a casualty of the poor USB bus on the card. But 2in/2out duplex is just fine for the project I'm building. All this means is I can go with a less expensive USB audio device!
i2productions
Established Member
Posts: 544
Joined: Sun May 22, 2011 6:14 pm
Location: New Hampshire, US
Been thanked: 1 time

Re: Raspberry Pi and music production

Post by i2productions »

Yesterday I thought everything was going my way, I had things working, and did some basic tests. But now today, for some reason I can't get JACK to start reliably. I have done fresh installs of raspbian and started over, and the problem continues. Sometimes I do get it to work in Playback only, but maybe 1 in every 5 times I try to start JACK. Now, the most common error I'm getting is "cannot load driver module alsa" This isn't good. I know the interface is working fine, because I've tested it since on my main computer with no issues. I'm starting to wonder if I've done something very bad to the hardware with all the overclocking and pushing the USB bus. Time will tell. I'm going to get a powered USB hub today and test some more.
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: Raspberry Pi and music production

Post by autostatic »

I've had this error too. Most of the time the following does the trick:

Code: Select all

sudo alsa force-reload
If that doesn't work I reboot the RPi and then it almost always works again.
i2productions
Established Member
Posts: 544
Joined: Sun May 22, 2011 6:14 pm
Location: New Hampshire, US
Been thanked: 1 time

Re: Raspberry Pi and music production

Post by i2productions »

I'm talking about right after a reboot. Glad to know it's not just me. I'm hoping the powered USB hub will help in some way. Also curious whether or not the new 256 pi with no ethernet would be slightly better suited for audio work(though the loss of the ram sucks.)
i2productions
Established Member
Posts: 544
Joined: Sun May 22, 2011 6:14 pm
Location: New Hampshire, US
Been thanked: 1 time

Re: Raspberry Pi and music production

Post by i2productions »

Discovered 1 simple piece of syntax in the /boot/cmdline.txt that I was doing wrong. The first few times I tried JACK, I had added the ethernet turbo disable and USB 1.1 force on seperate lines after the first, and this is apparently the correct way. I had tried putting these commands on the first line with all the other stuff, but it is a great deal of what's caused me so much trouble today. I think it may also have to do with why I can't get ALSA to work properly on Arch. Arch ARM already includes the smsc95xx.turbo_mode=N, but it's first in the configuration. Now that I know it's part of the problem in Debian I will bump it down to it's own line and see if this makes a difference. Back on track with playback and capture only working the way they were before. And full-duplex does load, but still needs a lot of tweaking.
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: Raspberry Pi and music production

Post by autostatic »

i2productions wrote:Discovered 1 simple piece of syntax in the /boot/cmdline.txt that I was doing wrong. The first few times I tried JACK, I had added the ethernet turbo disable and USB 1.1 force on seperate lines after the first, and this is apparently the correct way.
Afaik the kernel options should be on a single line, any other line will be discarded.
i2productions wrote:I had tried putting these commands on the first line with all the other stuff, but it is a great deal of what's caused me so much trouble today. I think it may also have to do with why I can't get ALSA to work properly on Arch. Arch ARM already includes the smsc95xx.turbo_mode=N, but it's first in the configuration. Now that I know it's part of the problem in Debian I will bump it down to it's own line and see if this makes a difference.
Bumping it down will probably result in the parameter not being read. You can also try creating specific conf files in /etc/modprobe.d for each module you want to control: http://elinux.org/RPi_Peripherals#Notes
It should also be possible to do this for the kernel module of the USB host controller.
i2productions
Established Member
Posts: 544
Joined: Sun May 22, 2011 6:14 pm
Location: New Hampshire, US
Been thanked: 1 time

Re: Raspberry Pi and music production

Post by i2productions »

Very interesting. So then if they're not working(eitherat begining or end)then are they actually doing anything useful? JACK won't start with Turbo ethernet disabled on the first line, and also won't start unless I kill the driver. Definitely don't know whether forcing USB 1.1 is doing anything either. Will do some more testing then. I'm really starting to believe I'm wasting my time with the pi. Everytime I solve one audio related problem, more show themselves. This really might not be a platform for any form of audio processing, but I'm not giving up yet.
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: Raspberry Pi and music production

Post by autostatic »

i2productions wrote:So then if they're not working(eitherat begining or end)then are they actually doing anything useful?
I think don't get your question. Afaik the kernel parameters should be on one single line, any supplementary lines will not be read. The order does not matter.
Post Reply