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:
![Screenshot 2023-11-23 at 23 39 12](https://private-user-images.githubusercontent.com/65444247/285208634-8562d9ac-7bc5-494d-bdee-b5e3c20da5d9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU2ODEwOTcsIm5iZiI6MTcyNTY4MDc5NywicGF0aCI6Ii82NTQ0NDI0Ny8yODUyMDg2MzQtODU2MmQ5YWMtN2JjNS00OTRkLWJkZWUtYjVlM2MyMGRhNWQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA3VDAzNDYzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ3ZTQzZWY2YmM2M2IzYTAyM2I4NzczMTQ0MzAzNWY3M2MyYmY0NDYyYjUxMGY0M2U4ZmUxODg3MTdkZGU5ODUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.-uJdedq7_3yUdqdPQXpZejMd53AGG8CUuV6g1yBkfdY)
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.