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

WDM-KS is broken on Windows 10 via VMware

Open stuaxo opened this issue 11 years ago • 41 comments

I tried pip install sounddevice then importing it, on 64 bit windows with 64 bit python - and it wasn't happy..

C:\Users\stu\Desktop\planar>python
Python 2.7.10rc1 (default, May 10 2015, 18:50:04) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sounddevice
Assertion failed!

Program: C:\Python27\python.exe
File: src/hostapi/wdmks/pa_win_wdmks.c, Line 1035

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.

stuaxo avatar Oct 11 '15 08:10 stuaxo

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

stuaxo avatar Oct 14 '15 06:10 stuaxo

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: https://github.com/spatialaudio/portaudio-binaries/commit/51c4331ea07f956d7086edd238f89d50e3f08543

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.

mgeier avatar Oct 14 '15 10:10 mgeier

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.

stuaxo avatar Oct 14 '15 17:10 stuaxo

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!

mgeier avatar Oct 15 '15 08:10 mgeier

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.

stuaxo avatar Oct 15 '15 09:10 stuaxo

There's a related discussion on the PortAudio mailing list: https://lists.columbia.edu/pipermail/portaudio/2016-February/000316.html

mgeier avatar Feb 23 '16 08:02 mgeier

I've just made a new release using the new PortAudio version. Can you please try if it works now?

mgeier avatar Dec 19 '16 16:12 mgeier

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.

stuaxo avatar Dec 20 '16 21:12 stuaxo

@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!

mgeier avatar Dec 21 '16 07:12 mgeier

They was also a new portaudio snapshot last night.

stuaxo avatar Dec 21 '16 11:12 stuaxo

bump, just importing sounddevice gave me that error, python 3.5 anaconda windows 10

badjano avatar Jul 11 '17 04:07 badjano

@badjano

Are you also using VMware?

Did you try the Gohlke wheels?

mgeier avatar Jul 11 '17 14:07 mgeier

@badjano Do other applications that use PortAudio work correctly? E.g. Audacity? Do they have support for WDM/KS?

mgeier avatar Jul 11 '17 14:07 mgeier

No VMWare, using pycharm community on windows 10 natively ( installed python 3.5 via anaconda )

badjano avatar Jul 11 '17 14:07 badjano

@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.

mgeier avatar Jul 11 '17 15:07 mgeier

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

badjano avatar Jul 11 '17 17:07 badjano

I don't know what Gohlke wheels is

https://github.com/spatialaudio/python-sounddevice/issues/7#issuecomment-268458203

mgeier avatar Jul 11 '17 17:07 mgeier

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

AubergineOfTheMoon avatar Jul 29 '18 23:07 AubergineOfTheMoon

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:

  1. Locate libportaudio64bit.dll file (located in Python folder > \Lib\site-packages\_sounddevice_data\portaudio-binaries)
  2. Rename libportaudio64bit.dll file to _libportaudio64bit.dll - instead of replacing/deleting
  3. Copy portaudio_x64.dll from portaudio-r1891-build\lib\x64\ReleaseMinDependency directory after extracting from this one, to the above directory in Python folder.
  4. Rename portaudio_x64.dll to libportaudio64bit.dll

Maneesh3 avatar Dec 26 '20 09:12 Maneesh3

@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.

mgeier avatar Dec 26 '20 10:12 mgeier