How to reference Linux Alsa devices from Simulink

10 vues (au cours des 30 derniers jours)
Pascal
Pascal le 25 Juin 2025
Hello,
I have a simulink app that works quite well on my Windows machine. It takes some audio from the mic and process it.
I now want to port this code to a generic embedded board running Linux. I will have to get the audio from the Alsa device (/dev/hwxxx). I know how to do that in plain C code, but what is the right way to do it in simulink.
I configure my simulink model with ert.tlc and Embedded Coder Linux Docker but my simulink model is still showing Windows devices in the Audio Input Reader (Directsound, wasapi, asio). Is there a generic Alsa reader/writer somewhere. I am quite familiar with Alsa and I could write a component if I have to, but how do I get started? I am sure I am not the first one trying to do this, but I could not google a good solution.
Thanks

Réponses (1)

Jimmy Lapierre
Jimmy Lapierre le 26 Juin 2025
Hi Pascal, I asked a collegue about this and here's his answer:
If the embedded Linux is running on Intel and AMD x86 processors then you can use the browser and download/install MATLAB/Simulink through our website. If the processor is an ARM core then the best way would be to use a PC that has Matlab already installed and cross-compile your code for the board. First install a hardware support package for the board that you are using (in MATLAB, HOME->Add-Ons->”Get Hardware Support package” ). Here is an example that uses the Raspberry Pi board: https://www.mathworks.com/help/simulink/supportpkg/raspberrypi_ref/get-started-with-audio-signal-processing-using-raspberry-pi.html
A lot of the Linux embedded boards using ARM core are supported. If the exact board that you have is not found in the support package then you can find one that is closest to it.
  1 commentaire
Pascal
Pascal le 29 Juin 2025
Déplacé(e) : Walter Roberson le 29 Juin 2025
Hello Jimmy,
Yes this approach will work.
Thanks

Connectez-vous pour commenter.

Produits


Version

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by