Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

DAX Audio discovery

Paul RN3A
Paul RN3A Member
edited February 2017 in SmartSDR API
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:ROOTMEDIA001
DMABufferSize:
ErrorCleared:
ErrorDescription:
InstallDate:
LastErrorCode:
Manufacturer:FlexRadio Systems
MPU401Address:
Name:DAX RX Audio
PNPDeviceID:ROOTMEDIA001
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!


Answers

  • Eric-KE5DTO
    Eric-KE5DTO Administrator, FlexRadio Employee admin
    edited February 2017
    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.
  • K9DUR
    K9DUR Member ✭✭
    edited January 2017

    Paul,

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

    73, Ray, K9DUR

  • Paul RN3A
    Paul RN3A Member
    edited May 2014
    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!  
  • Eric-KE5DTO
    Eric-KE5DTO Administrator, FlexRadio Employee admin
    edited February 2017
    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.
  • Paul RN3A
    Paul RN3A Member
    edited May 2014
    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?


  • Eric-KE5DTO
    Eric-KE5DTO Administrator, FlexRadio Employee admin
    edited February 2017
    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.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.