MonsterMadnessMusic
Posts: 38
Joined: Mon Apr 25, 2016 6:28 am

A debate on audio production on the Pi 3 (and other Pis)

Sat Apr 30, 2016 11:09 am

Hello friends, strangers and foes (whatever group you count yourself in),

I would like to do some (hobby level) audio production on my Pi 3 B. I got ardour running so far but there are some minor issues remaining. What did I do so far?

+ Compiled the 4.4.8+ kernel with low-latency-desktop option and 1 kHz timer

Why? I want Jack to run in realtime mode, and while the standard kernel seems to already support this in some way (is this actually true?), I wanted to have the option for lower latencies. The magic word here seems to be Kernel Preempting.

+ raised /proc/sys/vm/dirty_expire_centisecs, dirty_writeback_centisecs to increase the amount of time that data remains in the disk cache
+ raised dirty_background_ratio to keep more data in the disk cache

Why? Ardour was complaining about my file system being to slow, now it can work in the cache directly. I could (up to now) record four tracks to the SD Card simultaneously that way, but now I also connected an USB HDD to spare the little fellow the data traffic.
Four tracks is a little out of my requirements though, two should be enough.

+ Experimented with some values for jackd until I found good working ones.

Why? Jack was reporting XRUNS or relatively high latencies until I fiddled with the command line parameters a little. Sampling rates, periods, number of bits per sample ...

+ Connected my USB microphone to an USB HUB and used dwc_otg.fiq_fsm_mask=0xF in cmdline.txt.

Why? This got rid of an annoying error (about FIQ reporting NYET on my microphone, whatever that means) which flooded my /var/log/messages. I also stopped the usbhid module from claiming the mic with usbhid.quirks=0x0909:0x001c:0x4 in cmdline.txt. This is the USB vendor/device id which lsusb reports followed by 0x4, wich in my interpretation probably means 'don't claim'.

+ Setting my CPU frequency governors to 'performance', following this guide:
http://wiki.linuxaudio.org/wiki/raspberrypi

I also disabled the eth0 turbo mode. However, I could not stop most of the demons mentioned because I want to work with an desktop (for ardour and friends).

Do these deeds make sense? Do you have any other tips or tricks? How did you configure your system?

A remaining problem is that my guitar amplifier (a Fender Mustang I) can only be used as a capture device under Jack. I can use alsa_out to send the output to another device, but I suddenly get lots of XRUNS then. Also I could configure the amplifier for capture with jack and another device for output (monitoring), but I was warned the devices will not be in sync. Do you have any experience with this?

Cheers! :) :? (guitar face)

PS: Why do this at all? Imagine sitting in the living room with your guitar/mic and being able to record songs on your TV without any background noise from PC fan etc. I like this idea very much, at least for recording demos/ideas!

Goraxium
Posts: 122
Joined: Tue Jan 26, 2016 1:42 pm

Re: A debate on audio production on the Pi 3 (and other Pis)

Sun May 01, 2016 11:52 am

The biggest issue I've encountered was trying to run my guitar cable (Rocksmith cable) and / or my USB sound card through a USB hub. It gave me all sorts of problems (particularly the buffer problems you mentioned, but also audio lag), and they all went away when I plugged them both directly into my Pi2. I don't use a real time kernel, but I'm no audiophile, and given my oddly shaped fingers, can't play a guitar well enough for it to really matter. I do, however, like thumping away on my bass (but even then, I don't make much in the way of pleasant music).

MonsterMadnessMusic
Posts: 38
Joined: Mon Apr 25, 2016 6:28 am

Re: A debate on audio production on the Pi 3 (and other Pis)

Sun May 01, 2016 1:57 pm

Thanks for your reply! Yes, connecting the Pi with guitars can be tricky. I also have a Line6 UX1 lying around, but the driver seems to be broken. While it works nicely on my laptop under Debian, this interface completely hangs the Pi 3 during playback occassionally. And I do not really have the time to dive into kernel module debugging ... so probably the UX1 will have to stay away from the Pi for now. My idea is there are at least two things to be considered when connecting a device via USB hub;

+ the influence it has on the transferred data (for example, an USB 1.1 hub would slow down a high-speed device designed for USB 2.0 or higher)
+ the 'logistical' work it takes away from the kernel/Pi hardware which has to deal with all the traffic the devices which are directly connected send into the Pi 3 to basically state they are still connected.

and of course all the things I forgot, I do not really have a deep understanding of the USB protocol.

If you use a real time kernel or not, reducing latency is a good idea if you are like me and do not want the hardware to add its own lags to already questionable (musical) timing. :D With jackd I went under under 4 ms of latency with the right settings. But now I am curious: Is the rocksmith cable a 'serious' device for recording? I mean can you create nice sounds with it? I heard the Rock Band keytar is better than you (or me) would probably think at first:

http://createdigitalmusic.com/2010/10/h ... -keyboard/

Cheers! 8-)

Goraxium
Posts: 122
Joined: Tue Jan 26, 2016 1:42 pm

Re: A debate on audio production on the Pi 3 (and other Pis)

Mon May 02, 2016 12:51 am

I was using a USB 2.0 hub, so you'd think it would have been sufficient, given that my keyboard, mouse and relatively inactive wifi dongle were all that I had attached. I don't know enough about it to be able to understand the issues though.

As for the sound quality, check out this video at the 2:30 mark, when somebody who knows how to play a guitar well, uses the Rocksmith cable:
https://youtu.be/1ZmYtLzbT8o

pdasilva18
Posts: 1
Joined: Wed Aug 24, 2016 4:11 pm

Re: A debate on audio production on the Pi 3 (and other Pis)

Wed Aug 24, 2016 4:14 pm

Out of curiosity, what jackd settings did you use to get under 4ms of latency?

Return to “Advanced users”