Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic usage #245

Open
mycomedico opened this issue Jan 8, 2025 · 4 comments
Open

basic usage #245

mycomedico opened this issue Jan 8, 2025 · 4 comments

Comments

@mycomedico
Copy link

I'm trying to run the basic example on my ubuntu 24.04 system and getting a bunch of errors as follows:

/home/rubing/PycharmProjects/spectrumcgm/PythonProject/.venv/bin/python /home/rubing/PycharmProjects/spectrumcgm/PythonProject/main.py
ALSA lib pcm_dmix.c:1000:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
Expression 'alsa_snd_pcm_hw_params_set_buffer_size_near( pcm, hwParams, &alsaBufferFrames )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 923
Expression 'alsa_snd_pcm_hw_params_set_buffer_size_near( pcm, hwParams, &alsaBufferFrames )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 923
Expression 'alsa_snd_pcm_hw_params_set_buffer_size_near( pcm, hwParams, &alsaBufferFrames )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 923
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
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 pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
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:1000:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 187, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 152, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 249, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 229, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 208, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 187, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 166, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 202, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 181, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 201, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 180, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 201, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 180, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 201, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 180, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 201, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 180, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 201, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 180, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 201, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 180, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 201, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 180, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 201, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 180, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 201, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 180, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 201, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 180, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 253, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 232, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 211, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 190, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 170, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 148, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 245, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 225, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 204, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 183, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 162, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 142, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 239, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 218, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 201, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 180, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 146, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 243, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 222, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 201, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 180, Frames in sub-chunk: 256
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 160, Frames in sub-chunk: 256
ALSA lib pcm.c:8740:(snd_pcm_recover) underrun occurred
Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 189, Frames in sub-chunk: 256
Exception ignored in: <module 'threading' from '/usr/lib/python3.12/threading.py'>
Traceback (most recent call last):
File "/usr/lib/python3.12/threading.py", line 1622, in _shutdown
lock.acquire()
KeyboardInterrupt:

Process finished with exit code 0

@KoljaB
Copy link
Owner

KoljaB commented Jan 8, 2025

The ALSA and Jack messages are just warnings and pretty common on most Linux setups, nothing to worry about.

The real issue is this one:

Wait aborted: Timeout of 0.1s exceeded. Buffer availability: 187, Frames in sub-chunk: 256

Try this fix (version 0.4.40):

stream = TextToAudioStream(engine, frames_per_buffer=256)

You might also want to check out the v0.4.40 release notes for more details.

@KoljaB
Copy link
Owner

KoljaB commented Jan 8, 2025

For context: it's pyaudio that brings in the ALSA and Jack warnings, so nearly every app using pyaudio in Python causes this.

@hapasa
Copy link

hapasa commented Jan 15, 2025

I was getting the same Wait aborted errors on ubuntu 24.04, which are gone with frames_per_buffer=256 parameter.
However, with:

from RealtimeTTS import TextToAudioStream, SystemEngine, CoquiEngine

engine = SystemEngine() # replace with your TTS engine
stream = TextToAudioStream(engine, frames_per_buffer=256)
stream.feed("Hello world! How are you today?")
stream.play_async()

I only hear "Hello world!", but not "How are you today?"
That may be SystemEngine issue, it sounds pretty terrible anyway.

@mycomedico
Copy link
Author

same for me!! also having issues streaming accross a network, i only get garbled sound at best from my client file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants