matrix-io / matrixio-kernel-modules

MATRIX HAL in kernel space
22 stars 23 forks source link

Matrix Voice - ALSA Input/Output Error #24

Closed nodered closed 4 years ago

nodered commented 6 years ago

I'm getting these errors when trying to access the array from alsamixer and when storing the volume levels...

pi@raspberrypi:~ $ alsamixer (while in alsamixer, F6 and selecting the card) cannot load mixer controls: Input/output error

pi@raspberrypi:~ $ sudo alsactl store alsactl: get_control:256: Cannot read control '2,0,0,MIC ARRAY Volume,0': Input/output error


Since the volume levels can not be stored, I needed an /etc/asound.conf and a way to restore/set the volume at boot...

/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 }

max_dB 50.0

}

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

pcm.array { type plug slave { pcm "hw:1,0" <-------will change depending on your config (when in alsamixer press F6 to get the card index #) } }

To restore/set the alsa volume at boot, I added this to /etc/rc.local

arecord -d 1 --device=default -r 48000 -c 1 -f S16_LE test.wav sleep 1 amixer sset 'MicArray Master' 70%

For pulseaudio.... Since the mic volume isn't stored between boots, setting the array volume, starting pulseaudio and then setting the volume for pulseaudio worked for my app that needed pulseaudio.

So my /etc/rc.local looks like this...

arecord -d 1 --device=default -r 48000 -c 1 -f S16_LE test.wav sleep 1 amixer sset 'MicArray Master' 70%

su pi -c '/usr/bin/pulseaudio --start' sleep 1 pactl set-source-volume 0 250%

None of this will be necessary when the drivers are finished but for now, this is what worked for me.

Romkabouter commented 6 years ago

same issues here, fresh raspbian stretch and kernel modules install

henningweiler commented 6 years ago

Hi all,

somehow, I seem to be a bit of a loss here...

Is it actually true that the signal I get from pcm "hw:1,0" (the array) is already the one coming out from the DSP (beamforming, noise reduction, etc.)? Or is it just the raw input from one of the mics of the array?

And if it should be the latter: How would I be able to use the whole fanciness of the MATRIX Voice? (e.g. for snips.ai ... @Romkabouter, how did you get that to work, btw? I seem to be unable to start snips-audioserver with the array, but only with the dummy ... however, the dummy oversamples and produces only digital garbage...)

Thanks a lot, H.

PS: sorry, if my question hijacks this thread, but my feeling was that it's better here than in its own thread...

Romkabouter commented 6 years ago

See my comments here: https://community.matrix.one/t/matrix-voice-snips-home-assistant-working-together/1519/22

Basically do this: sudo nano /etc/modules-load.d/matrix-mics.conf comment out snd-dummy: snd_bcm2835

snd-dummy

nodered commented 5 years ago

These errors are not an issue with the new kernel module update

pi@raspberrypi:~ $ alsamixer (while in alsamixer, F6 and selecting the card) cannot load mixer controls: Input/output error

pi@raspberrypi:~ $ sudo alsactl store alsactl: get_control:256: Cannot read control '2,0,0,MIC ARRAY Volume,0': Input/output error