From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Stream audio from pc to myrio audio out

Hello,

 

I'm trying to play a WAV file stored on my PC through the Audio Out of myRIO using the FPGA.

 

For this, I convert the wave to an array of points which I later try to stream to the FPGA VI using a DMA FIFO. There, the data is read and stored in a Block Memory from which data is taken to the Audio Output.

 

However, I can't seem to get the data fast enough, so I would need an extremely large FIFO which this device wouldn't support.

 

I hope you get the idea, I attached the project (audio.zip) so that you can understand better, and of course you can ask anything.

 

Thanks in advance for your help.

 

 

EDIT:

 

I've been doing tests for days without success, so I came up with a different idea: as writing FXP or I16 data type points to the FIFO may have a similar overhead as writing different ones (this is, it's not very different to write 1000 I16 points or 1000 I32 points), data could be converted to U16 type, then joined to form U64 points, send them via FIFO and split them in the FPGA reconverting them to I16 points which are accepted by the audio out. I also thought about writing 2 FIFOs in parallel.

 

I attach another project with this idea (pruebas.zip)

Download All
0 Kudos
Message 1 of 3
(5,416 Views)

Is there a reason you need to keep the file on the host PC?  Why not just use the FTP to move the file directly onto the myRIO and play it that way?  It honestly sounds like you're doing the exact reverse of what you'd want to use FPGA for.  FPGA should process much quicker than your host PC if programmed well.  You generally want to process blocks of data with the faster processor and extract blocks of that data with the slower process.  When you're doing the heavy processing on the slow side, it's not a surprise the much faster side is outpacing the processing.

 

What is your goal here?  Is it to get the audio file to the myRIO?  Is it to see if you CAN send data from a host PC to the myRIO as the PC puts the data together?  I'd imagine you COULD use a Single Cycle Timed Loop on your FPGA set to run at a very slow rate to perform this.  But, I'm not sure why you would.

0 Kudos
Message 2 of 3
(5,399 Views)

Hi natasftw,

 

Thanks for your answer. I considered uploading files to myRIO but they are too large for its memory, thaths why I'm trying to open the files on the PC then stream the data to myRIO using the FIFO and memory blocks as a buffer.

 

I'm quite new to FPGA programming but I have already used it for projects similar to the one you mention. However, this time I wanted to use it the other way.

 

Sorry if i didn't explain my idea well. My goal is to use myRIO module as a remote audio player, eventually using it via Wifi connection.

It could even be expanded to stream audio out from the pc to myRIO, but that's not what I'm trying to do now, only wav files by the moment.

 

Thanks you again.

0 Kudos
Message 3 of 3
(5,393 Views)