Crashing on first time start up

Hi,

I had this working having followed the instructions on my Fedora laptop. So, I bought a PS3 Eye and installed on my server.

When I run it, it keeps spitting out things like …

Traceback (most recent call last):

    host=host, origin=origin)
~~~~venv/lib64/python3.7/site-packages/websocket/_core.py", line 269, in connect
    self.handshake_response = handshake(self.sock, *addrs, **options)
~~~~ib64/python3.7/site-packages/websocket/_handshake.py", line 58, in handshake
    status, resp = _get_resp_headers(sock)
~~~~on3.7/site-packages/websocket/_handshake.py", line 111, in _get_resp_headers
    raise WebSocketException("Handshake status %d" % status)
websocket._exceptions.WebSocketException: Handshake status 501


Also, I noticed this earlier on ...

~~~ - ERROR - Exception closing websocket: Exception("Uncaught 'error' event.")
~~~~bus.client.ws:on_error:85 - WARNING - WS Client will reconnect in 5 seconds.
~~~~aInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2043
~~~~Capture, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2714
~~~~stBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2838
Looking for Messagebus websocket...

What's going on?

Hi biggaz,

We are working to include native support for more distributions and platforms however it’s not currently recommended.

Are you running Fedora Server edition? I don’t think it comes with any ALSA or PulseAudio packages. So there will be a lot of additional configuration required to get this up and running.

Hi,

It’s not server editition no, it’s Workstation, same as my laptop., which worked straight away. I use the server as my Kodi machine as well, so I know audio works over HDMI.

Might it be to do with the Playstation Eye?

Oh good, just thought it was worth checking, sometimes it’s something so obvious we blind ourselves to it :slight_smile:

The Playstation Eye shouldn’t crash anything, lots of people use those. Do you remember any errors when running dev_setup.sh?

There’s clearly a problem with the sound settings given those ALSA errors but if we can avoid manually configuring asoundrc.config then it generally works out better for you in the long run. I’m also curious about the 501 status as there must be a malformed request being fired to the server from the websocket package.

As we released a new version of mycroft-core (19.02) to the stable repository yesterday, it might be worth giving it another go from scratch and seeing if the latest updates perform any better.

I’d also try running mycroft-mic-test to see if the audio works without the rest of the services.

Then if it crashes again, it would be good to see some more of the logs located in /var/log/mycroft/.

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

Traceback (most recent call last):
File “/usr/lib64/python3.7/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib64/python3.7/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/user1/mycroft-core/mycroft/util/audio_test.py”, line 132, in
main()
File “/home/user1/mycroft-core/mycroft/util/audio_test.py”, line 119, in main
record(args.filename, args.duration)
File “/home/user1/mycroft-core/mycroft/util/audio_test.py”, line 66, in record
with mic as source:
File “/home/user1/mycroft-core/mycroft/client/speech/mic.py”, line 122, in enter
input=True, # stream is an input stream
File “/home/user1/mycroft-core/.venv/lib64/python3.7/site-packages/pyaudio.py”, line 750, in open
stream = Stream(self, *args, **kwargs)
File “/home/user1/mycroft-core/.venv/lib64/python3.7/site-packages/pyaudio.py”, line 441, in init
self._stream = pa.open(**arguments)
OSError: [Errno -9997] Invalid sample rate

I tried running alsamixer and found it wouldn’t work throwing a message about connecting to PulseAudio. Doing some more digging, I tried to stop PulsaAudio to run it and view error logs on start up. Turns out it wasn’t running. If I run the audio test after running the PulsaAudio server from a terminal, then mycroft audio test gets further, but just gets stuck recording. How is Kodi able to play audio without PulseAudio …?

It looks like Kodi uses ALSA on “dedicated” systems where it can safely control all audio, and “PulseAudio is used when Kodi is installed in a desktop-environment rather than a dedicated/direct boot setup. PulseAudio allows normal video & audio playback in XBMC while at the same time allowing the user to get audio in their browser or other applications.”

Do you still get the OSError: [Errno -9997] Invalid sample rate after you have PulseAudio running? If so you could try editing your asoundrc config file as described here: