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

-ao dsound fails for format=s24le && channels<=2 on certain devices #23

Open
Fedyon opened this issue Mar 25, 2023 · 0 comments
Open

-ao dsound fails for format=s24le && channels<=2 on certain devices #23

Fedyon opened this issue Mar 25, 2023 · 0 comments

Comments

@Fedyon
Copy link

Fedyon commented Mar 25, 2023

On the driver teacahsd.sys for USB UAC2 devices, just setting -format s24le -channels 2 doesn't work:

ao_dsound: DirectSound initialized
ao_dsound: Samplerate:48000Hz Channels:2 Format:s24le
ao_dsound: Buffersize:288000 bytes (1000 msec)
ao_dsound: primary buffer created
ao_dsound: DirectSound uninitialized
ao_dsound: cannot create secondary (stream)buffer (DSERR_INVALIDCALL)
Failed to initialize audio driver 'dsound:device=1'
Could not open/initialize audio device -> no sound.

But -format s24le -channels 2 -af-add format=s24le,channels=3 actually works:

ao_dsound: DirectSound initialized
ao_dsound: Samplerate:48000Hz Channels:3 Format:s24le
ao_dsound: Buffersize:432000 bytes (1000 msec)
ao_dsound: primary buffer created
ao_dsound: secondary (stream)buffer created
AO: [dsound] 48000Hz 3ch s24le (3 bytes per sample)

I can hear sin()*(2^-18) as sine wave, so it must be working through to the final output.

The difference is the usage of WAVE_FORMAT_EXTENSIBLE. The driver refuses to accept anything larger than s16 wrapped in plain WAVE_FORMAT_PCM. Possibly because they're declared deprecated at some point in the history (IIRC).

Note that the behavior is device driver dependent; on Realtek ALC it seems to work in either way. Looking at the opposite side of the problem, are there any usable devices left in the wild which are capable of s24 stereo AND yet don't accept WAVE_FORMAT_EXTENSIBLE at all?

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

No branches or pull requests

1 participant