python-sounddevice icon indicating copy to clipboard operation
python-sounddevice copied to clipboard

Enable platform-specific features from PortAudio

Open mgeier opened this issue 9 years ago • 8 comments

See https://github.com/bastibe/PySoundCard/issues/16.

mgeier avatar Jul 23 '15 09:07 mgeier

One possible feature would be the "exclusive mode" of WASAPI, see http://stackoverflow.com/questions/31306010/how-to-enable-wasapi-exclusive-mode-in-pyaudio

mgeier avatar Jul 29 '15 14:07 mgeier

PaAlsa_EnableRealtimeScheduling might be interesting for ALSA: http://portaudio.com/docs/v19-doxydocs-dev/pa__linux__alsa_8h.html#accc41e7fd89dc0a6163d54a4f25fb242

mgeier avatar Mar 20 '16 11:03 mgeier

It would be interesting to be able to select arbitrary channels for input and output. On Windows this is needed with ASIO. If you currently want to send data to output channels 9 and 10, you have to send data to all channels below 11. This means that sharing the soundcard with other applications becomes impossible.

The hostapis WDM-KS, MME, Directsound, normally only present 2 channels so it is not a problem there.

raecke avatar Aug 08 '16 16:08 raecke

@raecke I created an experimental implementation in #34. Can you please check if it works for you and leave a comment there?

mgeier avatar Aug 09 '16 10:08 mgeier

There is also PaAlsa_SetNumPeriods, which is by default set to 4, which seems random:

By default the number of periods is 4, this is the lowest number of periods that works well on the author's soundcard.

http://portaudio.com/docs/v19-doxydocs-dev/pa__linux__alsa_8h.html#a76f60d6f1ba6a298c038a9f3a6dccc53

It looks like this has to be called before opening a stream.

mgeier avatar Jan 28 '17 11:01 mgeier

OK, I'm trying to make an exhaustive list of the current host-API-specific settings, let's see if that works:

hostApiSpecificStreamInfo to be specified separately for the input and output device when creating a stream:

Functions that are called with a stream pointer:

Global functions:

mgeier avatar Apr 28 '17 14:04 mgeier

Would love to be able to fetch PaAsio_GetInputChannelName and PaAsio_GetOutputChannelName though it looks like there hasn't been much movement on this feature?

philipmountifield avatar May 19 '20 13:05 philipmountifield

@philipmountifield Can you please create a new issue with your request, including a suggestion how the new API should look like?

mgeier avatar May 20 '20 18:05 mgeier