mailman.alsa-project.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Patch

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
patch@alsa-project.org

September 2020

  • 3 participants
  • 4 discussions
Re: [ALSA patch] [PATCH v3 1/1] ALSA: hda: Refactor calculating SDnFMT according to specification
by Takashi Iwai 22 Sep '20

22 Sep '20
On Tue, 22 Sep 2020 17:33:32 +0200, Pawel Harlozinski wrote: > > Fix setting SDnFMT based on :wq > High Definition Audio Specification Rev. 1.0a page 48. > > Bits per Sample (BITS): > 000 = 8 bits. The data will be packed in memory in 8-bit containers on 16-bit boundaries. > 001 = 16 bits. The data will be packed in memory in 16-bit containers on 16-bit boundaries. > 010 = 20 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 011 = 24 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 100 = 32 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 101-111 = Reserved > > Set SDnFMT depending on which format was given. > Henceforth split cases for formats 20, 24, 32 bits, > but leave constraints to maxbps. > > Signed-off-by: Pawel Harlozinski <pawel.harlozinski(a)linux.intel.com> As I repeatedly wrote, the bits 20 and 24 cases never hit practically, hence this "refactoring" doesn't give any change in reality. Your commit misses that point. That said, this can be taken as a complementary for the theoretical case, but the situation has to be clarified in the commit log, and the subject should be adjusted as well. thanks, Takashi > > --- > > v3: drop gerrit Change-Id > v2: leave constraints to maxbps > > sound/hda/hdac_device.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c > index 3e9e9ac804f6..ccc47a10ba63 100644 > --- a/sound/hda/hdac_device.c > +++ b/sound/hda/hdac_device.c > @@ -764,7 +764,14 @@ 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: > + if (maxbps >= 24) > + val |= AC_FMT_BITS_24; > + else > + val |= AC_FMT_BITS_20; > + break; > case 32: > if (maxbps >= 32 || format == SNDRV_PCM_FORMAT_FLOAT_LE) > val |= AC_FMT_BITS_32; > -- > 2.17.1 >
1 0
0 0
Re: [ALSA patch] [PATCH v2 1/1] ALSA: hda: Refactor calculating SDnFMT according to specification
by Takashi Iwai 21 Sep '20

21 Sep '20
On Mon, 21 Sep 2020 11:42:00 +0200, Pawel Harlozinski wrote: > > Fix setting SDnFMT based on High Definition Audio Specification Rev. 1.0a page 48. > > Bits per Sample (BITS): > 000 = 8 bits. The data will be packed in memory in 8-bit containers on 16-bit boundaries. > 001 = 16 bits. The data will be packed in memory in 16-bit containers on 16-bit boundaries. > 010 = 20 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 011 = 24 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 100 = 32 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 101-111 = Reserved > > Set SDnFMT depending on which format was given. > Henceforth split cases for formats 20, 24, 32 bits, > but leave constraints to maxbps. As mentioned in the previous thread, practically seen, case 20 and 24 are never met, since HD-audio doesn't accept the SNDRV_PCM_FORMAT_20* or _24* due to the 32bit container. So this change is superfluous. I can take the change, but it has to be clarified that it won't affect the behavior on the real hardware but pure theoretical. > Change-Id: I97771b16da14e85b7f35372f5dfc87bb13bb5ce0 Please drop change-id. It's not useful for others. thanks, Takashi > Signed-off-by: Pawel Harlozinski <pawel.harlozinski(a)linux.intel.com> > --- > sound/hda/hdac_device.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c > index 3e9e9ac804f6..ccc47a10ba63 100644 > --- a/sound/hda/hdac_device.c > +++ b/sound/hda/hdac_device.c > @@ -764,7 +764,14 @@ 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: > + if (maxbps >= 24) > + val |= AC_FMT_BITS_24; > + else > + val |= AC_FMT_BITS_20; > + break; > case 32: > if (maxbps >= 32 || format == SNDRV_PCM_FORMAT_FLOAT_LE) > val |= AC_FMT_BITS_32; > -- > 2.17.1 >
1 0
0 0
Re: [ALSA patch] [PATCH v2 1/1] ALSA: hda: Refactor calculating SDnFMT according to specification
by Rojewski, Cezary 21 Sep '20

