Comments (41)
OK, copying and renaming portaudio_x86.dll in ReleaseMinDependency first and it seemed to work:
C:\Users\stu\AppData\Local\Programs\Python\Python35-32\Lib\site-packages\_sounddevice_data>python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sounddevice
before paHostApiInitializers[0].
after paHostApiInitializers[0].
before paHostApiInitializers[1].
PA - PlatformId = 0x2
PA - MajorVersion = 0xa
PA - MinorVersion = 0x0
PA - PlatformId = 0x2
PA - MajorVersion = 0xa
PA - MinorVersion = 0x0
PA - PlatformId = 0x2
PA - MajorVersion = 0xa
PA - MinorVersion = 0x0
PA - PlatformId = 0x2
PA - MajorVersion = 0xa
PA - MinorVersion = 0x0
PA - PlatformId = 0x2
PA - MajorVersion = 0xa
PA - MinorVersion = 0x0
PA - PlatformId = 0x2
PA - MajorVersion = 0xa
PA - MinorVersion = 0x0
after paHostApiInitializers[1].
before paHostApiInitializers[2].
after paHostApiInitializers[2].
before paHostApiInitializers[3].
WASAPI: device idx: 00
WASAPI: ---------------
WASAPI:0| name[Speakers (VMware VMaudio (VMAUDIO) (WDM))]
WASAPI:0| form-factor[1]
WASAPI:0| def.SR[44100] max.CH[2] latency{hi[0.010000] lo[0.010000]}
WASAPI: device idx: 01
WASAPI: ---------------
WASAPI:1| name[Phone Line (VMware VMaudio (VMAUDIO) (WDM))]
WASAPI:1| form-factor[6]
WASAPI:1| def.SR[44100] max.CH[1] latency{hi[0.010000] lo[0.010000]}
WASAPI: device idx: 02
WASAPI: ---------------
WASAPI:2| name[Line In (VMware VMaudio (VMAUDIO) (WDM))]
WASAPI:2| form-factor[2]
WASAPI:2| def.SR[44100] max.CH[2] latency{hi[0.010000] lo[0.010000]}
WASAPI: device idx: 03
WASAPI: ---------------
WASAPI:3| name[Microphone (VMware VMaudio (VMAUDIO) (WDM))]
WASAPI:3| form-factor[4]
WASAPI:3| def.SR[44100] max.CH[1] latency{hi[0.010000] lo[0.010000]}
WASAPI: initialized ok
after paHostApiInitializers[3].
before paHostApiInitializers[4].
Setup called
Enum called
noError = 0
Enum called
noError = 1
Device 1 has render alias
Device 1 has capture alias
Enum called
Interfaces found: 1
Device 1 has render alias
Device 1 has capture alias
Interface 1, Name: V
FilterNew: Creating filter 'VMware VMaudio'
FilterNew: Opening filter...
DumpConnectionsAndNodes: connections=6, nodes=3
Connection: 0 - FromNode=4294967295,FromPin=0 -> ToNode=0,ToPin=1
Connection: 1 - FromNode=0,FromPin=0 -> ToNode=4294967295,ToPin=1
Connection: 2 - FromNode=4294967295,FromPin=3 -> ToNode=1,ToPin=1
Connection: 3 - FromNode=1,FromPin=0 -> ToNode=4294967295,ToPin=2
Connection: 4 - FromNode=4294967295,FromPin=5 -> ToNode=2,ToPin=1
Connection: 5 - FromNode=2,FromPin=0 -> ToNode=4294967295,ToPin=4
Node: 0 - {507AE360-C554-11D0-8A2B-00A0C9255AC1}
Node: 1 - {4D837FE0-C555-11D0-8A2B-00A0C9255AC1}
Node: 2 - {4D837FE0-C555-11D0-8A2B-00A0C9255AC1}
PinNew: Creating pin 0:
PinNew: Checking 7 no of dataranges...
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: Default sample rate = 44100 Hz
PinNew: Finding topology pin...
FindStartConnectionTo: Checking 6 connections...GetConnectedPin: count=3, forward=1, muxPosition=-
GetConnectionTo: Checking 6 connections... (pFrom = 00F09B58)GetConnectionTo: Returning 00F09B68
PinNew: Getting physical connection...
PinNew: Physical connection found!
PinNew: Creating topology filter '\\?\PCI#VEN_1274&DEV_1371&SUBSYS_13711274&REV_02#4&bbf9765&0&208
FilterNew: Creating filter ''
FilterNew: Opening filter...
DumpConnectionsAndNodes: connections=37, nodes=24
Connection: 0 - FromNode=4294967295,FromPin=0 -> ToNode=0,ToPin=1
Connection: 1 - FromNode=0,FromPin=0 -> ToNode=1,ToPin=1
Connection: 2 - FromNode=1,FromPin=0 -> ToNode=23,ToPin=1
Connection: 3 - FromNode=4294967295,FromPin=1 -> ToNode=2,ToPin=1
Connection: 4 - FromNode=2,FromPin=0 -> ToNode=3,ToPin=1
Connection: 5 - FromNode=3,FromPin=0 -> ToNode=23,ToPin=7
Connection: 6 - FromNode=4294967295,FromPin=1 -> ToNode=22,ToPin=1
Connection: 7 - FromNode=22,FromPin=0 -> ToNode=16,ToPin=6
Connection: 8 - FromNode=4294967295,FromPin=2 -> ToNode=4,ToPin=1
Connection: 9 - FromNode=4,FromPin=0 -> ToNode=5,ToPin=1
Connection: 10 - FromNode=5,FromPin=0 -> ToNode=23,ToPin=2
Connection: 11 - FromNode=4294967295,FromPin=2 -> ToNode=17,ToPin=1
Connection: 12 - FromNode=17,FromPin=0 -> ToNode=16,ToPin=1
Connection: 13 - FromNode=4294967295,FromPin=3 -> ToNode=6,ToPin=1
Connection: 14 - FromNode=6,FromPin=0 -> ToNode=7,ToPin=1
Connection: 15 - FromNode=7,FromPin=0 -> ToNode=23,ToPin=3
Connection: 16 - FromNode=4294967295,FromPin=3 -> ToNode=21,ToPin=1
Connection: 17 - FromNode=21,FromPin=0 -> ToNode=16,ToPin=5
Connection: 18 - FromNode=4294967295,FromPin=4 -> ToNode=8,ToPin=1
Connection: 19 - FromNode=8,FromPin=0 -> ToNode=9,ToPin=1
Connection: 20 - FromNode=9,FromPin=0 -> ToNode=23,ToPin=4
Connection: 21 - FromNode=4294967295,FromPin=4 -> ToNode=18,ToPin=1
Connection: 22 - FromNode=18,FromPin=0 -> ToNode=16,ToPin=2
Connection: 23 - FromNode=4294967295,FromPin=5 -> ToNode=10,ToPin=1
Connection: 24 - FromNode=10,FromPin=0 -> ToNode=11,ToPin=1
Connection: 25 - FromNode=11,FromPin=0 -> ToNode=23,ToPin=5
Connection: 26 - FromNode=4294967295,FromPin=5 -> ToNode=19,ToPin=1
Connection: 27 - FromNode=19,FromPin=0 -> ToNode=16,ToPin=3
Connection: 28 - FromNode=4294967295,FromPin=6 -> ToNode=12,ToPin=1
Connection: 29 - FromNode=12,FromPin=0 -> ToNode=13,ToPin=1
Connection: 30 - FromNode=13,FromPin=0 -> ToNode=23,ToPin=6
Connection: 31 - FromNode=4294967295,FromPin=6 -> ToNode=20,ToPin=1
Connection: 32 - FromNode=20,FromPin=0 -> ToNode=16,ToPin=4
Connection: 33 - FromNode=23,FromPin=0 -> ToNode=14,ToPin=1
Connection: 34 - FromNode=14,FromPin=0 -> ToNode=15,ToPin=1
Connection: 35 - FromNode=15,FromPin=0 -> ToNode=4294967295,ToPin=7
Connection: 36 - FromNode=16,FromPin=0 -> ToNode=4294967295,ToPin=9
Node: 0 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 1 - {02B223C0-C557-11D0-8A2B-00A0C9255AC1}
Node: 2 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 3 - {02B223C0-C557-11D0-8A2B-00A0C9255AC1}
Node: 4 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 5 - {02B223C0-C557-11D0-8A2B-00A0C9255AC1}
Node: 6 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 7 - {02B223C0-C557-11D0-8A2B-00A0C9255AC1}
Node: 8 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 9 - {02B223C0-C557-11D0-8A2B-00A0C9255AC1}
Node: 10 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 11 - {02B223C0-C557-11D0-8A2B-00A0C9255AC1}
Node: 12 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 13 - {02B223C0-C557-11D0-8A2B-00A0C9255AC1}
Node: 14 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 15 - {02B223C0-C557-11D0-8A2B-00A0C9255AC1}
Node: 16 - {2CEAF780-C556-11D0-8A2B-00A0C9255AC1}
Node: 17 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 18 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 19 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 20 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 21 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 22 - {3A5ACC00-C557-11D0-8A2B-00A0C9255AC1}
Node: 23 - {DA441A60-C556-11D0-8A2B-00A0C9255AC1}
PinNew: Opening topology filter...PinNew: Checking for output endpoint pin id...
FindStartConnectionTo: Checking 37 connections...GetConnectedPin: count=24, forward=1, muxPosition
GetConnectionTo: Checking 37 connections... (pFrom = 03989FB8)GetConnectionTo: Returning 03989FC8
GetConnectedPin: count=24, forward=1, muxPosition=-1
GetConnectionTo: Checking 37 connections... (pFrom = 03989FC8)GetConnectionTo: Returning 03989FD8
GetConnectedPin: count=24, forward=1, muxPosition=-1
GetConnectionTo: Checking 37 connections... (pFrom = 03989FD8)GetConnectionTo: Returning 0398A1C8
GetConnectedPin: count=24, forward=1, muxPosition=-1
GetConnectionTo: Checking 37 connections... (pFrom = 0398A1C8)GetConnectionTo: Returning 0398A1D8
GetConnectedPin: count=24, forward=1, muxPosition=-1
GetConnectionTo: Checking 37 connections... (pFrom = 0398A1D8)GetConnectionTo: Returning 0398A1E8
PinNew: Found endpoint pin id 7
GetNameFromCategory: USB GUID 0301 -> 'Speakers'
PinNew: Pin name 'Speakers'
PinNew: Releasing topology filter...
Pin created successfully
PinNew: Creating pin 1:
PinNew: Not source/sink
PinNew: Error -9996
PinNew: Creating pin 2:
PinNew: Checking 7 no of dataranges...
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 2
PinNew: Format PCM 8 bit supported
PinNew: Format PCM 16 bit supported
PinNew: Default sample rate = 44100 Hz
PinNew: Finding topology pin...
FindStartConnectionFrom: Checking 6 connections...GetConnectedPin: count=3, forward=0, muxPosition
GetConnectionFrom: Checking 6 connections... (pTo = 00F09B88)
GetConnectionFrom: Returning 00F09B78
PinNew: Getting physical connection...
PinNew: Physical connection found!
PinNew: Opening topology filter...PinNew: Checking for input endpoint pin id (0)...
FindStartConnectionFrom: Checking 37 connections...GetConnectedPin: count=24, forward=0, muxPositi
GetNumberOfConnectionsTo: Checking 37 connections...GetConnectionFrom: Checking 37 connections...
GetConnectionFrom: Returning 0398A028
GetConnectionFrom: Checking 37 connections... (pTo = 0398A028)
GetConnectionFrom: Returning 0398A018
PinNew: Found endpoint pin id 1
PinNew: Checking for input endpoint pin id (1)...
FindStartConnectionFrom: Checking 37 connections...GetConnectedPin: count=24, forward=0, muxPositi
GetNumberOfConnectionsTo: Checking 37 connections...GetConnectionFrom: Checking 37 connections...
GetConnectionFrom: Returning 0398A078
GetConnectionFrom: Checking 37 connections... (pTo = 0398A078)
GetConnectionFrom: Returning 0398A068
PinNew: Found endpoint pin id 2
GetNameFromCategory: USB GUID 0201 -> 'Microphone'
PinNew: Checking for input endpoint pin id (2)...
FindStartConnectionFrom: Checking 37 connections...GetConnectedPin: count=24, forward=0, muxPositi
GetNumberOfConnectionsTo: Checking 37 connections...GetConnectionFrom: Checking 37 connections...
GetConnectionFrom: Returning 0398A0C8
GetConnectionFrom: Checking 37 connections... (pTo = 0398A0C8)
GetConnectionFrom: Returning 0398A0B8
PinNew: Found endpoint pin id 3
GetNameFromCategory: USB GUID 0603 -> 'Line'
PinNew: Checking for input endpoint pin id (3)...
FindStartConnectionFrom: Checking 37 connections...GetConnectedPin: count=24, forward=0, muxPositi
GetNumberOfConnectionsTo: Checking 37 connections...GetConnectionFrom: Checking 37 connections...
GetConnectionFrom: Returning 0398A118
GetConnectionFrom: Checking 37 connections... (pTo = 0398A118)
GetConnectionFrom: Returning 0398A108
PinNew: Found endpoint pin id 4
PinNew: Checking for input endpoint pin id (4)...
FindStartConnectionFrom: Checking 37 connections...GetConnectedPin: count=24, forward=0, muxPositi
GetNumberOfConnectionsTo: Checking 37 connections...GetConnectionFrom: Checking 37 connections...
GetConnectionFrom: Returning 0398A168
GetConnectionFrom: Checking 37 connections... (pTo = 0398A168)
GetConnectionFrom: Returning 0398A158
PinNew: Found endpoint pin id 5
GetNameFromCategory: USB GUID 0601 -> 'Analog'
PinNew: Checking for input endpoint pin id (5)...
FindStartConnectionFrom: Checking 37 connections...GetConnectedPin: count=24, forward=0, muxPositi
GetNumberOfConnectionsTo: Checking 37 connections...GetConnectionFrom: Checking 37 connections...
GetConnectionFrom: Returning 0398A1B8
GetConnectionFrom: Checking 37 connections... (pTo = 0398A1B8)
GetConnectionFrom: Returning 0398A1A8
PinNew: Found endpoint pin id 6
GetNameFromCategory: USB GUID 0601 -> 'Analog'
PinNew: Checking for input endpoint pin id (6)...
FindStartConnectionFrom: Checking 37 connections...GetConnectedPin: count=24, forward=0, muxPositi
GetNumberOfConnectionsTo: Checking 37 connections...GetConnectionFrom: Checking 37 connections...
GetConnectionFrom: Returning 00000000
PinNew: Done with inputs.
PinNew: Setting up 4 inputs
PinNew: Setting up input 0...
FindStartConnectionFrom: Checking 37 connections...GetConnectedPin: count=24, forward=0, muxPositi
GetNumberOfConnectionsTo: Checking 37 connections...GetConnectionFrom: Checking 37 connections...
GetConnectionFrom: Returning 0398A028
GetConnectionFrom: Checking 37 connections... (pTo = 0398A028)
GetConnectionFrom: Returning 0398A018
PinNew: Input (0) friendly name 'Phone Line'
PinNew: Setting up input 1...
FindStartConnectionFrom: Checking 37 connections...GetConnectedPin: count=24, forward=0, muxPositi
GetNumberOfConnectionsTo: Checking 37 connections...GetConnectionFrom: Checking 37 connections...
GetConnectionFrom: Returning 0398A078
GetConnectionFrom: Checking 37 connections... (pTo = 0398A078)
GetConnectionFrom: Returning 0398A068
PinNew: Input (1) friendly name 'Microphone'
PinNew: Setting up input 2...
FindStartConnectionFrom: Checking 37 connections...GetConnectedPin: count=24, forward=0, muxPositi
GetNumberOfConnectionsTo: Checking 37 connections...GetConnectionFrom: Checking 37 connections...
GetConnectionFrom: Returning 0398A0C8
GetConnectionFrom: Checking 37 connections... (pTo = 0398A0C8)
GetConnectionFrom: Returning 0398A0B8
PinNew: Input (2) friendly name 'Line In'
PinNew: Setting up input 3...
FindStartConnectionFrom: Checking 37 connections...GetConnectedPin: count=24, forward=0, muxPositi
GetNumberOfConnectionsTo: Checking 37 connections...GetConnectionFrom: Checking 37 connections...
GetConnectionFrom: Returning 0398A118
GetConnectionFrom: Checking 37 connections... (pTo = 0398A118)
GetConnectionFrom: Returning 0398A108
PinNew: Input (3) friendly name 'CD Audio'
PinNew: Releasing topology filter...
Pin created successfully
PinNew: Creating pin 3:
PinNew: Not source/sink
PinNew: Error -9996
PinNew: Creating pin 4:
PinNew: Checking 4 no of dataranges...
PinNew: DR major format 73647561
PinNew: MaxChannel: 1
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 1
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 1
PinNew: Format PCM 16 bit supported
PinNew: DR major format 73647561
PinNew: MaxChannel: 1
PinNew: Format PCM 16 bit supported
PinNew: Default sample rate = 48000 Hz
PinNew: Finding topology pin...
FindStartConnectionFrom: Checking 6 connections...GetConnectedPin: count=3, forward=0, muxPosition
GetConnectionFrom: Checking 6 connections... (pTo = 00F09BA8)
GetConnectionFrom: Returning 00F09B98
PinNew: Getting physical connection...
PinNew: Physical connection found!
PinNew: Opening topology filter...PinNew: Checking for input endpoint pin id (0)...
FindStartConnectionFrom: Checking 37 connections...PinNew: Done with inputs.
PinNew: Input friendly name 'Input'
PinNew: Releasing topology filter...
Pin created successfully
PinNew: Creating pin 5:
PinNew: Not source/sink
PinNew: Error -9996
Filter (WaveCyclic) created with 3 valid pins (total I/Os: 6)
after paHostApiInitializers[4].
>>>
from python-sounddevice.
Those don't seem to support WDM-KS, and your error was there ...
Could you please try those: https://github.com/adfernandes/precompiled-portaudio-windows?
I don't want to disable WDM-KS in the pre-packaged DLLs, because on some (most?) systems it works fine and as I understand it's one of the more professional (i.e. low latency) backends.
from python-sounddevice.
@Maneesh3 Please note that the link you are recommending points to an older PortAudio version.
It would probably better to recommend Christoph Gohlke's DLLs instead: http://www.lfd.uci.edu/~gohlke/pythonlibs/#sounddevice
Those are also easier to install by simply using pip
. The previous installation can be uninstalled with pip uninstall sounddevice
.
from python-sounddevice.
Hmmm, I have no idea what's going wrong here ... but that may be because I have no clue about Windows and its sound architectures at all.
I've just tried it on Windows 7 64bit and I didn't experience the crash:
C:\Users\ilovewindows>python
Python 3.3.2 |Continuum Analytics, Inc.| (default, May 17 2013, 11:32:27) [MSC v
.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sounddevice
>>>
Does anyone else get the assertion error?
from python-sounddevice.
Realised I should have specified that this is Win10 .. it should be sufficient to try in one of the trial win VMs that ms provide for testing, like those on dev.modern.ie.
from python-sounddevice.
Doh - silly me - I am on python 2.7.10 - you are testing 3.3.2
from python-sounddevice.
I didn't think that the Python version matters, because the error is directly in the PortAudio library.
.. it should be sufficient to try in one of the trial win VMs that ms provide for testing, like those on dev.modern.ie
Thanks for the hint, I didn't know they offer such images, that's quite useful.
However, I don't get my audio device recognized in the virtual machine (using VirtualBox, where I did activate the audio device), it always just shows "No audio devices are installed".
Importing sounddevice
works without error, but of course there are no devices available ...
Any idea how I could get the audio device working?
Anyway, if somebody wants to get into this, here's the code with the assert()
in question:
static const KSTOPOLOGY_CONNECTION* FindStartConnectionFrom(ULONG startPin, PaWinWdmFilter* filter)
{
unsigned i;
const KSTOPOLOGY_CONNECTION* connections = (const KSTOPOLOGY_CONNECTION*)(filter->connections + 1);
PA_DEBUG(("FindStartConnectionFrom: Checking %u connections...", filter->connections->Count));
for (i = 0; i < filter->connections->Count; ++i)
{
const KSTOPOLOGY_CONNECTION* pConn = connections + i;
if (pConn->ToNode == KSFILTER_NODE && pConn->ToNodePin == startPin)
{
return pConn;
}
}
assert(FALSE);
return 0;
}
For the full code have a look at https://www.assembla.com/spaces/portaudio/subversion/source/HEAD/portaudio/trunk/src/hostapi/wdmks/pa_win_wdmks.c (but note that the pre-packaged DLL uses older code http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz).
from python-sounddevice.
OK, I got it to work, I just changed the "Audio Controller" in the VirtualBox settings from the default "ICH AC97" to "Intel HD Audio".
from python-sounddevice.
I just tried it on the virtual machine with Windows 10, it works there, too:
C:\Users\IEUser>python
Python 2.7.10 |Anaconda 2.3.0 (64-bit)| (default, May 28 2015, 16:44:52) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
>>> import sounddevice
>>>
I tried only playback (because I currently don't have a mic connected) and it works for MME, DirectSound, WASAPI and WDM-KS.
I even installed ASIO4ALL, which plays a strangely distorted sound, so there seems to be another issue ...
from python-sounddevice.
Ah, I'm using VMWare - (sound in vbox was wrong in Ableton)..
Yeah - I also had weird sound with Asio4All in vbox - it was playing everything 1/2 speed !
from python-sounddevice.
I just tried it on Windows 7 on a real laptop with a real soundcard and a real ASIO driver, where it sounds perfectly fine.
So I guess this is an issue with ASIO4ALL and/or virtualization.
But back to your original problem ...
Do other PortAudio applications (e.g. Audacity) work on your (virtual?) setup?
Since this happens during initialization, I suspect that it's a general problem with PortAudio, there isn't really anything much done in Python at this point ...
You could probably try writing a minimal PortAudio application in C and switch on all debugging features to see what's the problem.
from python-sounddevice.
Audacity (2.1.1 - 32 bit - installed from chocolatey) seems to open and play an mp3 using
the 3 backends - WASAP, Directsound and MMI
I can't find a portaudio dll in audacity, otherwise I'd try swapping it in + see what happens.
So - on python 3.5.0 32 bit (I switched in the meantime).. .I tried swapping in the dll from here
https://code.google.com/p/portaudiosharp/downloads/detail?name=PortAudio.dll
and it doesn't crash when I import sounddevice now..
from python-sounddevice.
Trying the version in 'Release' didn't work - do I need more than just the dll ?
C:\Users\stu\AppData\Local\Programs\Python\Python35-32\Lib\site-packages\_sounddevice_data>python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sounddevice
Traceback (most recent call last):
File "C:\Users\stu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\sounddevice.py", line 228, in <module>
_lib = _ffi.dlopen('portaudio')
File "C:\Users\stu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\cffi\api.py", line 127, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "C:\Users\stu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\cffi\api.py", line 606, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "C:\Users\stu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\cffi\api.py", line 594, in _load_backend_lib
raise OSError("library not found: %r" % (name,))
OSError: library not found: 'portaudio'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\stu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\cffi\api.py", line 595, in _load_backend_lib
return backend.load_library(name, flags)
OSError: cannot load library C:\Users\stu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_sounddevice_data\libportaudio32bit.dll: error 0x7e
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\stu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\sounddevice.py", line 239, in <module>
_libname
File "C:\Users\stu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\cffi\api.py", line 127, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "C:\Users\stu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\cffi\api.py", line 606, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "C:\Users\stu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\cffi\api.py", line 601, in _load_backend_lib
return backend.load_library(path, flags)
OSError: cannot load library C:\Users\stu\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_sounddevice_data\libportaudio32bit.dll: error 0x7e
from python-sounddevice.
I think "ReleaseMinDependency" is the recommended version, the others might need additional libraries.
Does WDM-KS work in the first case?
I can't really see that in all the debug output ...
from python-sounddevice.
Ah, I have no idea if it WDM-KS works on that or not - it seems to have something about WDM, but not WDM-KS..
It didn't crash python on importing sounddevice, which is the most important thing to me. I'll see if I can try some examples that actually do something.
from python-sounddevice.
Check out print_devices(), this lists the devices together with their host APIs.
You can also get the same thing with
python -m sounddevice
If WDM-KS is supported, it would be interesting if/how I could change my DLLs in a way that they will work, too.
from python-sounddevice.
You only have this error on Windows 10 and only if it runs on VMware, right?
from python-sounddevice.
Yup - the title would seem to be accurate now - Windows 10 in VMWare Player (the free one) is the only windows I have right now..
[OT]
TBH, I'd convert back to vbox if the sound wasn't so borked in there - it's only so I can try ableton lite with a gizmo I bought... apart from the sound working, it doesn't work super well and slows down my computer :/
[/OT]
from python-sounddevice.
Here is the output of print_devices()
0 Microsoft Sound Mapper - Input, MME (2 in, 0 out)
> 1 Microphone (VMware VMaudio (VMA, MME (2 in, 0 out)
2 Phone Line (VMware VMaudio (VMA, MME (2 in, 0 out)
3 Line In (VMware VMaudio (VMAUDI, MME (2 in, 0 out)
4 Microsoft Sound Mapper - Output, MME (0 in, 2 out)
< 5 Speakers (VMware VMaudio (VMAUD, MME (0 in, 2 out)
6 Primary Sound Capture Driver, Windows DirectSound (2 in, 0 out)
7 Microphone (VMware VMaudio (VMAUDIO) (WDM)), Windows DirectSound (2 in, 0 out)
8 Phone Line (VMware VMaudio (VMAUDIO) (WDM)), Windows DirectSound (2 in, 0 out)
9 Line In (VMware VMaudio (VMAUDIO) (WDM)), Windows DirectSound (2 in, 0 out)
10 Primary Sound Driver, Windows DirectSound (0 in, 2 out)
11 Speakers (VMware VMaudio (VMAUDIO) (WDM)), Windows DirectSound (0 in, 2 out)
12 Speakers (VMware VMaudio (VMAUDIO) (WDM)), Windows WASAPI (0 in, 2 out)
13 Phone Line (VMware VMaudio (VMAUDIO) (WDM)), Windows WASAPI (1 in, 0 out)
14 Line In (VMware VMaudio (VMAUDIO) (WDM)), Windows WASAPI (2 in, 0 out)
15 Microphone (VMware VMaudio (VMAUDIO) (WDM)), Windows WASAPI (1 in, 0 out)
16 Speakers (VMware VMaudio), Windows WDM-KS (0 in, 2 out)
17 Phone Line (VMware VMaudio), Windows WDM-KS (2 in, 0 out)
18 Microphone (VMware VMaudio), Windows WDM-KS (2 in, 0 out)
19 Line In (VMware VMaudio), Windows WDM-KS (2 in, 0 out)
20 CD Audio (VMware VMaudio), Windows WDM-KS (2 in, 0 out)
21 Input (VMware VMaudio), Windows WDM-KS (1 in, 0 out)
from python-sounddevice.
OK, thanks, so it seems to work.
If you can live with switching to a different DLL, I guess it's fine for this special case.
If you have (or anyone out there has) an idea what I could do the make my DLLs work, too, speak up!
from python-sounddevice.
Maybe we can start to narrow the differences. Is there any chance of compiling the same version he has ?
First thing is the version, is there any chance of compiling the version he has (r1891) ?
I know with python modules mixing VS compiled and MingW compiled modules doesn't work, but don't see how it would apply to a DLL on CFFI.
from python-sounddevice.
Here's a bug about a portaudio crash on windows 10 - no idea if it's this crash at this crash obviously ..
http://portaudio.music.columbia.narkive.com/Sqz6tW6b/internal-portaudio-error-in-windows-10
from python-sounddevice.
Thanks for the info. There seem to be several slightly different issues with Windows 10 (and some specific drivers), I think the one where they talk about an error at initialization might be the same we have here. I didn't see a solution there, though.
I'm cross-compiling the DLLs with MXE which have their own settings for PortAudio: https://github.com/mxe/mxe/blob/master/src/portaudio.mk.
The problem is that there was no new official release since the one MXE is already using (see http://www.portaudio.com/download.html). The only newer "release" in http://www.portaudio.com/archives/ is pa_snapshot.tgz
.
Just for testing purposes, I compiled DLLs for this latest snapshot in the "portaudio-snapshot" branch:
spatialaudio/portaudio-binaries@51c4331
If you want, you can try these on your setup.
But even if this works, I don't think it's a good idea to release DLLs that don't have any version information on them.
Sadly, the PortAudio people make releases very scarcely.
from python-sounddevice.
I tried the 64 bit one and it still crashes (which is reassuring in a way).
I downloaded MXE, and also made a git copy of the port audio svn. I guess if I can build an earlier version and not crash it should be possible to bisect +find the commit that caused it.
from python-sounddevice.
Ah, I didn't know that r1891 was older than 20140130 ...
Yes, you might be lucky and find a change in PortAudio that caused the error, but it might as well be a bug/incompatibility in the Windows stuff implemented in MinGW64.
I have the feeling that the latter is more likely ...
Either way, good luck!
from python-sounddevice.
Have to see how far motivation carries me - adfernandes has a commit in his repo of 27 may 2013.
You're right it probably won't work - but I'll give it a go... not going to build anything in windows itself because of vm issues.
from python-sounddevice.
There's a related discussion on the PortAudio mailing list: https://lists.columbia.edu/pipermail/portaudio/2016-February/000316.html
from python-sounddevice.
I've just made a new release using the new PortAudio version.
Can you please try if it works now?
from python-sounddevice.
I gave it a go in python2.7 and python3.5, and both get basically the same error, the line number is now
2.7 output (3.5 is the same)
>>> import sounddevice
Assertion failed!
Program: C:\Python27\python.exe
File: src/hostapi/wdmks/pa_win_wdmks.c, Line 1061
Expression: FALSE
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
from python-sounddevice.
@stuaxo Thanks for the update!
I still don't know what's going wrong here, but since not so long ago, there is a new version of the PortAudio DLLs available from Christoph Gohlke: http://www.lfd.uci.edu/~gohlke/pythonlibs/#sounddevice
Those would probably be worth a try!
from python-sounddevice.
They was also a new portaudio snapshot last night.
from python-sounddevice.
bump, just importing sounddevice gave me that error, python 3.5 anaconda windows 10
from python-sounddevice.
Are you also using VMware?
Did you try the Gohlke wheels?
from python-sounddevice.
@badjano Do other applications that use PortAudio work correctly? E.g. Audacity? Do they have support for WDM/KS?
from python-sounddevice.
No VMWare, using pycharm community on windows 10 natively ( installed python 3.5 via anaconda )
from python-sounddevice.
@badjano OK, thanks, I didn't know that this problem also occurs without VMware.
Can you please answer my other questions from above?
I would really like this to work on Windows too, even though I myself don't use it.
from python-sounddevice.
I don't know what Gohlke wheels is, and I now realize I didn't check to see if I installed PortAudio... sorry, I'll check it out when I get home and come back to you
from python-sounddevice.
I don't know what Gohlke wheels is
from python-sounddevice.
Don't know if this is the right place to put it. But I am running Python 3.7 on Windows 10 and can use pip to install sounddevice, but importing yields the same error:
Assertion failed!
Program: E:\Program Files\Python37\python.exe
File: src/hostapi/wdmks/pa_win_wdmks.c, Line 1061
Expression: FALSE
Edit: After uninstalling the module and reinstalling, I no longer have this error
from python-sounddevice.
For people getting the same error in Windows10:
Assertion failed!
Program: E:\Program Files\Python37\python.exe
File: src/hostapi/wdmks/pa_win_wdmks.c, Line 1061
Expression: FALSE
Steps:
- Locate
libportaudio64bit.dll
file (located in Python folder >\Lib\site-packages\_sounddevice_data\portaudio-binaries
) - Rename
libportaudio64bit.dll
file to_libportaudio64bit.dll
- instead of replacing/deleting - Copy
portaudio_x64.dll
fromportaudio-r1891-build\lib\x64\ReleaseMinDependency
directory after extracting from this one, to the above directory in Python folder. - Rename
portaudio_x64.dll
tolibportaudio64bit.dll
from python-sounddevice.
I was using Jupyter Notebook in Anaconda (python 3.8.5) on Win 10 64 bit. I had exactly the same error after I ran '!pip install sounddevice' in an .ipynb file. I fixed it by:
- Shut down jupyter notebook and open anaconda prompt (anaconda3)
- Run 'pip uninstall sounddevice' (until it successfully uninstalled)
- Run 'conda install -c conda-forge python-sounddevice' (until it successfully install)
- Open jupyter notebook again. Run 'import sounddevice' and it FINALLY works perfectly!!!
Might not be exactly the same environment but hope my solution can help!
from python-sounddevice.
Related Issues (20)
- Cannot get aggregate device to work with sounddevice/rtmixer signal processing.py example HOT 1
- Enhancement Request: Integrate Playback Status Check into Simple `play`/`stop` API in `sounddevice` HOT 4
- Feature request for loopback of output device. HOT 3
- 设备解码错误?utf-8' codec can't decode byte 0xc2 in position 6: invalid continuation byte HOT 4
- Sounddevice + big dict + OOP = Segfault / Bus Error HOT 11
- Update device list by reloading portaudio dll HOT 1
- Won't be able to import sounddevice due to unknown issue with `libportaudio64bit.dll` HOT 5
- Error opening OutputStream: Unanticipated host error', -9999, (2, 0, 'Failed to load ASIO driver
- Use sounddevice with virtual audio device and minimize latency HOT 1
- Achieving stable latency between calls of "playrec" HOT 8
- sounddevice not recognize all devices?
- Issues with playing concurrently with Youtube HOT 1
- Latency 30mSec HOT 9
- Advice on asynchronous playback HOT 7
- docker node minimal image
- Can I continue recording until the volume drops below a threshold? HOT 4
- Simultaneous audio playback datatype issue HOT 2
- Does sd.wait() block all other threads? HOT 1
- OSERROR portaudio library not found
- Advice on detecting when Sounddevice has stopped playing audio (and using multiple OutputStreams)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-sounddevice.