Over the past few days (around 4 days), we’ve received several reports of Mycroft, across multiple devices and distros being unable to understand audio input, often failing with the error; OSError: [Errno -9997] Invalid sample rate
We don’t know why this is occurring, but @krisgesling has found a solution by editing ./asoundrc, via an Alexa issue:
pcm.!default { type asym playback.pcm
{ type plug slave.pcm "hw:0" }
capture.pcm { type plug slave.pcm "hw:1" }
}
Please let us know if this works for you (and big ups @krisgesling)
In case anyone is using it in a multi-user situation, the asound config file can live at either: ~/.asoundrc for a single user; or /etc/asound.conf as a system wide configuration.
hi!
i installed picroft for the first time today and had “error -9997”. my speakers worked but not the microphone (blue snowball). so i tried to edit ./asoundrc (it was empty?) but after that my speakers where not working anymore. it says now ./asoundrc is corrupted.
i checked triple for spelling error but that was not the case, any idea on what went wrong here?
For future reference, “hw:x,y” is a reference to first the card number, and then the device number. The appropriate values can be found by using aplay -l which outputs a list of audio devices attached to the system.
There is a minor issue with this approach in that it will fail unpredictably for those with USB input devices. This is because each time those devices are plugged in, their values can change. A solution to this is potentially to use a device alias instead. Device aliases can be found by capitalising the appendix to the above aplay function - thus aplay -L. This outputs a list of device aliases, as well as friendly names, and what current HWID is attached to them.
If you want a better solution, you can write udev rules to ensure that a device gets the same HWID every time it is plugged in. This is advanced usage, so I won’t write it up here. Instead, here is some material on the same:
Hey everyone I just installed mycroft-core on Arch Linux for the first time and got the same sampling rate error when trying the audiotest module to resolve the error of not getting any mic input.
I’m using an usb headset with a microphone and its the default device for both input and output in pulseaudio.
I tried the fix recommended by this thread but it did not resolve the error for me.
What i did:
create the file ~/.asoundrc with the following content:
pcm.!default { type asym playback.pcm
{ type plug slave.pcm “hw:2” }
capture.pcm { type plug slave.pcm “hw:0” }
}
I used the numbers 2 and 0 because the output of aplay -l looked the following:
Hi @clados, was the sound playing from your headphones? I think you might want:
pcm.!default {
type asym playback.pcm { type plug slave.pcm “hw:2” }
capture.pcm { type plug slave.pcm “hw:2” }
}
This should set card 2 as both your playback and capture device.
If you aren’t getting sound output, try setting your playback to another card, maybe:
pcm.!default {
type asym playback.pcm { type plug slave.pcm “hw:0” }
capture.pcm { type plug slave.pcm “hw:2” }
}
The card/device definition that r0tekatze mentioned is a little different. I believe it defaults to device number 0 but you can make it explicit with “hw:2,0”. If you want to read more check out the ALSA Project Documentation, but let us know if this doesn’t work. Some people in the original thread needed to specify additional parameters like audio format.
Hi @Klages, did you have any luck with your microphone?
If you’re still having trouble, let us know what output you get from running aplay -l in your terminal.
Hi, I have been having the same problem, getting the same error, output worked but input didnt. So I did a sudo apt-get install pulseaudio. Input started working but now output doesnt work… I appreciate if you could help. Thanks.
Hi, I just wanted to report that I had the same issue when I installed Picroft yesterday. I used the Picroft 2018-9-12 unstable image where I was linked to from the Getting Started Guide.
I could resolve the issue in my case by installing pulseaudio. I do not know if pulseaudio should be installed or not but in case it should be, the Picroft image mentioned above should be checked.
Hi there @Binabik, thanks so much for reporting this to us.
We currently have a PR that will include pulseaudio in the autorun.sh file as a requirement so once that is merged, pulseaudio will be a requirement for Picroft.
Hi @KathyReid I run the alsamixer and the volume was all the way down. So I set the volume to maximum and start the mycroft again with ./start-mycroft.sh cli
But it didn’t work, I tried changing sound cards on alsamixer with F6, didn’t work either. Is there perhaps a way to run the audio setup tool like in the initial setup at the beginning?