pyalsaaudio
pyalsaaudio copied to clipboard
How to check card state (number of channels, current rate)
In light of PCM.setchannels(nchannels) and PCM.settrate(rate) API depreciation, there is a usecase for getchannel() and getrate() API, since it is useful to know if the rate\channel configuration, set during PCM() object construct was actually applied by the card.
Right now, one can just check the return value of PCM.setchannels(nchannels) and PCM.settrate(rate) to see if configuration issue has occurred.
pcm objects actually have info() and dumpinfo() functions that provide the data you're looking for. they are just missing from the documentation ...