Build an open future with us.

Invest in Mycroft and become a community partner.

Manjaro - No input


#1

I seem to have audio output properly configured, but Mycroft can’t see either my built-in microphone nor a cheap USB microphone that I tested. I ran the audiotest and got the following in return:

[andy@VIXDEVMINI mycroft-core]$ ./start-mycroft.sh audiotest

Initializing...

Starting audiotest

 ===========================================================

 ==         STARTING TO RECORD, MAKE SOME NOISE!          ==

 ===========================================================

Traceback (most recent call last):

  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main

    "__main__", mod_spec)

  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code

    exec(code, run_globals)

  File "/home/andy/mycroft-core/mycroft/util/audio_test.py", line 102, in <module>

    main()

  File "/home/andy/mycroft-core/mycroft/util/audio_test.py", line 89, in main

    record(args.filename, args.duration)

  File "/home/andy/mycroft-core/mycroft/util/audio_test.py", line 64, in record

    with mic as source:

  File "/home/andy/mycroft-core/mycroft/client/speech/mic.py", line 122, in __enter__

    input=True,  # stream is an input stream

  File "/home/andy/mycroft-core/.venv/lib/python3.7/site-packages/pyaudio.py", line 750, in open

    stream = Stream(self, *args, **kwargs)

  File "/home/andy/mycroft-core/.venv/lib/python3.7/site-packages/pyaudio.py", line 441, in __init__

    self._stream = pa.open(**arguments)

OSError: [Errno -9997] Invalid sample rate

After I commented out auto-suspend within my pulse configuration, the Mycroft audiotest began complaining that there was no valid input device - however, in the alsa mixer panel GUI, the GUI representation of audio input reflects the sound in front of the microphone accurately - and the speakers work, too.

I then discovered, at the end of default.pa, lines for setting default sinks and sources that are commented out by default. I uncommented them, but the audiotest returned the same result.

For reference, pactl info shows the default sink and source correctly.

Is there an extra step or two on Manjaro? It all seems to work apart from audio-in.


#2

Hey there @r0tekatze, first of all a warm welcome, it’s great to have you here, sorry to hear you’ve run into audio issues.

The
OSError: [Errno -9997] Invalid sample rate
error is quite frequent, and it’s almost always to do with the selection of the microphone.

Does alsamixer allow you to change the microphone input at all?

(great initial troubleshooting by the way)


#3

@KathyReid

I doubt it had anything to do with microphone selection, since other applications were perfectly functional. I also recorded a few seconds of sample audio from the terminal, and it was perfectly fine with both mics.

On an interesting note, I moved to pure Arch and I’m having exactly the same problem. This leads me to believe that the configuration for either pyaudio or whatever else is being used to capture audio is incorrect.

I tested the available sample rates on my machine using Python’s SoundDevice module (https://python-sounddevice.readthedocs.io/en/latest/index.html) , and discovered that 32,000 is not an acceptable sample rate (the acceptable rates being 44100, 48000, 96000). Where can I find the mic input configuration?


#4

Did you try this workaround that was posted?

https://community.mycroft.ai/t/alsa-issue-oserror-errno-9997-invalid-sample-rate


#5

Thanks, I’m taking a look. I suspect that “hw:1” et al will be different depending on configuration, I’ll make a post in that thread if I find it to be the case


#6

@KathyReid That’s not a permanent solution, fwiw. It requires fairly advanced understanding of hardware in Linux, and it doesn’t work properly if pulseaudio is installed (as is in my case). It certainly does the trick for a few people, though.

I suspect the reason that it is necessary is down to the configuration of pyaudio within the mycroft project. I’m going to have a browse through the github later and see what I see.

Anyway, currently, the audiotest is now functional, but mycroft is still unable to hear me. I need to do some further tests, and will report back with any additional info.


#7

Uh… scratch that last paragraph. My Mycroft machine wasn’t connected to the internet. I’m an idiot.


#8

No worries, definitely not an idiot!