GithubHelp home page GithubHelp logo

ALSA error about 01 HOT 14 OPEN

miguelhg9211 avatar miguelhg9211 commented on June 1, 2024
ALSA error

from 01.

Comments (14)

rbrisita avatar rbrisita commented on June 1, 2024 3

The mystical fix called out here of importing sounddevice fixed all the ALSA errors for me on Ubuntu 23.10 (Raspberry Pi)

This worked for me. Thank you! These are the steps to take with poetry:

poetry shell
pip3 install sounddevice

After install, exit shell, open software\start.py and add as the last import import sounddevice. Running poetry run 01 --model gpt-4-turbo should run without OP's errors.

from 01.

rbrisita avatar rbrisita commented on June 1, 2024 2

@rbrisita That fixed it indeed, wonderful work. You should PR this πŸš€

Created!

from 01.

mysticaltech avatar mysticaltech commented on June 1, 2024 1

@rbrisita That fixed it indeed, wonderful work. You should PR this πŸš€

from 01.

rbrisita avatar rbrisita commented on June 1, 2024 1

@rbrisita thanks for your comment, I did that, and sounds that it fix fixes the ALSA issue, but after that I had the next exception:

  File "/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/server.py", line 49, in <module>
    from .compatibility import asyncio_timeout
ImportError: cannot import name 'asyncio_timeout' from partially initialized module 'websockets.legacy.compatibility' (most likely due to a circular import) (/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/compatibility.py)

with entering to shell again and installing this missing package: pip3 install asyncio, I don't have the ALSA errors 🍾🍾, but it doesn't works yet, I don't have recording messages or any sound:

:software$ poetry run 01 --model gpt-4-turbo

β—‹                                                                                                                                              

Starting...                                                                                                                                    

INFO:     Started server process [137759]
INFO:     Waiting for application startup.

Ready.                                                                                                                                         

INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:10001 (Press CTRL+C to quit)
Recording started...
Recording stopped.
Recording started...
Recording stopped.

I never encountered an issue with asyncio. I have had most success with a X11 and systemd Linux distro and using Python 3.10. I recommend the combination of pyenv and poetry when creating the environment.

from 01.

rbrisita avatar rbrisita commented on June 1, 2024 1

All good. My recommendation with pyenv still stands. To add, when installing a Python version make sure the dependencies it needs are installed to have a clean install. For instance, I had to install libsqlite3 when it complained it couldn't find it.

from 01.

akashkuttappa avatar akashkuttappa commented on June 1, 2024

The mystical fix called out here of importing sounddevice fixed all the ALSA errors for me on Ubuntu 23.10 (Raspberry Pi)

from 01.

tyfiero avatar tyfiero commented on June 1, 2024

Have you tried this fix @miguelhg9211?

from 01.

akashkuttappa avatar akashkuttappa commented on June 1, 2024

The mystical fix called out here of importing sounddevice fixed all the ALSA errors for me on Ubuntu 23.10 (Raspberry Pi)

@hpsaturn you can try this to resolve the ALSA error

from 01.

hpsaturn avatar hpsaturn commented on June 1, 2024

I tried this but nothing. I added software/pyproject.toml and reinstalling the app, but nothing. Also I removed my .asoundrc config file and other alsa configs but nothing. I can't hear anything and also I think it is not capturing anything too, and also one problem more, after some time of tries with the spacebar the application has a exception:

Complete output details: (clickme)
Starting...                                                                                                                                                                   

INFO:     Started server process [3333027]
INFO:     Waiting for application startup.

Ready.                                                                                                                                                                        

INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:10001 (Press CTRL+C to quit)
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
INFO:     ('127.0.0.1', 36132) - "WebSocket /" [accepted]

Hold the spacebar to start recording. Press CTRL-C to exit.INFO:     connection open

Cannot call "receive" once a disconnect message has been received.
Recording started...
Recording stopped.
Recording started...
Recording stopped.
INFO:     ('127.0.0.1', 45220) - "WebSocket /" [accepted]
INFO:     connection open

Hold the spacebar to start recording. Press CTRL-C to exit.
Task exception was never retrieved
future: <Task finished name='Task-21' coro=<Device.message_sender() done, defined at /home/avp/tmp/src/openia_01/software/source/clients/base_device.py:243> exception=ConnectionClosedError(None, Close(code=<CloseCode.INTERNAL_ERROR: 1011>, reason='keepalive ping timeout'), None)>
Traceback (most recent call last):
  File "/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 963, in transfer_data
    message = await self.read_message()
  File "/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 1033, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 1108, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 1165, in read_frame
    frame = await Frame.read(
  File "/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/framing.py", line 68, in read
    data = await reader(2)
  File "/usr/lib/python3.9/asyncio/streams.py", line 723, in readexactly
    await self._wait_for_data('readexactly')
  File "/usr/lib/python3.9/asyncio/streams.py", line 517, in _wait_for_data
    await self._waiter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/avp/tmp/src/openia_01/software/source/clients/base_device.py", line 249, in message_sender
    await websocket.send(json.dumps(message))
  File "/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 635, in send
    await self.ensure_open()
  File "/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 939, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: sent 1011 (internal error) keepalive ping timeout; no close frame received
Recording started...
Recording stopped.
Cannot call "receive" once a disconnect message has been received.
INFO:     connection closed
Recording started...
Recording stopped.

from 01.

hpsaturn avatar hpsaturn commented on June 1, 2024

I synced the repo, and I don't know, maybe the problem is not ALSA? maybe has relation with the socket and communication with the engine? After some minutes, I had this exception:

Starting...                                                                                                                                    

INFO:     Started server process [835877]
INFO:     Waiting for application startup.

Ready.                                                                                                                                         

INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:10001 (Press CTRL+C to quit)
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
INFO:     ('127.0.0.1', 36278) - "WebSocket /" [accepted]
INFO:     connection open

Hold the spacebar to start recording. Press CTRL-C to exit.
 Cannot call "receive" once a disconnect message has been received.
Recording started...
Recording stopped.

INFO:     ('127.0.0.1', 53700) - "WebSocket /" [accepted]

Hold the spacebar to start recording. Press CTRL-C to exit.
INFO:     connection open
INFO:     connection closed
Task exception was never retrieved
future: <Task finished name='Task-24' coro=<Device.message_sender() done, defined at /home/avp/tmp/src/openia_01/software/source/clients/base_device.py:245> exception=ConnectionClosedError(Close(code=1011, reason='keepalive ping timeout'), Close(code=1011, reason='keepalive ping timeout'), True)>
Traceback (most recent call last):
  File "/home/avp/tmp/src/openia_01/software/source/clients/base_device.py", line 251, in message_sender
    await websocket.send(json.dumps(message))
  File "/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 635, in send
    await self.ensure_open()
  File "/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 939, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: received 1011 (internal error) keepalive ping timeout; then sent 1011 (internal error) keepalive ping timeout
Recording started...
Recording stopped.
Cannot call "receive" once a disconnect message has been received.

from 01.

hpsaturn avatar hpsaturn commented on June 1, 2024

@rbrisita thanks for your comment, I did that, and sounds that it fix fixes the ALSA issue, but after that I had the next exception:

  File "/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/server.py", line 49, in <module>
    from .compatibility import asyncio_timeout
ImportError: cannot import name 'asyncio_timeout' from partially initialized module 'websockets.legacy.compatibility' (most likely due to a circular import) (/home/avp/.cache/pypoetry/virtualenvs/01os-Niq43RoY-py3.9/lib/python3.9/site-packages/websockets/legacy/compatibility.py)

with entering to shell again and installing this missing package: pip3 install asyncio, I don't have the ALSA errors 🍾🍾, but it doesn't works yet, I don't have recording messages or any sound:

:software$ poetry run 01 --model gpt-4-turbo

β—‹                                                                                                                                              

Starting...                                                                                                                                    

INFO:     Started server process [137759]
INFO:     Waiting for application startup.

Ready.                                                                                                                                         

INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:10001 (Press CTRL+C to quit)
Recording started...
Recording stopped.
Recording started...
Recording stopped.

from 01.

hpsaturn avatar hpsaturn commented on June 1, 2024

Thanks @rbrisita for your reply

I never encountered an issue with asyncio. I have had most success with a X11 and systemd Linux distro and using Python 3.10. I recommend the combination of pyenv and poetry when creating the environment.

but please can you clarify that. I'm Android and esp32 developer, my knows around Python is only for some things. Right now I have Python 3.9.2 in my system, and I did the 01 guide to install it. But you mentioned that we should use pyenv better? that means first generate a env with python 3.10, and then run poetry into it?

from 01.

rbrisita avatar rbrisita commented on June 1, 2024

Correct but unfortunately, I can't be much help with Android. I suggest trying to get a Debian based OS and boot from USB or SD Card. Look into a pyenv tutorial to better understand its usage.

from 01.

hpsaturn avatar hpsaturn commented on June 1, 2024

Sorry, maybe my message was not clear, but I'm using Debian. Please review my previous messages. I'm not using Android for this, I'm trying to this development runs in Debian for first time..

from 01.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.