PortAudio / portaudio

PortAudio is a cross-platform, open-source C language library for real-time audio input and output.
Other
1.51k stars 307 forks source link

paUInt8 not working when recording #168

Open PortAudio-admin opened 13 years ago

PortAudio-admin commented 13 years ago

Issue created by @philburk

I get scrambled data when recording with paUInt8 mode on Mac. This was detected using the paloopback test. Note the bad paUInt8 test result at the bottom of the attached report.

PortAudio-admin commented 12 years ago

Comment by @RossBencina

TRAC migration: propagating ticket status from TRAC

PortAudio-admin commented 12 years ago

Comment by @RossBencina

pauint8_bug.txt

Phil Burk added attachment pauint8_bug.txt report from paloopback test

dechamps commented 1 year ago

Hello from 12 years later. I can reproduce this on latest master using Windows DirectSound. It indeed only affects the recording side (playback is fine). It affects paInt8 too, not just paUInt8.

To be clear the paloopback test is failing correctly - this is a bug in PortAudio itself, not in the test. I root caused it to missing converters: https://github.com/PortAudio/portaudio/blob/4bccdfbb68a509e2a96d916046d911959f7d935c/src/common/pa_converters.c#L1454-L1470

Specifically, the dithered Int16 → Int8 and Int16 → UInt8 converters are missing. As a result, if one ends up in a scenario where the Host API uses Int16 buffers internally but the user uses (U)Int8 buffers, the code path hits these unimplemented functions and hilarity ensues.

It looks like these missing converters are a known issue, see #35.