How to reference Linux Alsa devices from Simulink

10 ビュー (過去 30 日間)
Pascal
Pascal 2025 年 6 月 25 日
移動済み: Walter Roberson 2025 年 6 月 29 日
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

回答 (1 件)

Jimmy Lapierre
Jimmy Lapierre 2025 年 6 月 26 日
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 件のコメント
Pascal
Pascal 2025 年 6 月 29 日
移動済み: Walter Roberson 2025 年 6 月 29 日
Hello Jimmy,
Yes this approach will work.
Thanks

サインインしてコメントする。

製品


リリース

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by