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

Does not work on Pipewire #4

Open
hegdenischay opened this issue May 16, 2023 · 0 comments · May be fixed by #5
Open

Does not work on Pipewire #4

hegdenischay opened this issue May 16, 2023 · 0 comments · May be fixed by #5

Comments

@hegdenischay
Copy link

I use pipewire as my audio backend, which supports ALSA with pipewire-alsa. Using python3.11 on ArchLinux, I get this error while trying to play anything:

Traceback (most recent call last):
  File "/home/tlh/myownstuff/directcheck/kiwiclient/kiwirecorder.py", line 10, in <module>
    from kiwi import KiwiSDRStream, KiwiWorker
  File "/home/tlh/myownstuff/directcheck/kiwiclient/kiwi/__init__.py", line 8, in <module>
    from .wavreader import *
  File "/home/tlh/myownstuff/directcheck/kiwiclient/kiwi/wavreader.py", line 11, in <module>
    class KiwiIQWavReader(collections.Iterator):
                          ^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'Iterator'

I fixed it by updating the code to use collections.abc, however, now I get yet another error, this time because of python-sounddevice.

Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2050
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->playback, outParams, self->primeBuffers, hwParamsPlayback, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2724
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2845
Traceback (most recent call last):
  File "/home/tlh/myownstuff/directcheck/kiwiclient/kiwirecorder.py", line 15, in <module>
    stream = sounddevice.OutputStream(12000, 2048, channels=1, dtype='int16')
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tlh/myownstuff/directcheck/.venv/lib/python3.11/site-packages/sounddevice.py", line 1494, in __init__
    _StreamBase.__init__(self, kind='output', wrap_callback='array',
  File "/home/tlh/myownstuff/directcheck/.venv/lib/python3.11/site-packages/sounddevice.py", line 898, in __init__
    _check(_lib.Pa_OpenStream(self._ptr, iparameters, oparameters,
  File "/home/tlh/myownstuff/directcheck/.venv/lib/python3.11/site-packages/sounddevice.py", line 2747, in _check
    raise PortAudioError(errormsg, err)
sounddevice.PortAudioError: Error opening OutputStream: Invalid sample rate [PaErrorCode -9997]

This seems to be a error because portaudio isn't able to find the right devices.

hegdenischay added a commit to hegdenischay/directKiwi that referenced this issue May 16, 2023
Also includes minor fixes for python3 > 3.9
@hegdenischay hegdenischay linked a pull request May 16, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant