why audioDeviceWriter doesn't list my output device?

59 views (last 30 days)
Gilberto
Gilberto on 23 Jan 2026 at 20:19
Commented: Jimmy Lapierre on 4 Feb 2026 at 19:58
Hello MATLAB comunity,
I’m trying to send audio over a USB Audio Class 2.0 (UAC2) implementation that enables the EV‑SC594‑EZKIT from ADI. The USB UAC2 device supports 16 inputs / 16 outputs at 16‑bit. MATLAB's audioDeviceReader lists the device and I can capture the audio properly:
>> deviceReader = audioDeviceReader(Driver="DirectSound"); InDevices=getAudioDevices(deviceReader)
InDevices =
1×4 cell array
{'Default'} {'Primary Sound Capture Driver'} {'Microphone Array on Monitor (2- Intel® Smart Sound Techno…'} {'Microphone (EV-SC594 (16x16x16bit))'}
However the audioDeviceWritter does not show the device:
>> deviceWritter = audioDeviceWriter(Driver="DirectSound"); OutDevices=getAudioDevices(deviceWritter)
OutDevices =
1×4 cell array
{'Default'} {'Primary Sound Driver'} {'Altavoces Laptop (2- Realtek(R) Audio)'} {'Altavoces (office)'}
In Windows, the playback device is listed correctly, and I can run the Test on Sound Playback window confirming each of the 16 streams in the EV‑SC594‑EZKIT and also using audioDeviceReader in simulink.
The output device is listed as 'WASAPI'
>> deviceWritter = audioDeviceWriter(Driver="WASAPI"); OutDevices=getAudioDevices(deviceWritter)
OutDevices =
1×4 cell array
{'Default'} {'SC594 (EV-SC594 (16x16x16bit))'} {'Altavoces Laptop (2- Realtek(R) Audio)'} {'Altavoces (office)'}
But I am having next error:
Error:Error in 'AudioAnalyzerSL/Audio Device
Writer': PortAudio Error: Invalid sample rate
Is there any way I can use MATLAB or SIMULINK to send audio to that USB Audio Class 2.0 port?
Thanks,
Gilberto
  2 Comments
dpb
dpb on 25 Jan 2026 at 14:19
Submit this to Mathworks as an official support request/bug at <Product Support Page>
Gilberto
Gilberto on 27 Jan 2026 at 0:43
Hello @dpb, I just created a bug with the link you shared.
Thanks for the suggestion
Gilberto

Sign in to comment.

Answers (2)

Jimmy Lapierre
Jimmy Lapierre on 28 Jan 2026 at 0:41
If you use audioDeviceWriter with WASAPI, it is always in exclusive mode, so the sample rate and bit depth you specify in audioDeviceWriter must match the setting in the Windows Sound Properties. If there is an option to allow exclusive mode in Windows, make sure it is checked.
There is also a newer audio I/O object called audiostreamer. Try listing your devices in a table like this.
>> struct2table(audiostreamer.getAudioDevices)
The audiostreamer allows you to turn off exclusive mode, which may allow you to use any sample rate or bit depth. You could also specify 16-bit explicitely (might be necessary in exclusive mode if your device is 16-bit). You can also set the Player property to your device name and specify SampleRate. Here this would just play through the default Windows device:
>> as = audiostreamer(Driver="WASAPI",ExclusiveMode=false,DeviceBitFormat="int16")
>> play(as,pinknoise(44100,2)) % try 1 second of pink noise
  4 Comments
Gilberto
Gilberto on 4 Feb 2026 at 19:25
Yes, I created the object with the right device:
as = audiostreamer(Driver="WASAPI",ExclusiveMode=false,DeviceBitFormat="int16", Player="SC594 (EV-SC594 (16x16x16bit))")
And could send Pink Noise to the 16 inputs in the ADI EZKIT using audiostreamer
play(as,pinknoise(44100*5,16))
Jimmy Lapierre
Jimmy Lapierre on 4 Feb 2026 at 19:58
I just wanted to explain the reason for the previous error. Let me know if you still have any issues.

Sign in to comment.


Will
Will on 27 Jan 2026 at 14:34
Hi Gilberto,
The issue might be due to the supported maximum sample rate. You can go through the below MATLAB answer to find out about this -

Categories

Find more on Multichannel Audio Input and Output in Help Center and File Exchange

Products


Release

R2025b

Community Treasure Hunt

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

Start Hunting!