9

I'm using PulseAudio on my system, and I followed the instructions for adding a monitor device as per the PulseAudio wiki. The monitor device itself works and registers/functions properly in apps like Audacity, but I'm not able to get the device to show itself through any of the command line tools. aplay -L returns roughly the same list as Audacity, but is conveniently missing the monitor device.

My end goal is to parse the output in a Java app and eventually pass it to FFmpeg. I'm able to tell the device exists through the Java audio APIs as 2 generic "Capture source ports" show up, but it doesn't provide a name for the device, and the goal is for it to be user-selectable in a somewhat friendly manner.

Are there any ways to get the monitor device to show up in either a command line app or through a Java API / library?

Thanks in advance!

timothyb89
  • 141
  • 1
  • 1
  • 7
  • 1
    Is this quesiton related to Alsa or Pulse ? As is this is entirely confusing these are totally separate technologies. – Evan Carroll Jun 06 '18 at 22:35

3 Answers3

6

So in short, it looks like the problem is up at the alsa level and not at the pulseaudio level? If you want to see the alsa devices try.

aplay -l

(but aplay -L which you've already mentioned is similar).

pulseaudio sits on top of alsa. So looking at pactl brings in another layer of software... see here troubleshooters.com/linux/sound/sound_troubleshooting.htm. If alsa can't see the sound device then certainly pulseaudio won't?

5

It's brutally simple:

This shows you the sinks/output ports:

aplay -L

Since a 'monitor' is a source/input port, you'll want this:

arecord -L

Update: aplay and arecord are in the 'alsa-utils' package. To install:

sudo apt install alsa-utils
  • `aplay: not found` – Cherona Dec 24 '22 at 09:03
  • Install the alsa-utils package, see post (now updated). – Henk van der Laak Dec 29 '22 at 08:03
  • Sorry my comment was more like, I don't have a package manager on the device I want to list them on. And in the Linux world it's surprisingly hard to find pre-compiled binaries – Cherona Dec 29 '22 at 14:54
  • @Cherona Eh....that's exactly what packages contain: binaries. You can just download packages and unzip them to get at the binaries. I don't even know what you mean with "pre-compiled". Packages are built, not compiled. – Henk van der Laak Jan 04 '23 at 00:27
5

Use the pacmd list-sources or pactl list commands to show PulseAudio devices. To show only names you can grep on it's output. This is an example from PulseAudio FAQ

$ LANG=C pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2

With additional grep on ".monitor" you can get only monitor devices.

Nikita Krupenko
  • 480
  • 3
  • 4