I’m trying to figure out how I could generate sound from a C++ program in a container, running in Torizon. What devices should be forwarded? What library should be used? I’m still very new to Linux and software development for Linux. Any help is greatly appreciated! The hardware I’m using is a Verdin iMX8MM DL 1GB with a Verdin Development Board.
I got audio working pretty fast, based on the sample you’ve written. Now, I’m using a library that provides audio samples, but I think the samples are coming in to slow. There’s a slight hickup. I see snd_pcm_writei is used to send the samples to alsa, but is this the function I need to use when I don’t know up front how much samples will be generated?
Unfortunately I do not have a deep knowledge about Alsa usage/use cases. Maybe the folloing Stack Overflow question can help you, as the answers list several links with Alsa tutorials and sample projects.