Page MenuHomeFreeBSD

sound: Remove FEEDEQ_CLAMP()
AbandonedPublic

Authored by christos on Dec 11 2024, 4:49 PM.
Tags
None
Referenced Files
F132457467: D48033.diff
Fri, Oct 17, 2:34 AM
Unknown Object (File)
Sun, Sep 21, 12:51 AM
Unknown Object (File)
Sat, Sep 20, 9:38 PM
Unknown Object (File)
Sat, Sep 20, 8:57 PM
Unknown Object (File)
Sep 16 2025, 1:06 AM
Unknown Object (File)
Sep 14 2025, 9:12 AM
Unknown Object (File)
Sep 13 2025, 11:04 PM
Unknown Object (File)
Sep 10 2025, 3:28 AM
Subscribers

Details

Summary

There is PCM_CLAMP_S32() already.

No functional change intended.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61089
Build 57973: arc lint + arc unit

Event Timeline

Hm, PCM_CLAMP_S32 does something different when the SND_PCM_64 option is not set?

Hm, PCM_CLAMP_S32 does something different when the SND_PCM_64 option is not set?

It does, but I am wondering whether the non-SND_PCM_64 is useful. I am not exactly sure why it does what it does.

Hm, PCM_CLAMP_S32 does something different when the SND_PCM_64 option is not set?

It does, but I am wondering whether the non-SND_PCM_64 is useful. I am not exactly sure why it does what it does.

From sys/conf/NOTES:

# SND_PCM_64                   (Only applicable for i386/32bit arch)
#                              Process 32bit samples through 64bit
#                              integer/arithmetic. Slight increase of dynamic
#                              range at a cost of possible slowdown.

I think the default on 32bit platforms is to process 32bit samples at only 24bit precision, to prevent overflow while using 32bit integers for performance reasons. Option SND_PCM_64 turns on proper 64bit integer processing, which can handle 32bit samples easily. See also PCM_FXSHIFT and the comment you deleted in D47932.

What is really questionable from a readability POV is typedef int64_t intpcm32_t;, IMHO. We have to be extra careful refactoring this stuff.