question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Anaconda: PyAudio install interferes with ASIO recognition

See original GitHub issue

I just wasted a couple of days looking into this issue. It seems that the Pyaudio/Portaudio install interferes with the python-sounddevice query_devices() function for ASIO devices. No matter what I did I could not see my ASIO drivers when performing the python-sounddevice query_device(). Even after I installed python-sounddevice with PIP and verified that it was returning the ASIO enable Portaudio version libportaudio64bit.dll with the get_portaudio_version() function. It wasn’t until I removed Pyaudio/Portaudio from my Anaconda install that I could see my ASIO devices.

Q1: Do I have a need for pyaudio if I have python-sounddevice? Q2: Is there a way to make these work together?

Here is my python-sounddevice Python program: Sounddevice_DeviceQuery.py

import sounddevice as sd
print(sd.query_devices())
print(sd.get_portaudio_version())
print(sd.query_hostapis())

from ctypes.util import find_library
print(find_library('portaudio'))
print(find_library('libportaudio64bit'))

Example output BEFORE Removal of Pyaudio/Portaudio

(base) Z:\Projects\Python>C:/Users/****/AppData/Local/Continuum/anaconda3/python.exe Z:/Projects/Python/Sounddevice_DeviceQuery.py
   0 Microsoft Sound Mapper - Input, MME (2 in, 0 out)
>  1 Focusrite USB (Focusrite USB Au, MME (8 in, 0 out)
   2 Microphone (HD Webcam C310), MME (1 in, 0 out)
   3 Microsoft Sound Mapper - Output, MME (0 in, 2 out)
<  4 Focusrite USB (Focusrite USB Au, MME (0 in, 8 out)
   5 FrontMic (Realtek HD Audio Front Mic input), Windows WDM-KS (2 in, 0 out)
   6 Stereo Mix (Realtek HD Audio Stereo input), Windows WDM-KS (2 in, 0 out)
   7 Speakers (Realtek HD Audio output), Windows WDM-KS (0 in, 2 out)
   8 Output (), Windows WDM-KS (0 in, 2 out)
   9 Output (), Windows WDM-KS (0 in, 2 out)
  10 Microphone (HD Webcam C310), Windows WDM-KS (1 in, 0 out)
  11 Focusrite USB (fniusbwave_48), Windows WDM-KS (8 in, 0 out)
  12 Analog Out (fniusbwave_48), Windows WDM-KS (0 in, 8 out)
(1246720, 'PortAudio V19.6.0-devel, revision 396fe4b6699ae929d3a685b3ef8a7e97396139a4')
({'name': 'MME', 'devices': [0, 1, 2, 3, 4], 'default_input_device': 1, 'default_output_device': 4}, {'name': 'Windows WDM-KS', 'devices': [5, 6, 7, 8, 9, 10, 11, 12], 'default_input_device': 11, 'default_output_device': 12})
Z:\Users\****\AppData\Local\Continuum\anaconda3\Library\bin\portaudio.dll
None

Example output AFTER Removal of Pyaudio/Portaudio

(base) H:\Projects\Python>Z:/Users/****/AppData/Local/Continuum/anaconda3/python.exe Z:/Projects/Python/Sounddevice_DeviceQuery.py
   0 Microsoft Sound Mapper - Input, MME (2 in, 0 out)
>  1 Focusrite USB (Focusrite USB Au, MME (2 in, 0 out)
   2 Microphone (HD Webcam C310), MME (2 in, 0 out)
   3 Microsoft Sound Mapper - Output, MME (0 in, 2 out)
<  4 Focusrite USB (Focusrite USB Au, MME (0 in, 2 out)
   5 Primary Sound Capture Driver, Windows DirectSound (2 in, 0 out)
   6 Focusrite USB (Focusrite USB Audio), Windows DirectSound (2 in, 0 out)
   7 Microphone (HD Webcam C310), Windows DirectSound (2 in, 0 out)
   8 Primary Sound Driver, Windows DirectSound (0 in, 2 out)
   9 Focusrite USB (Focusrite USB Audio), Windows DirectSound (0 in, 2 out)
  10 ASIO4ALL v2, ASIO (2 in, 2 out)
  11 Focusrite USB ASIO, ASIO (6 in, 4 out)
  12 Focusrite USB (Focusrite USB Audio), Windows WASAPI (0 in, 2 out)
  13 Focusrite USB (Focusrite USB Audio), Windows WASAPI (2 in, 0 out)
  14 Microphone (HD Webcam C310), Windows WASAPI (1 in, 0 out)
  15 FrontMic (Realtek HD Audio Front Mic input), Windows WDM-KS (2 in, 0 out)
  16 Stereo Mix (Realtek HD Audio Stereo input), Windows WDM-KS (2 in, 0 out)
  17 Speakers (Realtek HD Audio output), Windows WDM-KS (0 in, 2 out)
  18 Output (), Windows WDM-KS (0 in, 2 out)
  19 Output (), Windows WDM-KS (0 in, 2 out)
  20 Microphone (HD Webcam C310), Windows WDM-KS (1 in, 0 out)
  21 Focusrite USB (fniusbwave_48), Windows WDM-KS (8 in, 0 out)
  22 Analog Out (fniusbwave_48), Windows WDM-KS (0 in, 8 out)
(1246720, 'PortAudio V19.6.0-devel, revision 396fe4b6699ae929d3a685b3ef8a7e97396139a4')
({'name': 'MME', 'devices': [0, 1, 2, 3, 4], 'default_input_device': 1, 'default_output_device': 4}, {'name': 'Windows DirectSound', 'devices': [5, 6, 7, 8, 9], 'default_input_device': 5, 'default_output_device': 8}, {'name': 'ASIO', 'devices': [10, 11], 'default_input_device': 10, 'default_output_device': 10}, {'name': 'Windows WASAPI', 'devices': [12, 13, 14], 'default_input_device': 13, 'default_output_device': 12}, {'name': 'Windows WDM-KS', 'devices': [15, 16, 17, 18, 19, 20, 21, 22], 'default_input_device': 21, 'default_output_device': 22})
None
None

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mgeiercommented, May 25, 2020

Thanks @neilser, that’s good to know.

The path containing _sounddevice_data shows that the pre-packaged library from _sounddevice_data is used.

When installing the library with conda, the path would be different.

0reactions
bburancommented, Dec 9, 2021

I just ran into this issue. Is there a reason why the package available on pypi is able to include portaudio compiled with ASIO support built-in, but the conda version cannot? Does this have to do with the fact that the conda-forge feedstock recipe would need to include the SDK as part of the repo to enable the automated builds?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing Pyaudio Without Errors in Anaconda and ... - YouTube
Hello Fellow Coders, I hope you will now be able to install Pyaudio with out any errors and I hope you will then...
Read more >
build pyaudio with portaudio with ASIO support - Stack Overflow
I solved the problem by coping the portaudio DLL to the directory of pyaudio library ... Installing pyaudio to work with cygwin's python...
Read more >
Python Extension Packages for Windows - Christoph Gohlke
Install numpy+mkl before other packages that depend on it. The binaries are compatible with the most recent official CPython distributions on ...
Read more >
Pyaudio :: Anaconda.org
conda install -c anaconda pyaudio. Description. With PyAudio, you can easily use Python to play and record audio on a variety of platforms, ......
Read more >
PyAudio - PyPI
In summary, install PyAudio using pip on most platforms. ... It does not include support for ASIO. ... brew install portaudio pip install...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found