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

DirectSound : can't use combined channelMask with paWinDirectSoundUseChannelMask flag. Just noise #949

Open
Edynamic1977 opened this issue Jul 27, 2024 · 1 comment
Labels
src-dsound MS DirectSound Host API /src/hostapi/dsound

Comments

@Edynamic1977
Copy link

Edynamic1977 commented Jul 27, 2024

Hello,

I've an issue with portaudio 19.6 stable.

you can find PaStreamParameters initialization below :

Targeted Soundcards : TASCAM 208i and TASCAM HR 4x4 US

PaWinDirectSoundStreamInfo oDSStreamInfoOutput;
oDSStreamInfoOutput.size = sizeof(PaWinDirectSoundStreamInfo);
oDSStreamInfoOutput.hostApiType = paDirectSound;
oDSStreamInfoOutput.version = 2;
oDSStreamInfoOutput.flags = paWinDirectSoundUseChannelMask;
oDSStreamInfoOutput.framesPerBuffer = 4096;

oDSStreamInfoOutput.channelMask = 0x1 | 0x2 | 0x10 | 0x20; //for TASCAM HR 4x4 US
oDSStreamInfoOutput.channelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x200 | 0x400; //for TASCAM 208i

PaStreamParameters* oOutputParameters = new PaStreamParameters();
oOutputParameters->device = CARD_ID

oOutputParameters->channelCount = 4;//for TASCAM HR 4x4 US
oOutputParameters->channelCount = 8;//for TASCAM 208i

oOutputParameters->sampleFormat = paInt16;
oOutputParameters->suggestedLatency = 0.120F;
oOutputParameters->hostApiSpecificStreamInfo = &oDSStreamInfoOutput;

I can just use one channel with channelCount = 1

All is OK with this code with internal realtek soundcard

PaWinDirectSoundStreamInfo oDSStreamInfoOutput;
oDSStreamInfoOutput.size = sizeof(PaWinDirectSoundStreamInfo);
oDSStreamInfoOutput.hostApiType = paDirectSound;
oDSStreamInfoOutput.version = 2;
oDSStreamInfoOutput.flags = paWinDirectSoundUseChannelMask;
oDSStreamInfoOutput.framesPerBuffer = 4096;
oDSStreamInfoOutput.channelMask = 0x1 | 0x2;

PaStreamParameters* oOutputParameters = new PaStreamParameters();
oOutputParameters->device = CARD_ID
oOutputParameters->channelCount = 1;
oOutputParameters->sampleFormat = paInt16;
oOutputParameters->suggestedLatency = 0.120F;
oOutputParameters->hostApiSpecificStreamInfo = &oDSStreamInfoOutput;

@RossBencina RossBencina added the src-dsound MS DirectSound Host API /src/hostapi/dsound label Aug 8, 2024
@RossBencina
Copy link
Collaborator

Your masks seem strange to me. What about these masks:

- oDSStreamInfoOutput.channelMask = 0x1 | 0x2 | 0x10 | 0x20; //for TASCAM HR 4x4 US
+ oDSStreamInfoOutput.channelMask = 0x1 | 0x2 | 0x4 | 0x8; //for TASCAM HR 4x4 US

- oDSStreamInfoOutput.channelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x200 | 0x400; //for TASCAM 208i
+ oDSStreamInfoOutput.channelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80; //for TASCAM 208i

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

No branches or pull requests

2 participants