Description: This project takes in data from an i2s microphone and streams it in real time over an ethernet connection via UDP.
Designed with 3 other team members.
Diagram Flow:
Hardware:
- Kria KV260 FPGA with ARM processor.
- ADAFruit i2s MEMs Microphone
- Ethernet Cable
Software: Xilinx Vivado 2020.1
File Structure/Navigation: This project was divided into 3 milestones.
- Milestone 1: Set up the i2s protocol in VHDL. See "i2s.vhd". Other HDL files in the root directory (e.g. FIFO) interface with i2s.vhd.
- Milestone 2: The main code for this is in the "app/src/main.c". Here, we take in the i2s data from the DMA of the processor and generate a .wav file.
- Milestone 3: In this milestone, we took in the data from the microphone and sent it over a network in real-time through UDP over ethernet. Server-side code can be found in "app_m4/src/main.c" and client-side code can be found in "app_m4/UDP_client_write.c". All other files are to implement these interfaces.
Our Kria FPGA board acts as a server that transmits the data in real time to our computer which acting as the client, plays the file through VLC. This audio is continuously streamed in real-time, with a static delay equal to the delay between the start of the connection and the file being played on the client.
Setup:
- Connect the ethernet cable from the board to your PC.
- Turn off the firewall for both the board and the PC.
- Use ifconfig eth0 192.168.0.149 to set a static ip address for the board (192.168.0.149).
- Set up your PC's manual IP assignment to 192.168.0.212 (should work for other local IP addresses as well but we prefer the one we provided).
- Compile the code for the board - get sample256 binary for the board and run it on the kria board.
- Compile UDP_client_write.c and run it on your PC
- Send something from the client then you can receive the voice from the board!
Usage: DO THIS AFTER SETUP.
- Run sample256 binary file on the board (after you correctly configured the pins of the microphone and loaded the app of the hardware).
- Run the compiled code of UDP_client_write.c on your PC.
- After successfully combining the ports, type something on the PC's terminal.
- Now the continuous receiving will be displayed and you can now play the wavefile - VLC is suggested for playback
- To stop receiving the .wav file, just CTRL + C to terminate the execution on both the board and your PC manually.
Testing and Troubleshooting:
-
When running sample256 and it does not show "listening for incoming messages", use ping 192.168.0.212 on the board (change 192.168.0.212 to the IP address you assigned to your PC), to see if the board can print something out. If it cannot, redo the setup again and double-check the IP on the board and that the IP assignment is manual instead of DHCP.
-
When running the compile code of UDP_client_write.c, if you receive errors like "Unable to send message" OR "Error while receiving server's msg", redo the entire setup as well.
-
When running the compiled code of UDP_client_write.c, after entering something if you do not recieve "continuously receiving", redo the setup.