Bug 281390 - sound: OSS have no AFMT_FLOAT support
Summary: sound: OSS have no AFMT_FLOAT support
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Some People
Assignee: Christos Margiolis
URL:
Keywords:
Depends on:
Blocks: 280612
  Show dependency treegraph
 
Reported: 2024-09-09 12:38 UTC by Ivan Rozhuk
Modified: 2024-11-19 17:51 UTC (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2024-09-09 12:38:33 UTC
Past issues:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=157050
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=184380

In the wild some software from ports that have OSS support just define AFMT_FLOAT inside own code.

AFMT_FLOAT used in wine: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264973
Currently as workaround wine builds with ALSA.


I suggest to add some in kernel conversion from AFMT_FLOAT to some thing that aleady support by "PCM subsystem mixing through its feeder subsystem" or update feeder subsystem to support AFMT_FLOAT.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2024-09-30 05:45:30 UTC
^Triage: I don't see a proposed solution yet, so "In Progress" may be premature.
Comment 2 Christos Margiolis freebsd_committer freebsd_triage 2024-09-30 15:22:43 UTC
(In reply to Mark Linimon from comment #1)
I am working on it.
Comment 3 Christos Margiolis freebsd_committer freebsd_triage 2024-11-16 18:15:54 UTC
https://reviews.freebsd.org/D47638
Comment 6 Ed Maste freebsd_committer freebsd_triage 2024-11-19 16:01:26 UTC
(In reply to Ivan Rozhuk from comment #4)
Note that we need not plain float->int but rather (float*constant)->int; this could be done with integer instructions but either way this should be something we look at after profiling if the overhead of fpu_kern_enter/_leave is excessive.
Comment 7 Ivan Rozhuk 2024-11-19 17:51:20 UTC
(In reply to Ed Maste from comment #6)

(float*constant)->int -> float->(int*constant) ? :)

As described in http://0x80.pl/articles/convert-float-to-integer.html float to int conversion should be not so expensive as fpu_kern_**() staff.

Also their code simple and under BSD2 license.