sounddevice.query_devices() is returning nothing .
sounddevice.query_devices() is returning nothing .
portaudio version is V19.6.0-devel on WSL ( Ubuntu 18.04 LTS )
I assume you tried to receive the returned values or did print(sounddevice.query_devices())?
Hi, I've got the same issue.
Whenever I try to print(sounddevice.query_devices()) it returns nothing, and even python -m sounddevice returns nothing, even though I've got multiple input and output audio devices.
That is strange. Also no error message?
Are you certain you are using a sensible Python environment, where the package is installed?
@mgeier do you have any idea how to investigate further?
I don't know how audio devices work on WSL ...
Do other programs handle audio correctly?
Maybe there are some special permissions needed to access audio devices?
Is ALSA used on WSL? What does aplay -L say?
How did you install/compile PortAudio? Maybe some special build options are needed?
Did you try other things that use PortAudio, e.g. PyAudio or Audacity?
Anyway, the sounddevice module only shows the devices it gets from PortAudio, maybe you could ask those people: http://portaudio.com/contacts.html.
I just tried everything from scratch with a virtualenv, using python version 3.7.3 and pip version 21.0.1, and got the same result. I am also using WSL, so maybe that's the issue? I also can't install pyaudio using pip.
aplay -l leaves with long stack of ALSA-lib errors .
pyaudio.get_device_count() returns 0 as well
❯ aplay -L null Discard all samples (playback) or generate zero samples (capture) ❯ aplay -l aplay: device_list:276: no soundcards found...
>>> import sounddevice as sd >>> sd.query_devices()
>>> sd.get_portaudio_version() (1246976, 'PortAudio V19.7.0-devel, revision 147dd722548358763a8b649b3e4b41dfffbcfbb6')
Installing vlc (and maybe running) fixed this issue (not sure what happened but it's working now, maybe it actually was restarting my shell)
>>> import sounddevice as sd >>> sd.query_devices() 0 pulse, ALSA (32 in, 32 out) * 1 default, ALSA (32 in, 32 out)
I still getting no sound devices from nix-shell despite vlc working from nix