User avatar
Wizard
Posts: 120
Joined: Sun Aug 19, 2012 4:52 am
Location: Sweden

GPU_FFT and audio processing? (Guitar FX thread)

Sat Feb 01, 2014 1:11 pm

Hellö

I've been away from the raspi scene for quite a long while now but saw something that caught my eye this morning!

I still think Raspberry Pi is an excellent platform for tinkering and has so much more to offer than just a cheapo XBMC player or as an dedicated Amiga emulator (which was one of my early projects) or even as a central car computer with touch screen interface.

Outside the world of computers I'm a pretty mean guitarist and I try to build my own rectifiers/amps and I've also played with FX.
The last few years have been good to us musicians with regards to speaker emulation and digital effects and I can now easily match my Mesa Mark IV and Fractal Audio Axe FX 2 with just a laptop, Guitar Rig 5 and some tinkering with plugins and setup. (Yes, I admit that I actually use the laptop as playback device at 90% of my time instead of the expensive rig...)

Ok, so we never got access to the DSP(s) in the Raspberry Pi which was mentioned as a "maybe" by Liz in the beginning - and this I fully understand and can live with.

I admit I haven't looked at the GPU_FFT yet and this is why I post this in order not to "fool" myself into thinking something's possible if it's not, but with regards to the "sound processing" statement in the GPU_FFT text I read - will this be powerful enough to finally turn the Raspberry Pi into a usable sound processor/emulator?
If this is the case then I think we might have access to the holy grail in music equipment!

Hardware DSP solutions (Axe FX etc) costs mega money and the laptop ones rely on Windows - which is not exactly optimal if on stage and bluescreen flonks your guitar solo...
(Yes I can build my own hardware but then I'd be alone and have no community to share/learn/progress with and I would have to spend many months before even getting something useful...)

Can someone who knows more about GPU_FFT and what I'm talking about please confirm, or deny, if this would work or not?
IF it does then I know what'll get my attention for the next months to come :)

Many thanks in advance!

ps. I'm not into amateur radio or spectral analysis and I just picked up on the "sound processing" part in the text, hence my post.
Raspberry Pi - finally a worthy replacement for A500!!!

User avatar
Wizard
Posts: 120
Joined: Sun Aug 19, 2012 4:52 am
Location: Sweden

Re: GPU_FFT and audio processing? (Guitar FX thread)

Thu Feb 13, 2014 6:50 pm

Nobody?

Perhaps I made a faulty assumption...?
Raspberry Pi - finally a worthy replacement for A500!!!

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: GPU_FFT and audio processing? (Guitar FX thread)

Fri Feb 14, 2014 1:13 pm

Hi Wizard, it's just that there seems to be limited interest in using a RPi for these kind of purposes :( Personally I have no idea about the possibilities of using the GPU for DSP purposes. The CPU itself is not ideal as it lacks the Neon instruction set but it does work for simple effects. It can even do IR convolution to a certain extent. Another bottleneck is the audio IO. The audio output of the RPi is not suited for low-latency, realtime usage. Work is being done on creating external solutions but for the moment the best option is still to use USB. But then the USB implementation of the RPi is not optimal either. Last but not least, to work around all these shortcomings is a bit of a hassle. All these things do not help the level of acceptance of using a RPi as a musical appliance.
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

Yggdrasil
Posts: 138
Joined: Sun Aug 26, 2012 8:45 pm

Re: GPU_FFT and audio processing? (Guitar FX thread)

Fri Feb 14, 2014 9:15 pm

I'm not to familar with the Audiogeneration, but probably it would be easier to kidnap a Broadcom developer and get access to the DSP capabilities of the SoC.
I does not find any information how Andrew Holme creates the shaders for the FFT-Evaluation on the GPU. It looks like handmade assembler code! Thus, it's difficult to adopt the GPU_FFT approach to a more general task. (Or I'm wrong?)

PiGraham
Posts: 3705
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: GPU_FFT and audio processing? (Guitar FX thread)

Fri Feb 14, 2014 10:34 pm

