LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-31-2020, 08:43 AM   #1
Hammett
Senior Member
 
Registered: Aug 2003
Location: Barcelona, Catalunya
Distribution: Gentoo
Posts: 1,074

Rep: Reputation: 59
ALSA: Unable to use microphone multiple sources


Hi all,

I am unable to record, or use the microphone, in several applications under ALSA.

My config:

Code:
[hammett][/home/hammett]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: Generic Digital [Generic Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Code:
[hammett][/home/hammett]$ lsmod | grep snd
snd_hda_codec_realtek   102400  1
snd_hda_codec_generic    77824  2 snd_hda_codec_realtek
snd_hda_intel          28672  7
snd_intel_dspcfg       16384  1 snd_hda_intel
snd_hda_codec         102400  3 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core           61440  4 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
snd_pcm                98304  6 snd_hda_intel,snd_hda_codec,snd_hda_core
snd_timer              32768  3 snd_pcm
snd                    81920  14 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec,snd_timer,snd_pcm
soundcore              16384  1 snd
Code:
[hammett][/home/hammett]$ cat .asoundrc 
pcm.dmixer {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 8192
   	rate 44100
    }
 
    bindings {
        0 0
        1 1
    }
}


#This is the microphone
pcm.dsnooped {
    ipc_key 1027
    ipc_key_add_uid true
    type dsnoop
    slave {
    	pcm "hw:0,0"
	channels 2
    }
}

#This makes both channels work together.
pcm.asymed {
        type asym
        playback.pcm "dmixer"
        capture.pcm "dsnooped"
}


pcm.!default {
    type plug
    slave.pcm "asymed"
}
I normally have skype (skypeforlinux) open and running at all times, and microphone works fine there, but If I want to use the microphone for any other purpose, I cannot with the following error:

Code:
[hammett][/home/hammett]$ arecord test.wav
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.1.2/work/alsa-lib-1.2.1.2/src/pcm/pcm_dsnoop.c:641:(snd_pcm_dsnoop_open) unable to open slave
arecord: main:828: audio open error: Device or resource busy
This is the output of arecord -L
Code:
[hammett][/home/hammett]$ arecord -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=Generic
    HD-Audio Generic, ALC892 Analog
    Default Audio Device
front:CARD=Generic,DEV=0
    HD-Audio Generic, ALC892 Analog
    Front speakers
usbstream:CARD=Generic
    HD-Audio Generic
    USB Stream Output
usbstream:CARD=NVidia
    HDA NVidia
    USB Stream Output
where it seems I am lacking the plugin (or not enabled)


I have been searching over the web for a solution, and I have tried many different .asdoundrc configs, none of them seem to work for dsnoop

ALSA related packages installed:
Code:
[hammett][/home/hammett]$ eix -I alsa
[I] media-libs/alsa-lib
     Available versions:  1.2.1.2 ~1.2.2 {alisp debug doc python +thread-safety ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32" ELIBC="uclibc" PYTHON_SINGLE_TARGET="python2_7 python3_6 python3_7"}
     Installed versions:  1.2.1.2(21:53:32 13/02/20)(thread-safety -alisp -debug -doc -python ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" ELIBC="-uclibc" PYTHON_SINGLE_TARGET="python3_7 -python2_7 -python3_6")
     Homepage:            https://alsa-project.org/
     Description:         Advanced Linux Sound Architecture Library

[I] media-plugins/alsa-plugins
     Available versions:  1.2.1 ~1.2.2 {arcam_av debug ffmpeg jack libav libsamplerate +mix oss pulseaudio speex +usb_stream}
     Installed versions:  1.2.1(14:13:21 31/03/20)(ffmpeg mix usb_stream -arcam_av -debug -jack -libav -libsamplerate -oss -pulseaudio -speex ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            http://www.alsa-project.org/
     Description:         ALSA extra plugins

[I] media-sound/alsa-utils
     Available versions:  (0.9) 1.2.1 ~1.2.2
       {bat doc +libsamplerate +ncurses nls selinux}
     Installed versions:  1.2.1(0.9)(19:05:58 20/01/20)(libsamplerate ncurses nls -bat -doc -selinux)
     Homepage:            https://alsa-project.org/
     Description:         Advanced Linux Sound Architecture Utils (alsactl, alsamixer, etc.)
Any help deeply apreciated!
 
Old 03-31-2020, 07:31 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,345
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
In this on Gentoo or some other distro?

What does alsamixer tell you about volume levels?

Do you have Pulse Audio installed?
 
Old 04-01-2020, 04:53 AM   #3
Hammett
Senior Member
 
Registered: Aug 2003
Location: Barcelona, Catalunya
Distribution: Gentoo
Posts: 1,074

Original Poster
Rep: Reputation: 59
Hi,

Yes, this a Gentoo distro. Microphone works fine for single applications (such as Skype), so alsamixer is fine (was also the first thing I checked).

I do not have pulseaudio installed, and I would rather keep it like this.

Thanks!
 
  


Reply

Tags
alsa, dsnoop, micro, microphone



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Error: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:22 Commomore Linux - Newbie 12 02-05-2019 12:24 AM
[SOLVED] Neither internal nor external microphone functioning. Not even USB Microphone (Debian Jessie) achim_59 Linux - Hardware 3 08-14-2016 10:48 AM
Unable to use my internal microphone dspjm Linux - Hardware 2 07-31-2011 09:44 PM
virtual microphone: FILE ---> MICROPHONE ---> APPLICATION jamal_mohammadi Linux - Hardware 1 02-13-2011 03:10 PM
How to switch my alsa card 0 and alsa card 1 in ALSA? frenchn00b Debian 10 12-11-2009 12:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration