Microphone array separately

#1

Hello , i’m running odas sound tracking tuto which uses all the 8 microphones , now i’m trying to use the microphones separately , allocate 7 for the odas sound tracking programm and 1 microphone which will record sound simultaneously , could someone help please?
I’d like to control the mics separately , and configure arecord for example to use one specific microphone while others will be free , thank you.

#2

Hi @FxEng707,

If you would like to use the microphones separately, you will have to configure your /etc/asoundrc.conf file to break out the channels.

We currently do not have an implementation of this, but there are many resources online about how to configure your alsa microphones. You can start with the resources below:

Most of these resources point towards configuring alsa to allow multiple software to access mic data so you can record and use ODAS at the same time. This may be a simpler method than configuring ODAS to use 7 mics as you will have to edit ODAS files to do so.

You can check out this thread about someone else on the community who wanted to record and use ODAS at the same time. We point to some resources to get started with some solutions.

Best,
Samreen

Using the Matrix Creator 8 microphone array
#3

Hello Samreen thank you so much for the quick answer .I followed all the links you’ve gave me it has been 4 hours but nothing works , I admit that I understood more things about the working of /etc/asound.conf file etc but my problem is not solved yet now i’m trying to follow one last path hope it’ll helps but there is a problem now the problem comes from the documentation even after following steps correctly downloading and setting up matrix i run ls /tmp/ but I can not find the matrix_micarray_channel_0 matrix_micarray_channel_1 matrix_micarray_channel_2 matrix_micarray_channel_3 matrix_micarray_channel_4 matrix_micarray_channel_5 matrix_micarray_channel_6 matrix_micarray_channel_7 sam3-program.log
files , therefore the asoud.conf from here https://github.com/matrix-io/matrix-hal-examples/blob/master/microphone_array/asound.conf is not working could you please help me i’m getting desperate here why should it be that difficult I have 8 mics i want to use them separately :confused:
the idea i’m trying to do is to allocate mic0 for a wakeword and modify the odas code so that it uses only 7 mics not 8 and therefore i’m having 2 inputs mics simultaneously pleaaase help Samreen thank you so much

#4

Hi @FxEng707,

I will look into this more and let you know when I have more information. Thank you for your patience.

Best,
Samreen

#5

Hello Samreen
Thank you so much for help , I’m still trying with dsnoop cause i really need this to work but still not working :confused: here is my modified /etc/asound.conf

pcm.!default {
type asym
capture.pcm “mic”
playback.pcm “speaker”
}

pcm.mic {
type softvol
slave {
pcm “array”
}
control {
name “MicArray Master”
card 0
}
}

pcm.plugsnoop {
type dsnoop
ipc_key 1027
slave {
pcm “hw:2,0”
}

}

pcm.speaker {
type plug
slave {
pcm “hw:0,0”
}
}

pcm.array {
type plug
slave {
pcm “hw:2,0”
}
}

Here is my original
pcm.!default {
type asym
capture.pcm “mic”
playback.pcm “speaker”
}

pcm.mic {
type softvol
slave {
pcm “array”
}
control {
name “MicArray Master”
card 0
}
}

pcm.speaker {
type plug
slave {
pcm “hw:0,0”
}
}

pcm.array {
type plug
slave {
pcm “hw:2,0”
}
}

and here his the error i get whe i launch arecord recording.wav -f S16_LE -r 16000 -d 5 -D plugsnoop
or arecord recording.wav -f S16_LE -r 16000 -d 5

arecord reding.wav -f S16_LE -r 16000 -d 5
ALSA lib pcm_direct.c:940:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access
ALSA lib pcm_dsnoop.c:629:(snd_pcm_dsnoop_open) unable to initialize slave
arecord: main:788: audio open error: Invalid argument

thank you Samreen

1 Like
#6

Yep dsnoop does not seem to work with matrix voice. even the default dsnoop without any asound.conf / .asoundrc defined :

$ arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=Dummy
Dummy, Dummy PCM
Default Audio Device
sysdefault:CARD=Dummy
Dummy, Dummy PCM
Default Audio Device
dmix:CARD=Dummy,DEV=0
Dummy, Dummy PCM
Direct sample mixing device
dsnoop:CARD=Dummy,DEV=0
Dummy, Dummy PCM
Direct sample snooping device
hw:CARD=Dummy,DEV=0
Dummy, Dummy PCM
Direct hardware device without any conversions
plughw:CARD=Dummy,DEV=0
Dummy, Dummy PCM
Hardware device with all software conversions
default:CARD=SOUND
MATRIXIO SOUND,
Default Audio Device
sysdefault:CARD=SOUND
MATRIXIO SOUND,
Default Audio Device
dmix:CARD=SOUND,DEV=0
MATRIXIO SOUND,
Direct sample mixing device
dsnoop:CARD=SOUND,DEV=0
MATRIXIO SOUND,
Direct sample snooping device
hw:CARD=SOUND,DEV=0
MATRIXIO SOUND,
Direct hardware device without any conversions
plughw:CARD=SOUND,DEV=0
MATRIXIO SOUND,
Hardware device with all software conversions

$ sudo arecord -D dsnoop:CARD=SOUND recording.wav -f S16_LE -r 48000 -d 5
ALSA lib pcm_direct.c:940:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access
ALSA lib pcm_dsnoop.c:629:(snd_pcm_dsnoop_open) unable to initialize slave
arecord: main:788: audio open error: Invalid argument

#7

@bung,

Welcome to the community!

You are correct, we found that there needs to be some kernel module changes to accommodate dsnoop. It is currently on our roadmap. Thank you for the post!

Best,
Samreen

#8

Hi Samreen. Thank you for the quick reply,

Thats a shame,

It is quite annoying that this is a known issue that as far as i can tell it not documented anywhere, i have wasted several days trying to get this to work, assuming that i am doing something wrong.

is your roadmap publicly available anywhere ?

#9

Hi @bung,

We only recently realized this kernel module issue ourselves as we were trying to break out the individual mics and ran into similar problems. We apologize for the inconvenience you had to go through. We will look into making these issues clearer going forward.

Best,
Samreen