bastibe / SoundCard

A Pure-Python Real-Time Audio Library
https://soundcard.readthedocs.io
BSD 3-Clause "New" or "Revised" License
680 stars 69 forks source link

return pulseaudio errno exception on stream creation failure #104

Closed rikvanriel closed 4 years ago

rikvanriel commented 4 years ago

Make the pa_context_errno call available in SoundCard, so we can better debug what is going wrong with pulseaudio.

Signed-off-by: Rik van Riel riel@surriel.com

rikvanriel commented 4 years ago

I'm using this to figure out what may be going wrong with pulseaudio.

The other bits of debug code are somewhat ugly and specific to what I'm doing now, but having this export made sense to me.

rikvanriel commented 4 years ago

The code that throws an exception when pa_stream_new fails to set up a stream works. Please merge this pull request.

rikvanriel commented 4 years ago

It looks like, in the two failures I have seen over the past few days, _pulse._pa_stream_new returns 3 (PA_ERR_INVALID), which suggests either the channel map or sample spec was set up wrong, despite both having been verified above.

bastibe commented 4 years ago

Thank you for your contribution! This will hopefully help us to finally fix that initialization error.