DAX Audio discovery

  • 1
  • Question
  • Updated 5 years ago
Hi guys, I've got a rookie's question, still can't figure it out. Can you please help.

DAX RX, DAX TX and DAX IQ appear to be 3 different sound cards in the system. This is how it looks in Device Manager. So when I run this code to discover Audio devices:

ManagementObjectSearcher objSearcher = new ManagementObjectSearcher( "SELECT *                                                                                                             FROM Win32_SoundDevice");
ManagementObjectCollection objCollection = objSearcher.Get();

I get a list of available sound devices in the system. Something like this:

Availability:Caption:DAX RX Audio
ConfigManagerErrorCode:0
ConfigManagerUserConfig:False
CreationClassName:Win32_SoundDevice
Description:DAX RX Audio
DeviceID:ROOT\MEDIA\0001
DMABufferSize:
ErrorCleared:
ErrorDescription:
InstallDate:
LastErrorCode:
Manufacturer:FlexRadio Systems
MPU401Address:
Name:DAX RX Audio
PNPDeviceID:ROOT\MEDIA\0001
PowerManagementCapabilities:
PowerManagementSupported:False
ProductName:DAX RX Audio
Status:OK
StatusInfo:3
SystemCreationClassName:Win32_ComputerSystem
SystemName:RADIOSHACK

The next obvious step will be to address the device using Win32 API. So I am getting hWnd with 

 IntPtr hWnd = this.Handle;

And I am listening to the messages with this:

[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]       
protected override void WndProc(ref Message m) { ..... }

The problem which I have is that I am getting a bunch of different messages, but non of them I can identify as Messages from DAX Audio. 

So my question is - is there any other way to find, identify and address DAX sound devices, or Win32 API is the only way? If so, what do I need to do to start getting audio stream for DAX RX?

Thanks a bunch in advance!


Photo of Paul RN3A

Paul RN3A

  • 56 Posts
  • 6 Reply Likes

Posted 5 years ago

  • 1
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 840 Posts
  • 300 Reply Likes
Paul,

I've never used Win32 for audio stuff, so I'm probably not going to be much help here.  We usually use a proven library such as Portaudio to abstract much of these details for the application developer.

If we weren't using such a library, we would probably go straight to whatever host protocol we wanted to use (MME, DirectSound, ASIO, WDM-KS, ALSA, etc) and access the audio through that API.
Photo of Ray Andrews, K9DUR

Ray Andrews, K9DUR, Elmer

  • 248 Posts
  • 63 Reply Likes

Paul,

My VoiceKeyer program uses DirectSound (a component of DirectX) to enumerate & communicate with the audio devices.

73, Ray, K9DUR

Photo of Paul RN3A

Paul RN3A

  • 56 Posts
  • 6 Reply Likes
Eric and Ray, thank you for the comments. All mentioned libraries allow access to sound devices, but just in different ways? Can you please give any code snippets, just for the starting point - find and enumerate devices, select channels, etc?
Thanks a lot in advance!  
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 840 Posts
  • 300 Reply Likes
Portaudio (www.portaudio.com) has many open source examples along with good documentation.  There is also a project called PortaudioSharp that is a C# wrapper for portaudio that may be useful.

The other hosts all have their own documentation.  MSDN has docs on DirectSound, MME, and WDM-KS.  Google is your friend here.
Photo of Paul RN3A

Paul RN3A

  • 56 Posts
  • 6 Reply Likes
Eric, thank you. Portaudio resources are indeed very helpful. So I've put together a small code in C# to Marshal all functions and got enumeration of all audio devices I've got on my local PC. After I've got the results, I feel more than confused. There are 176 total devices listed.  Here is the listing for DAX RX 1 only:

PortAudio version number 1899
PortAudio version text PortAudio V19-devel (built May  7 2014 11:28:36)
Number of devices = 176

Device ------------ 11
Name                DAX Audio RX 1 (DAX RX Audio)
Max Input Channels  32
Max output Channels 0
Default Sample Rate 44100
Input High Latency  0,18
Input Low Latency   0,09
Output High Latency 0,18
Output Low Latency  0,09
Host API            0
Struct Version      2

Device ------------ 38
Name                DAX RESERVED AUDIO RX 1 (DAX RX
Max Input Channels  0
Max output Channels 32
Default Sample Rate 44100
Input High Latency  0,18
Input Low Latency   0,09
Output High Latency 0,18
Output Low Latency  0,09
Host API            0
Struct Version      2

Device ------------ 56
Name                DAX Audio RX 1 (DAX RX Audio)
Max Input Channels  32
Max output Channels 0
Default Sample Rate 44100
Input High Latency  0,24
Input Low Latency   0,12
Output High Latency 0
Output Low Latency  0
Host API            1
Struct Version      2

Device ------------ 83
Name                DAX RESERVED AUDIO RX 1 (DAX RX Audio)
Max Input Channels  0
Max output Channels 32
Default Sample Rate 44100
Input High Latency  0
Input Low Latency   0
Output High Latency 0,24
Output Low Latency  0,12
Host API            1
Struct Version      2

Device ------------ 105
Name                DAX RESERVED AUDIO RX 1 (DAX RX Audio)
Max Input Channels  0
Max output Channels 2
Default Sample Rate 48000
Input High Latency  0
Input Low Latency   0
Output High Latency 0,01
Output Low Latency  0,003
Host API            3
Struct Version      2

Device ------------ 121
Name                DAX Audio RX 1 (DAX RX Audio)
Max Input Channels  2
Max output Channels 0
Default Sample Rate 48000
Input High Latency  0,01
Input Low Latency   0,003
Output High Latency 0
Output Low Latency  0
Host API            3
Struct Version      2

Device ------------ 143
Name                DAX Audio RX 1 (DAX Audio RX 1)
Max Input Channels  32
Max output Channels 0
Default Sample Rate 44100
Input High Latency  0,0853333333333333
Input Low Latency   0,01
Output High Latency 0,0853333333333333
Output Low Latency  0,01
Host API            4
Struct Version      2

Device ------------ 144
Name                Line Out (DAX Audio RX 1)
Max Input Channels  0
Max output Channels 32
Default Sample Rate 44100
Input High Latency  0,0853333333333333
Input Low Latency   0,01
Output High Latency 0,0853333333333333
Output Low Latency  0,01
Host API            4
Struct Version      2

There are 8 devices with the same name, but with some varainces. Which is which? 

DAX RX channels are used to receive audio steam from radio. However, I see output channels as well. Do these create pairs, like input <-> ouput, or something? What are the RESERVED devices?

At the end of the say I would like to start receiving audio in both DAX RX and DAX IQ RX for further processing. Can you please give a bit more on DAX and DAX IQ audio?


Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 840 Posts
  • 300 Reply Likes
I think you are seeing the same device listed on various hosts (MME, DirectSound, etc).  The reserved channels are used by the DAX client itself.  The other channels are for the 3rd party client to connect with.

Note that if you are using the API AudioStream IQStream objects, you don't need to interface with the DAX audio channels.  They are only there to provide a bridge to 3rd party applications which are looking for a sound card interface.  If you are building the interface, there are a good number of reasons to go directly to the radio via the API and bypass all of the sound card issues.