<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Cascadia Mono";
        panose-1:2 11 6 9 2 0 0 2 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:285698515;
        mso-list-template-ids:563381088;}
@list l0:level1
        {mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level4
        {mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level7
        {mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1
        {mso-list-id:779573422;
        mso-list-template-ids:-1397184688;}
@list l1:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l2
        {mso-list-id:1624775277;
        mso-list-type:hybrid;
        mso-list-template-ids:526450268 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l2:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l2:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l2:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l2:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l2:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l2:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l2:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l2:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l2:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>I understand that my bug submission was not clear.  Here are most of the things you requested.  Let me know if you need more.  Thank you again.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level1 lfo4'>Test: See the attached Java code with two simple tests.  The code is very short and I think I put sufficient comments to make these clear.  But let me know if you need more.  (See below on regression testing).<o:p></o:p></li><ul style='margin-top:0in' type=circle><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level2 lfo4'>On Windows, with the current jdk, both tests fail.  I am testing on an audio device that supports 24-bit audio resolution.  The code: 1) shows that the audio device does NOT supports 24-bit; 2) cannot get a 24-bit line to the audio device.<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level2 lfo4'>With the two minor changes below, the code will succeed in both tests (see more on testing below).<o:p></o:p></li></ul><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level1 lfo4'>Fix: See the attached C++ code with the fix (the diff is below).  In the JDK source, this file is in src/java.desktop/windows/native/libjsound.  The fix is in the native Windows code only.<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level1 lfo4'>Diff:  There are changes to two lines only in the Windows native C++ code.<o:p></o:p></li><ul style='margin-top:0in' type=circle><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level2 lfo4'>Line 282 changes from <o:p></o:p></li></ul></ul><p class=MsoListParagraph style='margin-left:1.0in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:blue'>static</span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:black'> </span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:#2B91AF'>INT32</span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:black'> bitsArray[] = { 8, 16};</span><o:p></o:p></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in'>to<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><o:p> </o:p></p><p class=MsoListParagraph style='margin-left:1.0in'><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:blue'>static</span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:black'> </span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:#2B91AF'>INT32</span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:black'> bitsArray[] = { 8, 16, 24};<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:1.0in'><o:p> </o:p></p><ul style='margin-top:0in' type=disc><ul style='margin-top:0in' type=circle><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level2 lfo4'>Line 643 changes from<o:p></o:p></li></ul></ul><p class=MsoListParagraph style='text-autospace:none'><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:black'>    <o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in;text-autospace:none'><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:blue'>if</span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:black'> (</span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:gray'>channels</span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:black'> <= 2 && </span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:gray'>bits</span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:black'> <= 16) {<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:1.0in'><o:p> </o:p></p><p class=MsoListParagraph style='margin-left:1.0in'>to<o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:blue'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in;text-autospace:none'><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:blue'>if</span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:black'> (</span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:gray'>channels</span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:black'> <= 2 && </span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:gray'>bits</span><span style='font-size:9.5pt;font-family:"Cascadia Mono";color:black'> <= 24) {<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:1.0in'><o:p> </o:p></p><ul style='margin-top:0in' type=disc><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level1 lfo4'>Explanation: The first change allows the native implementation to recognize 24 bit as a format that an audio device may support.  The second change allows the native code to treat the 24-bit signed integer representation of sampled audio data as pulse code modulation (PCM) audio data.  This is the correct way to treat such data.<o:p></o:p></li><ul style='margin-top:0in' type=circle><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level2 lfo4'>JDK 19 without the fix, treats 24-bit audio data as one that needs the extensible wave format.  This is not correct (see lines 643 to 653 of the code).  In fact, the extensible wave format probably does not belong at all in a communication with an audio device, but I don't want to venture that far in changing the code.<o:p></o:p></li></ul><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level1 lfo4'>Regression testing is limited: First, I admit that I do not have a full range of tests.  Second, I am testing as part of a larger piece of sound production software that I cannot share.  Unfortunately, at this point, I can only confirm the following:<o:p></o:p></li><ul style='margin-top:0in' type=circle><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level2 lfo4'>On Windows, a full build of the jdk, with these changes, from a recent clone of the repository (from Sep 27) works as intended.  It permits 24-bit playback and recording at various sampling rates.<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level2 lfo4'>Importantly, on Windows, the native query in the JDK of what audio formats are supported by the audio hardware was never fully implemented in JDK 19 or previous.  Whatever bit resolution is included in line 282 of the C++ code will be shown as "supported" (the first test).  This is not ideal, but it is the same as the current implementation.  <o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level2 lfo4'>JDK 19 on Mac OS (Mojave) supports 24 bit playback (I have not tested recording yet).<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l2 level2 lfo4'>JDK 19 on Ubuntu 20 supports 24 bit playback and 24 bit recording.<o:p></o:p></li></ul></ul><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> Aleksei Ivanov <alexey.ivanov@oracle.com> <br><b>Sent:</b> Monday, October 10, 2022 5:03 PM<br><b>To:</b> <a href="mailto:magare31@gmail.com">magare31@gmail.com</a>; <a href="mailto:client-libs-dev@openjdk.org">client-libs-dev@openjdk.org</a><br><b>Subject:</b> Re: professional (24-bit) sampled audio support in the Windows native implementation of libjsound<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Hi,<br><br>JDK-8294904 [1] was resolved as Incomplete because there's no sample code which demonstrates the problem. A comment was added:<br><br>Mail to submitter: <br>============= <br>Please share standalone test case/ reproducible step/ scenario to analyze the issue better.<br><br>I should have received an email with request for clarification.<br><br>I looked through the description but it's still unclear to me how to reproduce the problem and how to incorporate the fix you're proposing and what the fix is. If you could provide the test case and better yet the fix along with a regression test, it would be greatly appreciated.<br><br>The fix in the form of the diff would also help.<br><br>-- <br>Regards,<br>Alexey<br><br>[1] <a href="https://bugs.openjdk.org/browse/JDK-8294904">https://bugs.openjdk.org/browse/JDK-8294904</a><o:p></o:p></p><div><p class=MsoNormal>On 09/10/2022 15:57, <a href="mailto:magare31@gmail.com">magare31@gmail.com</a> wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>Since I am new to this, and apologies for the broad email, could someone explain the following for the corresponding bug (JDK-8294904)?<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><ol style='margin-top:0in' start=1 type=1><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo3'>This bug is listed as one for a generic OS, whereas I specified Windows (I can confirm that it is Windows only).<o:p></o:p></li><li class=MsoListParagraph style='margin-left:0in;mso-list:l0 level1 lfo3'>This bug is listed as "resolved" with an "incomplete resolution".  I did provide the full solution, so I am not sure what this means.  (Also, Oracle asked for a standalone test, which I also provided over email)<o:p></o:p></li></ol><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>And thanks.<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> Kevin Rushforth <a href="mailto:kevin.rushforth@oracle.com"><kevin.rushforth@oracle.com></a> <br><b>Sent:</b> Friday, September 30, 2022 8:29 AM<br><b>To:</b> <a href="mailto:magare31@gmail.com">magare31@gmail.com</a>; <a href="mailto:client-libs-dev@openjdk.org">client-libs-dev@openjdk.org</a>; <a href="mailto:core-libs-dev@openjdk.org">core-libs-dev@openjdk.org</a><br><b>Subject:</b> Re: professional (24-bit) sampled audio support in the Windows native implementation of libjsound<o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Java Sound is in the client-libs area. You can file the bug yourself at <a href="https://bugreport.java.com/">https://bugreport.java.com/</a> if you like, or ask the sponsor of your bug (when one steps forward) to do it.<br><br>If you want to contribute your fix, please see the contributing a patch section [1] in the JDK Developers Guide for the next steps.<br><br>-- Kevin<br><br>[1] <a href="https://openjdk.org/guide/#i-have-a-patch-what-do-i-do">https://openjdk.org/guide/#i-have-a-patch-what-do-i-do</a><br><br><br><o:p></o:p></p><div><p class=MsoNormal>On 9/30/2022 4:33 AM, <a href="mailto:magare31@gmail.com">magare31@gmail.com</a> wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>Would anyone want to sponsor the following simple bug fix?<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>- The purpose is to enable playback and recording of 24-bit sampled audio on Windows.  This is already supported on other systems.<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>- There is no associated bug in the bug database.  I noted it as a "bug" as the code misunderstands the WAVE RIFF format standards.<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>- There will be two very small changes to one Windows native cpp file under libjsound<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>- I have tested the changes on a jdk build of the latest code.<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Also, please advise which of these two groups this belongs to: client libs or core libs?<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p></blockquote><p class=MsoNormal> <o:p></o:p></p></blockquote><p class=MsoNormal><o:p> </o:p></p></div></body></html>