4

I've got an embedded device with ALSA support, and I'm trying to figure out how to get dsnoop working. The reason is that I want two applications to share the microphone input. But the problem is that ALSA seems to ignore /etc/asound.conf entirely. E.g. arecord --list-pcms does not list the pcm's defined there. How can I check the results of /etc/asound.conf parsing?

There is a mysterious line in /usr/share/alsa/alsa.conf, "errors false". Does this do anything?

MSalters
  • 421
  • 5
  • 12
  • What operating system does the device have on it? There may be some files of interest under /usr/share/alsa/pcm/, including a dsnoop.conf file. –  Jul 01 '13 at 12:49
  • Linux 2.6.35, MIPS(SMP). There is indeed a dsnoop.conf file, which has a pcm.!dsnoop entry. It's parameterized, taking 5 args (card dev subdev format rate) – MSalters Jul 01 '13 at 13:23
  • New device, completely different vendor, still the same ALSA problems :( It's really not impressive when in 2015 Linux still can't share audio input. – MSalters Nov 10 '15 at 17:10
  • Have you tried creating ~/.asoundrc with your custom definitions? Or even copying /etc/asound.conf or /usr/share/alsa/alsa.conf to ~/.asoundrc? It is always advisable to do this rather than messing around with /etc/asound.conf or /usr/share/alsa/alsa.conf. – skrowten_hermit Apr 08 '17 at 19:33

1 Answers1

1

To enable dsnoop by default, your particular device needs a file with the proper settings in /usr/share/alsa/cards/.

To check whether dsnoop works at all, try arecord -D dsnoop -f dat test.wav.

The errors false parameter of the load* functions is not related to your problem; it specifies that not error should be raised when one of those files is not found.

CL.
  • 2,709
  • alsa-lib/src/pcm/pcm_dsnoop.c:615:(snd_pcm_dsnoop_open) unable to open slave. I can't find any file obviously related to my device in /usr/share/alsa/cards/. – MSalters Jul 01 '13 at 13:27
  • Does arecord -D plughw -f dat test.wav work? – CL. Jul 01 '13 at 16:34
  • Yes, no problem. Basic sound functionality works, even within the two apps I have. They just can't run concurrently. – MSalters Jul 04 '13 at 08:26
  • Does your hardware driver support mmap? – CL. Jul 04 '13 at 09:15
  • arecord -D plughw -f dat --mmap test.wav works too, so I think mmap is supported. – MSalters Jul 04 '13 at 09:24
  • For that, you'd have to test with hw instead of plughw. – CL. Jul 04 '13 at 10:15
  • arecord -D hw -f dat --mmap test.wav works too. But let's take one step back: If dsnoop fails because of a lack of mmap, where could I have discovered that? – MSalters Jul 04 '13 at 10:32
  • Is "unable to open slave" the only error message from arecord? – CL. Jul 04 '13 at 11:27
  • No, there´s also pcm_direct.c:980:(snd1_pcm_direct_initialize_slave) unable to install hw params and main:654: audio open error: Invalid argument. (before and after "unable to open slave"). – MSalters Jul 04 '13 at 12:09
  • So your sound driver (whatever it is) does not support the default parameters of the dsnoop plugin. – CL. Jul 04 '13 at 13:35