<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Thanks for noticing !<br>
      <br>
      Indeed  snd_hdac_query_supported_pcm() also should be aligned.  <br>
      Could you help a bit there with explaining background of current
      implementation ?<br>
      I'm wondering  why SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE  is set
      instead of  SNDRV_PCM_FMTBIT_S32_LE in case of using 32 bits and
      AC_WCAP_DIGITAL.<br>
      <br>
      Whats more, bps looks like redundant information there, as pcm
      formats have width defined in sound/core/pcm-misc.c.</p>
    <p>I would leave 20 and 24 bits per sample there, as those are
      supported<span style="font-size:9.0pt;mso-bidi-font-size:10.0pt;
font-family:"Verdana",sans-serif;mso-fareast-font-family:"Times
        New Roman";
        mso-bidi-font-family:"Times New
        Roman";mso-ansi-language:EN-US;mso-fareast-language:
        EN-US;mso-bidi-language:AR-SA"> </span><span
        style="font-size:9.0pt;mso-bidi-font-size:10.0pt;
font-family:"Verdana",sans-serif;mso-fareast-font-family:"Times
        New Roman";
        mso-bidi-font-family:"Times New
        Roman";mso-ansi-language:EN-US;mso-fareast-language:
        EN-US;mso-bidi-language:AR-SA"><span
          style="font-size:9.0pt;mso-bidi-font-size:10.0pt;
font-family:"Verdana",sans-serif;mso-fareast-font-family:"Times
          New Roman";
          mso-bidi-font-family:"Times New
          Roman";mso-ansi-language:EN-US;mso-fareast-language:
          EN-US;mso-bidi-language:AR-SA">formats for</span> stream DMA.</span></p>
    <p>Regards, <br>
      Paweł</p>
    <div class="moz-cite-prefix">On 9/5/2019 7:47 AM, Takashi Iwai
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:s5hblvzguqb.wl-tiwai@suse.de">
      <pre class="moz-quote-pre" wrap="">On Thu, 05 Sep 2019 07:32:59 +0200,
Pawel Harlozinski wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">
Set SDxFMT based only on given format, due to maxbps not always being set.
Split cases for formats 20,24,32 bits.
For format SNDRV_PCM_FORMAT_FLOAT_LE width is equal 32 so it will end up
with same mask.
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
This function corresponds to snd_hdac_query_supported_pcm(), so this
patch breaks.

Basically the cases of 20 and 24 are superfluous and can be dropped.
It's there just to be sure.


Takashi

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">
Signed-off-by: Pawel Harlozinski <a class="moz-txt-link-rfc2396E" href="mailto:pawel.harlozinski@linux.intel.com"><pawel.harlozinski@linux.intel.com></a>
---
 sound/hda/hdac_device.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c
index b26cc93e7e10..add758e11b85 100644
--- a/sound/hda/hdac_device.c
+++ b/sound/hda/hdac_device.c
@@ -759,14 +759,13 @@ unsigned int snd_hdac_calc_stream_format(unsigned int rate,
                val |= AC_FMT_BITS_16;
                break;
        case 20:
+               val |= AC_FMT_BITS_20;
+               break;
        case 24:
+               val |= AC_FMT_BITS_24;
+               break;
        case 32:
-               if (maxbps >= 32 || format == SNDRV_PCM_FORMAT_FLOAT_LE)
-                       val |= AC_FMT_BITS_32;
-               else if (maxbps >= 24)
-                       val |= AC_FMT_BITS_24;
-               else
-                       val |= AC_FMT_BITS_20;
+               val |= AC_FMT_BITS_32;
                break;
        default:
                return 0;
-- 
2.17.1

</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Alsa-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Alsa-devel@alsa-project.org">Alsa-devel@alsa-project.org</a>
<a class="moz-txt-link-freetext" href="https://mailman.alsa-project.org/mailman/listinfo/alsa-devel">https://mailman.alsa-project.org/mailman/listinfo/alsa-devel</a>
</pre>
    </blockquote>
  </body>
</html>