http://bugs.winehq.org/show_bug.cgi?id=58276
Bug ID: 58276 Summary: pulse.c should silence_buffer after calloc Product: Wine Version: 8.0 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winepulse.drv Assignee: wine-bugs@winehq.org Reporter: jxvhulzowyrobfwwze@nbmbb.com Distribution: ---
When pulse_write is “prebuffering … frames of silence,” it uses calloc to zero out a buffer, then immediately calls pa_stream_write.
This isn’t correct for an unsigned 8-bit (u8) stream, since the neutral value should be 128 instead of zero. This causes noticeable clicking whenever the sender stops or resumes playback. (For example, old games that play occasional WAV files as sound effects.) The issue can be reproduced using Sound Recorder from Win3.1 and an 8-bit mono WAV file. Play the same sound over and over until it starts clicking/popping.
I’m not sure if this scenario (the end of a WAV file) should even trigger “buffer underrun” logic at all, since it’s an intentional gap. But regardless of the reason for the underrun, there should be a silence_buffer call there.
I tested this in Wine 8, but confirmed the logic is the same in the latest version.