Wizard wrote:I admit I haven't looked at the GPU_FFT yet and this is why I post this in order not to "fool" myself into thinking something's possible if it's not, but with regards to the "sound processing" statement in the GPU_FFT text I read - will this be powerful enough to finally turn the Raspberry Pi into a usable sound processor/emulator?
If this is the case then I think we might have access to the holy grail in music equipment!
It depends what you want to do, but if it can be done with FFT transforms and frequency domain processing you should be able to some very interesting things with the Pi and the GPU FFT library.

I should think it is well worth researching the possibilities.

Just for other's reference, the blog post (which you have obviously read) about GPU FFT is here:
http://www.raspberrypi.org/archives/5934

hermanhermitage
Posts: 65
Joined: Sat Jul 07, 2012 11:21 pm
Location: Zero Page

Re: GPU_FFT and audio processing? (Guitar FX thread)

Sat Feb 15, 2014 4:22 am

I'm not sure about the hardware side of things (getting audio signal into and out of pi).

But in terms of access to DSP like accelerators (VPU and QPU), I think i've got a reasonable handle on developing that kind of code on the RPi (I've just uploaded a mini assembler for QPU at https://github.com/hermanhermitage/vide ... u-tutorial). My understanding is Andrew would have implemented FFT using internal Broadcom documentation as one of the news posts says he is a member of the Systems Group at Broadcom Cambridge.

I guess one approach would be to develop a web interface (over wifi) to the pi to wire and configure filters and load / save presets. The configuration would drive a little module splicing together VPU or QPU kernels.

In terms of latency, the current Raspbian API to access VPU and QPU adds about 100 microseconds (from memory) for a round trip that is a no-op. So minimal effect/filter latency will be hundreds of microseconds.

Is anyone aware of the state of play with the existing open/reference projects which implement filter and effect processing on other architectures?
(Quick google I can see TheOwl, OpenStomp, Rakarrack, pedalSHIELD, etc)

I suspect the easiest approach would be to piggy back on the source of an existing project and find a mechanism for porting/auto-translating the existing patches/filters/effects to VPU/QPU routines.

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: GPU_FFT and audio processing? (Guitar FX thread)

Mon Feb 17, 2014 1:45 pm

hermanhermitage wrote:Is anyone aware of the state of play with the existing open/reference projects which implement filter and effect processing on other architectures?
(Quick google I can see TheOwl, OpenStomp, Rakarrack, pedalSHIELD, etc)
Rakarrack runs on the RPi. Guitarix is a better option though, runs quite well too: http://guitarix.sf.net/
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

Thaddy
Posts: 174
Joined: Wed Mar 06, 2013 11:28 am

Re: GPU_FFT and audio processing? (Guitar FX thread)

Tue Feb 18, 2014 10:16 am

Yggdrasil wrote:Thus, it's difficult to adopt the GPU_FFT approach to a more general task. (Or I'm wrong?)
Well, in the context of audioprocessing you might be wrong. For example for FIR filters and convolution the GPU FFT makes you are halfway there: e.g. to add an amp characteristic or a reverb profile. Latency is not a real problem, because the most intensive calculations are the fft's. It would be nice if windowing could be done in the GPU too, but add/mul's on a typical buffer is not only doable, but plenty fast enough on the FPU. And that's what we are talking about. I am working to translate my guitar tuner code using the GPU FFT and it seems to work. My wav to midi code isn't real time by a long shot, but that is really calculation intensive, although it is based on the same principle as the guitar tuner. What I call real - time is below 25 msec over the whole chain and that is doable.
Set up is with a Creative USB card, not much connected. The USB problems arise when there are too many devices connected, because they share the hub.

As an aside: latency is more of an issue if you chain lots of audioprocessors. IIR, for example the RJB audio cookbook filters are good and almost unnoticable in terms of delay in plain FPU based code. (__FASTMATH and single)

Don't go over 44100/48000, though. 22050 gives VERY usable results. (internal chain = float 32)

Return to “Graphics, sound and multimedia”