Skip to content
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

Failed to load PortAudio w/WASAPI due to broken system audio #315

Closed
sveinse opened this issue Oct 3, 2020 · 3 comments
Closed

Failed to load PortAudio w/WASAPI due to broken system audio #315

sveinse opened this issue Oct 3, 2020 · 3 comments
Assignees
Labels
src-wasapi MS WASAPI Host API /src/hostapi/wasapi windows Affects MS Windows

Comments

@sveinse
Copy link
Contributor

sveinse commented Oct 3, 2020

Created from discussions in #303 about WASAPI glitching issues.

Encountered a failure to load PortAudio due to an audio system error on Windows.

Background story: I have an Focusrite Scarlett 6i6 USB Pro sound card, and it wanted a firmware update. For some reason that firmware update completely broke audio on my computer. If I selected that audio card as output, other audio apps, such as Spotify crashed. When I tried to use PortAudio under these conditions, PA crashed:

Cannot create DirectSound for Speakers (Focusrite Usb Audio). Result = 0x88890008
Speakers (Focusrite Usb Audio)'s GUID: {0xd802d747,0x1f0a,0x47f8,0x98,0xf9,0x47,0xfe,0x1b,0xa3,0x2f, 0x35}
....
WASAPI: device idx: 03
WASAPI: ---------------
WASAPI:3| name[Speakers (Focusrite Usb Audio)]
WASAPI:3| form-factor[1]
WASAPI ERROR HRESULT: 0x88890008 : AUDCLNT_E_UNSUPPORTED_FORMAT
 [FUNCTION: CreateDeviceList FILE: C:\Svein\Prosjekt\elns-wasapi\portaudio-pr307\src\hostapi\wasapi\pa_win_wasapi.c {LINE: 2082}]
WASAPI: failed CreateDeviceList error[-9986|Internal PortAudio error]
WASAPI: failed PaWasapi_Initialize error[-9986|Internal PortAudio error]

This is caused by this code: https://github.com/PortAudio/portaudio/blob/winrt/src/hostapi/wasapi/pa_win_wasapi.c#L2079-L2085

@dmitrykos dmitrykos added the src-wasapi MS WASAPI Host API /src/hostapi/wasapi label Oct 3, 2020
@dmitrykos dmitrykos self-assigned this Oct 3, 2020
@dmitrykos dmitrykos added the windows Affects MS Windows label Oct 3, 2020
@dmitrykos
Copy link
Collaborator

@sveinse I tried to simulate the problem by changing the line (https://github.com/PortAudio/portaudio/blob/winrt/src/hostapi/wasapi/pa_win_wasapi.c#L2035 to:

hr = (i != 0 ? AUDCLNT_E_UNSUPPORTED_FORMAT : IAudioClient_GetMixFormat(tmpClient, &mixFormat));

got similar log:

WASAPI:1| name[Speakers (Realtek High Definition Audio)]
WASAPI:1| form-factor[1]
WASAPI ERROR HRESULT: 0x88890008 : AUDCLNT_E_UNSUPPORTED_FORMAT
 [FUNCTION: CreateDeviceList FILE: \libportaudio\src\hostapi\wasapi\pa_win_wasapi.c {LINE: 2082}]
WASAPI: failed CreateDeviceList error[-9986|Internal PortAudio error]
WASAPI: failed PaWasapi_Initialize error[-9986|Internal PortAudio error]

but no crash is happening in my case. Do you have any stack-trace or may be you could run process under the debugger?

@sveinse
Copy link
Contributor Author

sveinse commented Oct 5, 2020

@dmitrykos unfortunately I am not. Being without the failing Focusrite Scarlett USB was mission critical for other reasons than WASAPI, so I had to fix the issue. Now that it works I no longer have the same test environment. Because of this I can't provide you with any useful test setup. It's ok by me if you chose to close this issue as wontfix. I'm sorry.

@dmitrykos
Copy link
Collaborator

@sveinse I see. Well, according to my experiments by simulating failure exactly in the mentioned line the process did not crash. I expected variables and logic with breakpoints and did not reveal any suspicious places. I think we shall close it for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src-wasapi MS WASAPI Host API /src/hostapi/wasapi windows Affects MS Windows
Projects
None yet
Development

No branches or pull requests

2 participants