Bug 2238746
Summary: | playing sounds with pyaudio sometimes hangs | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Mike FABIAN <mfabian> | ||||
Component: | pyaudio | Assignee: | Christian Krause <chkr> | ||||
Status: | CLOSED WORKSFORME | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 38 | CC: | chkr, mfabian | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2023-11-04 09:56:16 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Mike FABIAN
2023-09-13 13:07:19 UTC
Created attachment 1988650 [details]
pyaudio-test-trigger-hang.py
Test script to reproduce the problem.
Comment copied from: https://bugzilla.redhat.com/show_bug.cgi?id=2238132#c12 Christian Krause> I can reproduce similar issues (see below). Anyway, I suggest a new bug report as well. Let's keep using this one for the update and fixing the issue that the package didn't work at all. Christian Krause> Christian Krause> Just to double-check: Do you see the same issues with your own local builds of pyaudio? Christian Krause> Christian Krause> > I can quite easily reproduce the hang using your latest build on Fedora 38: Christian Krause> > https://koji.fedoraproject.org/koji/buildinfo?buildID=2287903 Christian Krause> Christian Krause> A few notes from my tests: Christian Krause> - works worse if there are other active audio players (e.g. a browser): lots of stutter, sometimes hanging pyaudio Christian Krause> - I tried using mpg123 with portaudio plugin (to test the underlying portaudio library): issues couldn't be reproduced Hi @mfabian I did a little bit of investigation: In many examples the open call to create a stream used an additional parameter: "frames_per_buffer" (reference: https://www.portaudio.com/docs/v19-doxydocs/portaudio_8h.html#a443ad16338191af364e3be988014cbbe). The value should correspond with the number of frames which are read (and written) at the same time. So in the example you attached to the bug report, try something like this: stream = p.open( format=p.get_format_from_width(wf.getsampwidth()), channels=wf.getnchannels(), rate=wf.getframerate(), output=True, frames_per_buffer=1024 ) For me, that fixed it. Please let me know whether it solves the issue on your side as well. Most likely the problem is fixed by a slightly different usage of the API of pyaudio (see comment #3). Since there was no feedback since a month, I'll close the bug as WORKSFORME now. The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days |