Open miguelhg9211 opened 6 months ago
The mystical fix called out here of importing sounddevice fixed all the ALSA errors for me on Ubuntu 23.10 (Raspberry Pi)
Have you tried this fix @miguelhg9211?
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
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:
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.
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.
@rbrisita That fixed it indeed, wonderful work. You should PR this π
@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.
@rbrisita That fixed it indeed, wonderful work. You should PR this π
Created!
@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.
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?
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.
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..
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.
Describe the bug A clear and concise description of what the bug is.ALSA lib pcm_dsnoop.c:601:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card' ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card' ALSA lib pcm_dmix.c:1032:(snd_pcm_dmix_open) unable to open slave