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

WASAPI driver reorganization #839

Merged
merged 8 commits into from
Apr 14, 2021
Merged

WASAPI driver reorganization #839

merged 8 commits into from
Apr 14, 2021

Conversation

pedrolcl
Copy link
Contributor

@pedrolcl pedrolcl commented Apr 10, 2021

Avoid initializing COM in the caller's thread context.

See also: #833

Copy link
Member

@derselbst derselbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this looks pretty good already. Thank you! I have two points:

  1. The unit tests are failing. For a possible reason, see below.
  2. new_fluid_wasapi_audio_driver2 should wait until the synth thread has finished basic initialization, before returning the audio driver to the caller. On my laptop, WASAPI always fails because the default sample rate 44.1 khz is not supported by my soundcard. Previously, fluidsynth was exiting correctly with error. Now, it just stays open doing nothing. So, if the synth thread fails before it enters the for(;;) loop, new_fluid_wasapi_audio_driver2 should return NULL.

src/drivers/fluid_wasapi.c Outdated Show resolved Hide resolved
@derselbst derselbst added this to the 2.2 milestone Apr 10, 2021
fixed new_fluid_wasapi_audio_driver2 waiting until the initialization or the synthesis thread has finished
Copy link
Member

@derselbst derselbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested it and it works as expected. Thanks! I have one point though:

src/drivers/fluid_wasapi.c Outdated Show resolved Hide resolved
@derselbst derselbst changed the title wasapi driver reorganization to avoid calling CoInitializeEx in the c… WASAPI driver reorganization Apr 13, 2021
@sonarcloud
Copy link

sonarcloud bot commented Apr 13, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@derselbst derselbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some tiny changes. Sorry for the confusion. I'll wait for the CI to complete and then I'll take it. Thanks!

@derselbst derselbst merged commit 03fb32c into FluidSynth:master Apr 14, 2021
@pedrolcl pedrolcl deleted the wasapi-driver-reorganization branch April 14, 2021 09:43
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

Successfully merging this pull request may close these issues.

None yet

2 participants