-
Notifications
You must be signed in to change notification settings - Fork 332
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
dsound: clamp smaller buffer sizes to 62.5 ms on Vista and later (cherry-pick of #782) #1008
dsound: clamp smaller buffer sizes to 62.5 ms on Vista and later (cherry-pick of #782) #1008
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not compile but it passed CI!
src/hostapi/dsound/pa_win_ds.c
Outdated
@@ -1733,7 +1733,12 @@ static void CalculateBufferSettings( unsigned long *hostBufferSizeFrames, | |||
unsigned long maximumPollingPeriodFrames = (unsigned long)(sampleRate * PA_DS_MAXIMUM_POLLING_PERIOD_SECONDS); | |||
unsigned long pollingJitterFrames = (unsigned long)(sampleRate * PA_DS_POLLING_JITTER_SECONDS); | |||
|
|||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This merge conflict needs to be resolved before submitting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry Phil, I was in a rush and did not follow my standard procedure:
- Save the file before commit
- Check the diff before commit
- Check the diff before submitting the PR
- Check the diff after submitting the PR
- Check the CI results after submitting the PR
It should be OK now. The force pushes (1) fix the merge conflicts, (2) fix a missing {
, (3) improve the short commit message.
src/hostapi/dsound/pa_win_ds.c
Outdated
@@ -1768,6 +1773,7 @@ static void CalculateBufferSettings( unsigned long *hostBufferSizeFrames, | |||
unsigned long adjustedSuggestedOutputLatencyFrames = | |||
suggestedOutputLatencyFrames - userFramesPerBuffer; | |||
|
|||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another merge conflict.
7e34c1f
to
7e3e4fa
Compare
This works around a DirectSound limitation where input host buffer sizes smaller than 31.25 ms are basically unworkable and make PortAudio hang. The workaround is to impose a minimal buffer size of 2*31.25 ms on input-only and full-duplex streams. This is enough for the read cursor to advance twice around the buffer, basically resulting in de facto double buffering. This change was tested with `paloopback` under a wide variety of half/full-duplex, framesPerBuffer, and suggested latency parameters. (Note the testing was done on top of PortAudio#772 as otherwise paloopback is not usable.) NOTE: in the input+output case this patch also increases the output buffer size. Fixes PortAudio#775
7e3e4fa
to
5f94391
Compare
see #782 for details and discussion.