21 Sep '20
On 2020-09-21 11:42 AM, Pawel Harlozinski wrote: > Fix setting SDnFMT based on High Definition Audio Specification Rev. 1.0a page 48. > > Bits per Sample (BITS): > 000 = 8 bits. The data will be packed in memory in 8-bit containers on 16-bit boundaries. > 001 = 16 bits. The data will be packed in memory in 16-bit containers on 16-bit boundaries. > 010 = 20 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 011 = 24 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 100 = 32 bits. The data will be packed in memory in 32-bit containers on 32-bit boundaries. > 101-111 = Reserved > > Set SDnFMT depending on which format was given. > Henceforth split cases for formats 20, 24, 32 bits, > but leave constraints to maxbps. > > Change-Id: I97771b16da14e85b7f35372f5dfc87bb13bb5ce0 Hello, checkpatch script should have notified you about need for removing Change-Id. Please remove for the next version. Has there been any explanation for why v2 is sent and what changes have been made between v1 and v2? Czarek > Signed-off-by: Pawel Harlozinski <pawel.harlozinski(a)linux.intel.com> > --- > sound/hda/hdac_device.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c > index 3e9e9ac804f6..ccc47a10ba63 100644 > --- a/sound/hda/hdac_device.c > +++ b/sound/hda/hdac_device.c > @@ -764,7 +764,14 @@ 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: > + if (maxbps >= 24) > + val |= AC_FMT_BITS_24; > + else > + val |= AC_FMT_BITS_20; > + break; > case 32: > if (maxbps >= 32 || format == SNDRV_PCM_FORMAT_FLOAT_LE) > val |= AC_FMT_BITS_32; >
1 0
0 0
Re: [ALSA patch] [PATCH] ALSA: hda: Refactor calculating SDnFMT according to specification
by Takashi Iwai 02 Sep '20

02 Sep '20
On Mon, 24 Aug 2020 14:16:26 +0200, Kai Vehmanen wrote: > > Hey, > > On Mon, 24 Aug 2020, Pawel Harlozinski wrote: > > > Set SDnFMT depending on which format was given, as maxbps only describes container size. > > hmm, I'm not entirely sure that is correct. Usage may be a bit varied, but > most places in existing code, "maxbps" is treated as number of significant > bits, not the container size. E.g. in hdac_hda.c: > > » if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) > » » maxbps = dai->driver->playback.sig_bits; > » else > » » maxbps = dai->driver->capture.sig_bits; > > It would seem "maxbps" is a bit superfluous given the same information can > be relayed in "format" as well. But currently it's still used. E.g. if you > look at snd_hdac_query_supported_pcm(), if codec reports 24bit support, > format is always set to SNDRV_PCM_FMTBIT_S32_LE, even if only 24bit are > valid. So snd_pcm_format_width() will not return the expected significant > bits info, but you have to use "maxbps". So original code seems correct > (or at least you'd need to update both places). Hm, we need to check the call pattern, then. The maxbps passed to this function was supposed to be the value obtained from snd_hdac_query_supported_pcm(), i.e. the codec capability. But, basically this patch wouldn't change any practical behavior. In the current code, snd_pcm_format_width() can be never 20 or 24, because the 24 and 24bit supports are also with SNDRV_PCM_FMT_S32_LE. That is, the cases 20 and 24 there are superfluous from the beginning (although the checks of maxbps are still needed). Instead, what we could improve is: - Set up the proper msbits hw_constraint to reflect the maxbps value - Choose the right AC_FMT_BITS_* depending on the hw_params msbits We may change the query function not to return a single maxbps value but rather storing the raw PCM parameter value (AC_SUPPCM_*), and pass it at re-encoding the format value, too, if we want to make things perfect. thanks, Takashi
2 2
0 0

HyperKitty Powered by HyperKitty version 1.3.8.