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.

sounddevice.PortAudioError: Error opening OutputStream: Device unavailable [PaErrorCode -9985]

See original GitHub issue

I connected a USB headset to listen to a sound made by sounddevice as part of #198, and I got the following error:

Traceback (most recent call last):
  File "foo.py", line 45, in <module>
    play(sample_rate)
  File "foo.py", line 39, in play
    sounddevice.play(array_2, samplerate=hz)
  File "C:\Program Files\Python37\lib\site-packages\sounddevice.py", line 154, in play
    **kwargs)
  File "C:\Program Files\Python37\lib\site-packages\sounddevice.py", line 2417, in start_stream
    **kwargs)
  File "C:\Program Files\Python37\lib\site-packages\sounddevice.py", line 1374, in __init__
    **_remove_self(locals()))
  File "C:\Program Files\Python37\lib\site-packages\sounddevice.py", line 780, in __init__
    'Error opening {0}'.format(self.__class__.__name__))
  File "C:\Program Files\Python37\lib\site-packages\sounddevice.py", line 2572, in _check
    raise PortAudioError(errormsg, err)
sounddevice.PortAudioError: Error opening OutputStream: Device unavailable [PaErrorCode -9985]

The headset otherwise works, Windows 7 plays audio through it just fine.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
cool-RRcommented, Jun 27, 2020

Headset model: Logitech USB Headset H390.

Hardware IDs:

USB\VID_046D&PID_0A44&REV_0127&MI_00
USB\VID_046D&PID_0A44&MI_00
0reactions
cool-RRcommented, Jun 27, 2020

When troubleshooting another issue with @mgeier , we came to the conclusion that this bug only happens when ASIO is included in the PortAudio DLL, and is probably related to the initialization action that PortAudio does to ASIO.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error opening OutputStream: Invalid number of channels ...
sounddevice.play is interpreting this as a single sample with 4999 channels! Try transposing the array, so play sees the array as 4999 samples ......
Read more >
python-sounddevice, version 0.3.7 - Read the Docs
Pa_GetDeviceInfo(device) if not info: raise PortAudioError('Error querying device {0}'.format(device)) assert info.structVersion == 2 name_bytes ...
Read more >
spatialaudio - Bountysource
Created 7 months ago in spatialaudio/python-sounddevice with 5 comments. ... Error opening InputStream: Device unavailable [PaErrorCode -9985].
Read more >
Audio Crashing on Ubuntu - Coding - PsychoPy Discourse
... instance when trying to launch experiment sounddevice.PortAudioError: Error opening OutputStream: Device unavailable [PaErrorCode -9985] ...
Read more >
python-sounddevice - Read the Docs
To record audio data from your sound device into a NumPy array, ... PortAudioError: Error opening InputStream: Invalid number of channels␣.
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