This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author GranPrego
Recipients GranPrego, eryksun, giampaolo.rodola, gregory.p.smith, paul.moore, steve.dower, tim.golden, zach.ware
Date 2018-05-23.11:18:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I'm now pretty convinced that sounddevice 0.3.11 library is the culprit, which may in turn point to the portaudio library, or CFFI.

I make a call to just before calling subprocess to run the dos cmd, the timing was such that process explorer would make it look like the leak was occurring during the subprocess call, but isolating the  shows that it causing the two additional Thread handles to be created and never released until the script ends (which could be 1-48 hours or more)

Another section of the code was using sd._terminate() and sd._initialize() to work around a buffersize problem with sounddevice and these calls also leak thread handles.

I've cut the program down as much as possible and the following now shows the problem without the call to subprocess.  You'll need to change the sd.default.device to an appropriate sound card.

Thanks for the quick responses.  If you're happy that this is the correct analysis of issue then perhaps it could be reclassified as a different component or I can get in touch with the sounddevice author.

Date User Action Args
2018-05-23 11:18:29GranPregosetrecipients: + GranPrego, gregory.p.smith, paul.moore, giampaolo.rodola, tim.golden, zach.ware, eryksun, steve.dower
2018-05-23 11:18:29GranPregosetmessageid: <>
2018-05-23 11:18:29GranPregolinkissue33603 messages
2018-05-23 11:18:29GranPregocreate