Gr-audio: add query device names?

It’s all well and good to send in an audio device name to the gr-audio
sink/source, and then see if that device name matches anything / works /
is found. In my fixes to gr-audio-osx, if the audio device was
specified but not found, the code will print out a list of available
device names and use the default device.

This got me thinking: Why not change the gr-audio API to include a
method that returns all known device names (output ones for sink and
input ones for source)? I can easily do it on OSX native, and Alex
Csete has a means for doing it on PortAudio; I have no idea how
difficult this would be for any other audio option, but I generally like
the idea.

What do others think? - MLD

Michael D., OSX Programmer
Ettus R. Technical Support
Email: [email protected]
Web: http://www.ettus.com

There may a problem with alsa and linux.
You can find all available cards in the file /proc/asound/cards.

But in some cases you can’t use a card directly.
For instance the Delta M44 offers 10 channels, but in many use cases you
only work with 2 channels. So you have to use plugins.

Of course, you could list the available hardware.

– Volker

Am 05.02.2014 17:43, schrieb Michael D.:

On Thu, Feb 6, 2014 at 7:33 AM, Volker S. [email protected] wrote:

There may a problem with alsa and linux.
You can find all available cards in the file /proc/asound/cards.

But in some cases you can’t use a card directly.
For instance the Delta M44 offers 10 channels, but in many use cases you
only work with 2 channels. So you have to use plugins.

Of course, you could list the available hardware.

Hi Volker,

The idea is to enumerate using library calls, which is the right way to
do this.

Alex

2014-02-06 11:10 GMT+01:00 Volker S. [email protected]:

Yes, I know, but sometimes this does not help. Here is a list of my devices
Sub-Gert #0: subdevice #0
Karte 2: Loopback [Loopback], Gert 1: Loopback PCM [Loopback PCM]
Sub-Gerte: 1/1
Sub-Gert #0: subdevice #0

But to use the Delta card I have to use plughw:1 as device or some other
plugin defined in my personal .asoundrc .

Maybe “aplay -L” is better; however, formatted output from an
application is hardly any indication of what is possible with library
calls.

Alex

Hi Volker,

The idea is to enumerate using library calls, which is the right way to do this.

Alex

Hi Alex,

Yes, I know, but sometimes this does not help. Here is a list of my
devices from aplay -l:

Karte 0: SB [HDA ATI SB], Gert 0: ID 892 Analog [ID 892 Analog]
Sub-Gerte: 0/1
Sub-Gert #0: subdevice #0
Karte 0: SB [HDA ATI SB], Gert 1: ID 892 Digital [ID 892 Digital]
Sub-Gerte: 1/1
Sub-Gert #0: subdevice #0
Karte 1: M44 [M Audio Delta 44], Gert 0: ICE1712 multi [ICE1712 multi]
Sub-Gerte: 1/1
Sub-Gert #0: subdevice #0
Karte 2: Loopback [Loopback], Gert 0: Loopback PCM [Loopback PCM]
Sub-Gerte: 7/8
Sub-Gert #0: subdevice #0
Sub-Gert #1: subdevice #1
Sub-Gert #2: subdevice #2
Sub-Gert #3: subdevice #3
Sub-Gert #4: subdevice #4
Sub-Gert #5: subdevice #5
Sub-Gert #6: subdevice #6
Sub-Gert #7: subdevice #7
Karte 2: Loopback [Loopback], Gert 1: Loopback PCM [Loopback PCM]
Sub-Gerte: 8/8
Sub-Gert #0: subdevice #0
Sub-Gert #1: subdevice #1
Sub-Gert #2: subdevice #2
Sub-Gert #3: subdevice #3
Sub-Gert #4: subdevice #4
Sub-Gert #5: subdevice #5
Sub-Gert #6: subdevice #6
Sub-Gert #7: subdevice #7
Karte 4: HDMI [HDA ATI HDMI], Gert 3: HDMI 0 [HDMI 0]
Sub-Gerte: 1/1
Sub-Gert #0: subdevice #0

But to use the Delta card I have to use plughw:1 as device or some other
plugin defined in my personal .asoundrc .

– Volker