McGuireV10
McGuireV10

Reputation: 9946

Identify OpenAL default playback device name

In OpenAL (or OpenAL Soft) is it possible to get the name of the default playback device?

I wrote a simple program to dump the driver and device names on my system, which yields the lists below. OpenAL refers to all of these as "devices", which I think is a little confusing since some are clearly drivers, so that labeling decision is mine.

Drivers:
  OpenAL Soft
  Generic Software

Default driver:
  Generic Software
  (Opening "OpenAL Soft" instead)

Playback devices:
  OpenAL Soft on CABLE Input (VB-Audio Virtual Cable)
  OpenAL Soft on Speakers (High Definition Audio Device)
  Generic Software on CABLE Input (VB-Audio Virtual Cable)
  Generic Software on Speakers (High Definition Audio Device)

Capture devices:
  OpenAL Soft on CABLE Output (VB-Audio Virtual Cable)
  OpenAL Soft on SPDIF Interface (UR23 USB SPDIF Rx)
  CABLE Output (VB-Audio Virtual
  SPDIF Interface (UR23 USB SPDIF

Default capture device:
  CABLE Output (VB-Audio Virtual

You can see at the end that I can get the default capture device name via this call (I'm using OpenTK, but it's just a thin wrapper around OpenAL):

ALC.GetString(ALDevice.Null, AlcGetString.CaptureDefaultDeviceSpecifier)

Although AlcGetString.DefaultDeviceSpecifier appears to be the playback equivalent, it actually returns what I'm calling the driver (Generic Software). I can't figure out how to get the default from the "Playback devices" list in my output above (which in my case is "OpenAL Soft on CABLE" ... a loopback driver).

Upvotes: 0

Views: 585

Answers (1)

McGuireV10
McGuireV10

Reputation: 9946

I realized the "info" utility which ships with the OpenAL Soft driver does correctly list this value. The source show's it's an extension constant, which is also available through the OpenTK wrapper.

alcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER));

Upvotes: 0

Related Questions