Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GPU audio processing

Tags:

c#

gpu

To begin with, it so happened that I am a guitarist with little programming knowledge (to be honest, I'm more interested in this than I can do anything). And so the other day I was studying the work of neural networks, which led me to research on the use of video cards for mathematical calculations. There is always some delay in programs like Guitar Rig and others. In my understanding, transforming sound using such programs is simply mathematical operations performed with sound (yes, it may be said too simply and inaccurately, but the essence, I think, is correct). And I wondered if there was no way to implement something like this, where gpu would be used for computation and not cpu? Considering that, for example, when rendering in video games, the latency on video cards is minimal, despite the fact that this is a more resource-intensive operation than audio processing.

I know there are various libraries for harnessing the power of graphics cards, but not sure if this is what I need. I found only two materials related to this in one way or another, but as I said earlier, I'm not sure if they work completely well. If you know good libraries, please share this. https://archive.codeplex.com/?p=cudafy

https://www.codeproject.com/Articles/1116907/How-to-Use-Your-GPU-in-NET

Also, I thought I would most likely try to implement this in C #.

like image 736
John Ber Avatar asked Nov 12 '20 08:11

John Ber


People also ask

Can a GPU process audio?

GPU Audio™ is a Digital Sound Processing platform that unlocks a standard GPU to handle audio production with next-gen performance capabilities. Compatible with the VST3 standard, as well as custom software, GPU Audio dramatically enhances performance by offloading processing from a computer's CPU to its GPU.

Does GPU have anything to do with audio?

The GPU has a "sound card" built in. Same idea as plugging in a USB headset - it has a built in sound device. Anything that shows up under the speaker icon in your tray is an independent sound device.

How do I use GPU audio?

From the NVIDIA Control Panel navigation tree pane, under Display, click Set up digital audio to open the associated page. The Set Up Digital Audio page lists the NVIDIA GPUs in the system that have audio-capable display connections, and then lists those connections (HDMI, DisplayPort, or DVI).


2 Answers

Sorry, going to disappoint you straight away. I have tried using NVidia CUDA (the native library) for audio processing, using neural networks. It's what my company does for a living, so we're pretty competent. We found that the typical NVidia card has too much latency. They're fast, that's not the problem, but that means they can do many million operations in a millisecond. However, the DMA engine feeding data to the card typically has latencies that are many milliseconds. Not so bad for video, bad for audio - video often is 60 Hz whereas audio can be 48000 Hz.

like image 125
MSalters Avatar answered Oct 15 '22 16:10

MSalters


I totally agree with the other answers in that GPUs will (probably) have too much much latency for online audio processing. They are designed to work on relatively large chunks of data.

For custom processing of streamed data (like your audio signals), you may want to look into dedicated hardware like DSPs or an FPGA if you really want all the customization. But then you're looking into working on hardware, rather than software - that's a rather different beast.

That being said, I've had a little experience with Alchitry's FPGA development boards and it's not quite as horrible as some people claim.

like image 43
iamnotgoodwithcomputer Avatar answered Oct 15 '22 16:10

iamnotgoodwithcomputer