You are not logged in.

#1 2018-01-07 20:57:42

ValkyrieC
Member
From: Toronto, Canada
Registered: 2018-01-07
Posts: 5
Website

[ALSA] can't record from two programs [SOLVED]

I'm trying to record audio from my external mic (AT2020USB+) in both Discord and another application (I've tried both Audacity and arecord). All of them work as intended separately, but when I join a voice channel on Discord, I get "error opening sound device" from Audacity and the following from arecord:

$ arecord -D sysdefault:CARD=AT2020USB -f cd > test.wav
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
arecord: main:828: audio open error: Device or resource busy

If I try the other way around, Discord just doesn't pick up audio. I'm not very well-versed with audio in Linux, but from prior knowledge I'm guessing this is occurring because I can't read from the device with multiple programs. Is there any way to duplicate the input for the second program (tee-related solution?) or use some kind of passthrough?

arecord --list-pcms

null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default
    Default ALSA Output (currently PulseAudio Sound Server)
sysdefault:CARD=PCH
    HDA Intel PCH, ALC255 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC255 Analog
    Front speakers
sysdefault:CARD=AT2020USB
    AT2020USB+, USB Audio
    Default Audio Device
front:CARD=AT2020USB,DEV=0
    AT2020USB+, USB Audio
    Front speakers
surround21:CARD=AT2020USB,DEV=0
    AT2020USB+, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=AT2020USB,DEV=0
    AT2020USB+, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=AT2020USB,DEV=0
    AT2020USB+, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=AT2020USB,DEV=0
    AT2020USB+, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=AT2020USB,DEV=0
    AT2020USB+, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=AT2020USB,DEV=0
    AT2020USB+, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=AT2020USB,DEV=0
    AT2020USB+, USB Audio
    IEC958 (S/PDIF) Digital Audio Output

arecord --list-devices

**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC255 Analog [ALC255 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: ALC255 Alt Analog [ALC255 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: AT2020USB [AT2020USB+], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

cat /proc/asound/cards

 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xdf128000 irq 132
 1 [AT2020USB      ]: USB-Audio - AT2020USB+
                      audio-technica AT2020USB+ at usb-0000:00:14.0-1, full speed

lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 13d3:3496 IMC Networks 
Bus 001 Device 003: ID 0bda:57de Realtek Semiconductor Corp. 
Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 006: ID 0909:001c Audio-Technica Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Last edited by ValkyrieC (2018-01-07 22:03:36)

Offline

#2 2018-01-07 21:54:34

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,665

Re: [ALSA] can't record from two programs [SOLVED]

Since you seem to have an /etc/asound.conf that redirects to pulseaudio. Are you aware of that? And if so, why do you not simply use pulseaudio? For audacity/ALSA programs, just keep it on the 'default' device than use pactl/pavucontrol to correctly set up the mic.

If you are intentionally omitting pulseaudio and you don't want to do my initial suggestion you will have to explicitly set up dsnoop for the mic, as detailed in https://wiki.archlinux.org/index.php/Ad … ure_device

Offline

#3 2018-01-07 22:03:12

ValkyrieC
Member
From: Toronto, Canada
Registered: 2018-01-07
Posts: 5
Website

Re: [ALSA] can't record from two programs [SOLVED]

V1del wrote:

If you are intentionally omitting pulseaudio and you don't want to do my initial suggestion you will have to explicitly set up dsnoop for the mic, as detailed in https://wiki.archlinux.org/index.php/Ad … ure_device

I've been trying to avoid pulse with this setup, so I've opted to use dsnoop and it looks like I'm getting results. Thanks!

Offline

Board footer

Powered by FluxBB