How to reference Linux Alsa devices from Simulink

조회 수: 4 (최근 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