1.0 DAC output device in Exclusive mode. I have made correction and
committed changes, would you please check if it works ok for you now.
Dmitry.
Post by Dinesh IyerDmitry,
I verified the outWavex on line 2485 and confirmed that the values for
the fields wBitsPerSample = 24, wFormatTag = 65534 (0xFFFE),
Sample.wValidBitsPerSample = 24.
The failure happens on line 3016 in the call to
IAudioClient_Initialize(). The return code is 0x88890020 which corresponds
to AUDCLNT_E_INVALID_DEVICE_PERIOD. Based on the input arguments to
IAudioClient_Initialize, the periodicity is being passed in as 0 because I
am operating device in exclusive mode.
Regards,
Dinesh
On Sat, Sep 8, 2018 at 5:26 AM Dmitry Kostjuchenko <
Post by Ross BencinaHi Dinesh,
paWinWasapiExplicitSampleFormat is not required but it allows to
force PA's WASAPI implementation not to look for alternative close format.
Would you please set debugger's breakpoint to the line 2485. Will
code execution reach this breakpoint? If yes, please check contents
of outWavex and say what values
for wBitsPerSample, wFormatTag, Samples.wValidBitsPerSample are. If you
check logic of MakeWaveFormatFromParams(outWavex, ¶ms, sampleRate,
TRUE) it will force packed sample format usage, e.g. requested 24-bits will
not be put into 32-bit containers.
Basically your input is welcome because you have such specific device.
Best regards,
Dmitry.
Post by Dinesh IyerHi Dmitry,
I am getting the same error after bringing in your changes to the
WASAPI code. The error happens with and without setting the
paWinWasapiExplicitSampleFormat flag.
Dinesh
Post by Dinesh IyerHi Dmitry,
Do I have to set the flag paWinWasapiExplicitSampleFormat in the
PaWasapiStreamInfo?
Dinesh
On Thu, Sep 6, 2018 at 2:03 PM Dmitry Kostjuchenko <
Post by Ross BencinaHi Dinesh,
Thank you for testing!
Would you please update PA's GIT to the latest, recompile and
check how it works now. I have committed necessary changes to WASAPI's
implementation with the improvement of the the selection of the format for
Exclusive mode. Would you please test new implementation. In my tests it
works fine and I hope will do so in you case too. Now PA will also test
packed sample formats, e.g. it will also cover your successful result when
you changed wBitsPerSample to 24.
Best regards,
Dmitry.
Post by Dinesh IyerHi Dmitry,
The change you suggested did not fix the issue.
Dinesh
On Thu, Sep 6, 2018 at 9:34 AM Dinesh Iyer <
Post by Dinesh IyerHi Dmitry,
I am running the changes now but I am curious how moving that
code to the bottom would change anything. Reason I ask is that there is no
further changes being made to the fields of "old" after
if ((old->wBitsPerSample = bitsPerSample) > 16)
{
old->wBitsPerSample = 32; // 20 or 24 bits must go in 32 bit
containers (ints)
}
and those computations were made immediately after this IF condition.
Regards,
Dinesh
On Thu, Sep 6, 2018 at 8:06 AM Dmitry Kostjuchenko <
Post by Ross BencinaHi Dinesh,
Please disregard my previous e-mail. Accroding MSDN for
WAVEFORMATEX structure wBitsPerSample must be strictly 8 or 16
for WAVE_FORMAT_PCM.
1) undo all your changes, e.g. let the pa_win_wasapi.c file be
in its original state;
2) in MakeWaveFormatFromParams() move these lines to the bottom
old->nBlockAlign = old->nChannels *
(old->wBitsPerSample / 8);
old->nAvgBytesPerSec = old->nSamplesPerSec *
old->nBlockAlign;
E.g. right above 'return paNoError'.
Most probably the driver in your case does not accept erroneous
nBlockAlign and nAvgBytesPerSec because wBitsPerSample were changed to 32.
Will it work?
Will be waiting for the results of your test to make necessary
adjustments.
Best regards,
Dmitry.
2018-09-06 11:28 GMT+03:00 Dmitry Kostjuchenko <
Post by Ross BencinaHi Dinesh,
old->wBitsPerSample = 32; // 20 or 24 bits must go in 32 bit
containers (ints)
was valid for all devices until your case.
If valid data is >=20 normally Windows expects 32-bit
continers (ints) as wBitsPerSample and wValidBitsPerSample specify real
data resolution.
if ((params->channelCount <= 2) && ((bitsPerSample == 16) ||
(bitsPerSample == 8)))
if ((params->channelCount <= 2) && ((bitsPerSample == 24)
|| (bitsPerSample == 16) || (bitsPerSample == 8)))
Will it work either?
Best regards,
Dmitry.
ÑÑ, 5 ÑеМÑ. 2018 г. в 15:14, Dinesh Iyer <
Post by Dinesh IyerHi Ross,
I was wondering if you had a chance to look into this.
Appreciate it!
Dinesh
On Tue, Sep 4, 2018 at 10:04 AM Dinesh Iyer <
Post by Dinesh IyerHi Ross,
if ((old->wBitsPerSample = bitsPerSample) > 16)
{
old->wBitsPerSample = 24; // 20 or 24 bits must go in 32 bit
containers (ints)
}
And the playback and recording worked as expected.
Regards,
Dinesh
On Thu, Aug 30, 2018 at 4:08 PM Dinesh Iyer <
Post by Dinesh IyerHi Ross,
I actually setup debugs and did more digging.
The cause of the issue appears to be the GetClosestFormat
function in pa_win_wasapi.c. Every call to IAudioClient_IsFormatSupported
in this function returns 0x88890008 (AUDCLNT_E_UNSUPPORTED_FORMAT).
I verified that the PaStreamParameters contain the
supported values for SR, bits-per-sample and channel count.
I noticed the MakeWaveFormatFromParams function appears to
set the BitsPerSample in the WAVEFORMATEXTENSIBLE struct to 32-bits. And it
is this value that is being used in the call to
IAudioClient_IsFormatSupported.
if ((old->wBitsPerSample = bitsPerSample) > 16)
{
old->wBitsPerSample = 32; // 20 or 24 bits must go in 32
bit containers (ints)
}
Is this valid?
Hope this investigation helps.
Regards,
Dinesh
On Wed, Aug 29, 2018 at 6:28 PM Ross Bencina <
Post by Dinesh IyerPost by Dinesh IyerLooking for suggestions on how to troubleshoot this
further.
Hi Dinesh,
The obvious suggestion is to step into the PortAudio
OpenStream call
using a debugger and see where it is failing.
Alternatively you can grep the source code for the return
error code
you're getting and try to triangulate which site(s)
is(/are) returning
that error code. You can then use printf or MessageBox()
to narrow down
which path is being taken. Eventually you want to
determine where
PortAudio is giving up, and why.
Ross.
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio