Skip to content

Raspberry Pi4 Buster : ValueError: Invalid chunk size: 0 #158

@varungujjar

Description

@varungujjar

Hey Guyz... some reason unable to get precise working on pi4 buster..

what I have tried:
Changing USB Posts
Pip reinstalling everything again (everything satisfies)
checking Alsa Sound Configuration
reinstalling portaudio

am using pyaudio with following config

audio = pyaudio.PyAudio()
self.audio_stream = audio.open(
format=pyaudio.paInt16,
channels=1,
rate=16000,
input=True,
frames_per_buffer=2048,
input_device_index=1 (my USB Sound Card)
)

while True:
self.stream.write(self.audio_stream.read(2048))

What Works
precise-listen <model_name> works perfectly fine

get the following error

Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/homie-agent/scripts/mycroft-precise/runner/precise_runner/runner.py", line 240, in _handle_predictions
prob = self.engine.get_prediction(chunk)
File "/home/pi/homie-agent/scripts/mycroft-precise/runner/precise_runner/runner.py", line 64, in get_prediction
raise ValueError('Invalid chunk size: ' + str(len(chunk)))
ValueError: Invalid chunk size: 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions