Skip to content

no sound with wdm/ks under win8.1 #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
piotx opened this issue Aug 16, 2016 · 9 comments
Closed

no sound with wdm/ks under win8.1 #36

piotx opened this issue Aug 16, 2016 · 9 comments

Comments

@piotx
Copy link

piotx commented Aug 16, 2016

I've compiled portaudio myself (with Visual C++ 2008 Express Edition), and tried out binaries from https://github.com/adfernandes/precompiled-portaudio-windows but there is no sound on win 8.1, when using wdm/ks...

any ideas how to get around it?

@mgeier
Copy link
Member

mgeier commented Aug 16, 2016 via email

@piotx
Copy link
Author

piotx commented Aug 16, 2016

yes. wdm-ks isn't available then: default_output_device: -1,
default_input_device: -1

but I also get some problems with utf8, when querying for devices or trying
to use wasapi:

C:\snd_scripts_f>python -m sounddevice
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\lib\site-packages\sounddevice.py", line 2517, in

print(query_devices())
File "C:\Python27\lib\site-packages\sounddevice.py", line 613, in
query_device
s
for i in range(_check(_lib.Pa_GetDeviceCount())))
File "C:\Python27\lib\site-packages\sounddevice.py", line 613, in

for i in range(_check(_lib.Pa_GetDeviceCount())))
File "C:\Python27\lib\site-packages\sounddevice.py", line 622, in
query_device
s
_lib.Pa_HostApiTypeIdToHostApiIndex(_lib.paMME)) else 'utf-8'),
File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 48:
invalid
continuation byte

2016-08-16 19:42 GMT+02:00 Matthias Geier [email protected]:

Did you try to use the bundled DLL?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#36 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANHZpvx7T3-NVpcQEXlm-f9kca4y5c51ks5qgfZugaJpZM4Jk5lS
.

@piotx
Copy link
Author

piotx commented Aug 19, 2016

just to let you know; wdm ks works perfect on windows 7; sound latency (measured with an oscilloscope) is between 0.5 and 2 ms; that's very good, thanks a lot!

@piotx
Copy link
Author

piotx commented Aug 23, 2016

I think the issue can be closed; I can't reproduce the problem on win8 anymore. wdm-ks worked today, when I specified the location of the audioport.dll with

_lib = _ffi.dlopen('c:\python27\Lib\site-packages\_sounddevice_data\libportaudio32bit.dll' 

Maybe the portaudio.dll of pyo was loaded, without my knowing

@mgeier
Copy link
Member

mgeier commented Aug 25, 2016

OK, that's possible. If dlopen('portaudio') succeeds, the bundled DLL is not used.

I guess this is a feature?
This is necessary for Linux, I don't know if I can/should disable this for Windows ...?

You can try to check if the PortAudio versions are different:

import sounddevice as sd
sd.get_portaudio_version()

You might get some information about the used library with this:

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

Just out of curiosity, where is pyo's DLL installed?

@piotx
Copy link
Author

piotx commented Aug 25, 2016

thanks for the infos. It's actually a nice thing, that one can choose the
portaudio.dll. But it can mislead...

pyo's dll is installed in the main site-package folder:
pythonpath/Lib/site-packages/portaudio.dll

2016-08-25 14:25 GMT+02:00 Matthias Geier [email protected]:

OK, that's possible. If dlopen('portaudio') succeeds, the bundled DLL is
not used.

I guess this is a feature?
This is necessary for Linux, I don't know if I can/should disable this for
Windows ...?

You can try to check if the PortAudio versions are different:

import sounddevice as sd
sd.get_portaudio_version()

You might get some information about the used library with this:

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

Just out of curiosity, where is pyo's DLL installed?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#36 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANHZpllz87Alla-UT6TrV8fSwhjxge4Aks5qjYnOgaJpZM4Jk5lS
.

@piotx
Copy link
Author

piotx commented Aug 26, 2016

that's ok now.
now,
I get however an error, if I call

sd.play(data, device=9, extra_settings=wasapi_exclusive)
c:\python27\lib\site-packages\sounddevice-0.3.4-py2.7.egg\sounddevice.py in __init__(self, kind, samplerate, blocksize, device, channels, dtype, latency, extra_
settings, callback_wrapper, finished_callback, clip_off, dither_off, never_drop_
input, prime_output_buffers_using_stream_callback)
    908                                   samplerate, blocksize, stream_flags,
    909                                   self._callback, _ffi.NULL),
--> 910                'Error opening {0}'.format(self.__class__.__name__))
    911
    912         # dereference PaStream** --> PaStream*

c:\python27\lib\site-packages\sounddevice-0.3.4-py2.7.egg\sounddevice.py in _check(err, msg)
   2601         else:
   2602             msg += _ffi.string(_lib.Pa_GetErrorText(err)).decode()
-> 2603         raise PortAudioError(msg)
   2604     return err
   2605

PortAudioError: Error opening OutputStream: Incompatible host API specific stream info

sd.query_devices() shows:

  9 Speakers (Realtek High Definition Audio), Windows WASAPI (0 in, 2 out)

there seems to be another small issue with sd.default.extra_settings = wasapi_exclusive;

I get the following error message, if I run it:

c:\python27\lib\site-packages\sounddevice-0.3.4-py2.7.egg\sounddevice.py in __iit__(self, kind, samplerate, blocksize, device, channels, dtype, latency, extra
settings, callback_wrapper, finished_callback, clip_off, dither_off, never_drop
input, prime_output_buffers_using_stream_callback)
    887             parameters, self._dtype, self._samplesize, samplerate = \
    888                 _get_stream_parameters(kind, device, channels, dtype, l
tency,
--> 889                                        extra_settings, samplerate)
    890             self._device = parameters.device
    891             self._channels = parameters.channelCount

c:\python27\lib\site-packages\sounddevice-0.3.4-py2.7.egg\sounddevice.py in _get_stream_parameters(kind, device, channels, dtype, latency, extra_settings, samplerate)
   2523         latency = default.latency[kind]
   2524     if extra_settings is None:
-> 2525         extra_settings = default.extra_settings[kind]
   2526     if samplerate is None:
   2527         samplerate = default.samplerate

TypeError: 'WasapiSettings' object has no attribute '__getitem__'

@mgeier
Copy link
Member

mgeier commented Aug 26, 2016

Thanks for testing! Just for the record, this should have been an answer to #35 (comment).

I fixed the second problem in a new commit to #39, can you please try again?

I don't know what's causing the first error, probably it's related to the second one ...?

@mgeier
Copy link
Member

mgeier commented Aug 26, 2016

I'm closing this issue since it was caused by pyo's portaudio.dll.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants