<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.freebsd.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.freebsd.org/bugzilla/"
          
          maintainer="bugmeister@FreeBSD.org"
>

    <bug>
          <bug_id>157050</bug_id>
          
          <creation_ts>2011-05-15 04:20:03 +0000</creation_ts>
          <short_desc>OSS implementation lacks AFMT_FLOAT</short_desc>
          <delta_ts>2025-04-06 00:29:14 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Base System</product>
          <component>kern</component>
          <version>9.0-CURRENT</version>
          <rep_platform>Any</rep_platform>
          <op_sys>Any</op_sys>
          <bug_status>Closed</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264973</see_also>
    
    <see_also>https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281390</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Normal</priority>
          <bug_severity>Affects Only Me</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>gerald</reporter>
          <assigned_to name="freebsd-multimedia (Nobody)">multimedia</assigned_to>
          <cc>Alexander88207</cc>
    
    <cc>agh</cc>
    
    <cc>christos</cc>
    
    <cc>hselasky</cc>
    
    <cc>imp</cc>
    
    <cc>mav</cc>
    
    <cc>sascha.folie</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>610597</commentid>
    <comment_count>0</comment_count>
    <who name="">gerald</who>
    <bug_when>2011-05-15 04:20:03 +0000</bug_when>
    <thetext>	AFMT_FLOAT, as described by
	  http://manuals.opensound.com/developer/AFMT_FLOAT.html
	is currently not present in FreeBSD which broke recent
	versions of Wine until I patched those myself and my cause
	problems with other applications.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>610598</commentid>
    <comment_count>1</comment_count>
    <who name="Pedro F. Giffuni">pfg</who>
    <bug_when>2012-02-03 23:55:43 +0000</bug_when>
    <thetext>Responsible Changed
From-To: freebsd-standards-&gt;freebsd-multimedia

Assign to multimedia. 
This is more likely to get some attention there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>891758</commentid>
    <comment_count>2</comment_count>
    <who name="Hans Petter Selasky">hselasky</who>
    <bug_when>2016-08-08 15:30:10 +0000</bug_when>
    <thetext>This looks good to me. Do you have a patch?

--HPS</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>891781</commentid>
    <comment_count>3</comment_count>
      <attachid>173412</attachid>
    <who name="Hans Petter Selasky">hselasky</who>
    <bug_when>2016-08-08 16:39:55 +0000</bug_when>
    <thetext>Created attachment 173412
Basic AFMT_FLOAT support

Hi,

Can you test the attached patch?

PCM subsystem still doesn&apos;t support mixing of AFMT_FLOAT through its feeder subsystem, so any use of AFMT_FLOAT will fail!

Maybe that needs to be added too when we provide support for AFMT_FLOAT ?

--HPS</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>994558</commentid>
    <comment_count>4</comment_count>
    <who name="Eitan Adler">eadler</who>
    <bug_when>2018-05-28 19:42:21 +0000</bug_when>
    <thetext>batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1292045</commentid>
    <comment_count>5</comment_count>
    <who name="Warner Losh">imp</who>
    <bug_when>2024-01-13 23:07:19 +0000</bug_when>
    <thetext>It&apos;s time to close this...  Hans Petter isn&apos;t going to commit this patch, and it&apos;s simple enough if someone wants to pick up the ball and implement mixing with AFMT_FLOAT support. It&apos;s not complete enough to commit as is, though. Please file a new bug if there&apos;s something more complete.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1292046</commentid>
    <comment_count>6</comment_count>
    <who name="Warner Losh">imp</who>
    <bug_when>2024-01-13 23:07:19 +0000</bug_when>
    <thetext>It&apos;s time to close this...  Hans Petter isn&apos;t going to commit this patch, and it&apos;s simple enough if someone wants to pick up the ball and implement mixing with AFMT_FLOAT support. It&apos;s not complete enough to commit as is, though. Please file a new bug if there&apos;s something more complete.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1357235</commentid>
    <comment_count>7</comment_count>
    <who name="">commit-hook</who>
    <bug_when>2025-03-30 17:48:55 +0000</bug_when>
    <thetext>A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e1bbaa71d62c8681a576f9f5bedf475c7541bd35

commit e1bbaa71d62c8681a576f9f5bedf475c7541bd35
Author:     Christos Margiolis &lt;christos@FreeBSD.org&gt;
AuthorDate: 2025-03-30 17:45:38 +0000
Commit:     Christos Margiolis &lt;christos@FreeBSD.org&gt;
CommitDate: 2025-03-30 17:45:38 +0000

    sound: Implement AFMT_FLOAT support

    Even though the OSS manual [1] advises against using AFMT_FLOAT, there
    are applications that expect the sound driver to support it, and might
    not work properly without it.

    This patch adds AFMT_F32_LE|BE (as well as AFMT_FLOAT for OSS
    compatibility) in sys/soundcard.h and implements AFMT_F32_LE|BE &lt;-&gt;
    AFMT_S32_LE|BE conversion functions. As a result, applications can
    write/read floats to/from sound(4), but internally, because sound(4)
    works with integers, we convert floating point samples to integer ones,
    before doing any processing.

    The reason for encoding/decoding IEEE754s manually, instead of using
    fpu_kern(9), is that fpu_kern(9) is not supported by all architectures,
    and also introduces significant overhead.

    The IEEE754 encoding/decoding implementation has been written by Ariff
    Abdullah [2].

    [1] http://manuals.opensound.com/developer/AFMT_FLOAT.html
    [2] https://people.freebsd.org/~ariff/utils/ieee754.c

    PR:             157050, 184380, 264973, 280612, 281390
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Reviewed by:    emaste
    Differential Revision:  https://reviews.freebsd.org/D47638

 sys/dev/sound/pcm/channel.c       |  4 +++
 sys/dev/sound/pcm/feeder_chain.c  |  2 ++
 sys/dev/sound/pcm/feeder_rate.c   |  4 +++
 sys/dev/sound/pcm/feeder_volume.c |  2 ++
 sys/dev/sound/pcm/pcm.h           | 67 +++++++++++++++++++++++++++++++++++++--
 sys/dev/sound/pcm/sound.h         | 13 +++++---
 sys/sys/soundcard.h               |  8 +++++
 tests/sys/sound/pcm_read_write.c  |  6 ++++
 8 files changed, 98 insertions(+), 8 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1358102</commentid>
    <comment_count>8</comment_count>
    <who name="">commit-hook</who>
    <bug_when>2025-04-06 00:29:14 +0000</bug_when>
    <thetext>A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=1728d26682c65cb878971f55b4e87e24d0050524

commit 1728d26682c65cb878971f55b4e87e24d0050524
Author:     Christos Margiolis &lt;christos@FreeBSD.org&gt;
AuthorDate: 2025-03-30 17:45:38 +0000
Commit:     Christos Margiolis &lt;christos@FreeBSD.org&gt;
CommitDate: 2025-04-06 00:28:14 +0000

    sound: Implement AFMT_FLOAT support

    Even though the OSS manual [1] advises against using AFMT_FLOAT, there
    are applications that expect the sound driver to support it, and might
    not work properly without it.

    This patch adds AFMT_F32_LE|BE (as well as AFMT_FLOAT for OSS
    compatibility) in sys/soundcard.h and implements AFMT_F32_LE|BE &lt;-&gt;
    AFMT_S32_LE|BE conversion functions. As a result, applications can
    write/read floats to/from sound(4), but internally, because sound(4)
    works with integers, we convert floating point samples to integer ones,
    before doing any processing.

    The reason for encoding/decoding IEEE754s manually, instead of using
    fpu_kern(9), is that fpu_kern(9) is not supported by all architectures,
    and also introduces significant overhead.

    The IEEE754 encoding/decoding implementation has been written by Ariff
    Abdullah [2].

    [1] http://manuals.opensound.com/developer/AFMT_FLOAT.html
    [2] https://people.freebsd.org/~ariff/utils/ieee754.c

    PR:             157050, 184380, 264973, 280612, 281390
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Reviewed by:    emaste
    Differential Revision:  https://reviews.freebsd.org/D47638

    (cherry picked from commit e1bbaa71d62c8681a576f9f5bedf475c7541bd35)

 sys/dev/sound/pcm/channel.c       |  4 +++
 sys/dev/sound/pcm/feeder_chain.c  |  2 ++
 sys/dev/sound/pcm/feeder_rate.c   |  4 +++
 sys/dev/sound/pcm/feeder_volume.c |  2 ++
 sys/dev/sound/pcm/pcm.h           | 67 +++++++++++++++++++++++++++++++++++++--
 sys/dev/sound/pcm/sound.h         | 13 +++++---
 sys/sys/soundcard.h               |  8 +++++
 tests/sys/sound/pcm_read_write.c  |  6 ++++
 8 files changed, 98 insertions(+), 8 deletions(-)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>173412</attachid>
            <date>2016-08-08 16:39:55 +0000</date>
            <delta_ts>2016-08-08 16:39:55 +0000</delta_ts>
            <desc>Basic AFMT_FLOAT support</desc>
            <filename>pcm_float.diff</filename>
            <type>text/plain</type>
            <size>919</size>
            <attacher name="Hans Petter Selasky">hselasky</attacher>
            
              <data encoding="base64">SW5kZXg6IGRldi9zb3VuZC9wY20vY2hhbm5lbC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGRldi9zb3VuZC9w
Y20vY2hhbm5lbC5jCShyZXZpc2lvbiAzMDM4MzMpCisrKyBkZXYvc291bmQvcGNtL2NoYW5uZWwu
Ywkod29ya2luZyBjb3B5KQpAQCAtMTAxNyw2ICsxMDE3LDcgQEAKIAl7ICJ1MzJsZSIsICBOVUxM
LCBOVUxMLCBBRk1UX1UzMl9MRSB9LAogCXsgInUzMmJlIiwgIE5VTEwsIE5VTEwsIEFGTVRfVTMy
X0JFIH0sCiAJeyAgICJhYzMiLCAgTlVMTCw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