All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>, Yu-Hsuan Hsu <yuhsuan@chromium.org>
Cc: "Lu, Brent" <brent.lu@intel.com>,
	Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Rojewski, Cezary" <cezary.rojewski@intel.com>,
	Jie Yang <yang.jie@linux.intel.com>,
	Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Sam McNally <sammc@chromium.org>, Mark Brown <broonie@kernel.org>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Daniel Stuart <daniel.stuart14@gmail.com>,
	"yuhsuan@google.com" <yuhsuan@google.com>,
	Damian van Soelen <dj.vsoelen@gmail.com>
Subject: Re: [PATCH v3 2/2] ASoC: Intel: Add period size constraint on strago board
Date: Thu, 13 Aug 2020 07:57:35 -0500	[thread overview]
Message-ID: <e836596b-8ed8-d85f-8226-a471ab4c23d3@linux.intel.com> (raw)
In-Reply-To: <s5h8sejvsrs.wl-tiwai@suse.de>



On 8/13/20 3:45 AM, Takashi Iwai wrote:
> On Thu, 13 Aug 2020 10:36:57 +0200,
> Yu-Hsuan Hsu wrote:
>>
>> Lu, Brent <brent.lu@intel.com> 於 2020年8月13日 週四 下午3:55寫道:
>>>
>>>>>>
>>>>>> CRAS calls snd_pcm_hw_params_set_buffer_size_max() to use as large
>>>>>> buffer as possible. So the period size is an arbitrary number in
>>>>>> different platforms. Atom SST platform happens to be 256, and CML
>>>>>> SOF platform is 1056 for example.
>>>>>
>>>>> ok, but earlier in this thread it was mentioned that values such as
>>>>> 432 are not suitable. the statement above seems to mean the period
>>>>> actual value is a "don't care", so I don't quite see why this specific
>>>>> patch2 restricting the value to 240 is necessary. Patch1 is needed for
>>>>> sure,
>>>>> Patch2 is where Takashi and I are not convinced.
>>>>
>>>> I have downloaded the patch1 but it does not work. After applying patch1,
>>>> the default period size changes to 320. However, it also has the same issue
>>>> with period size 320. (It can be verified by aplay.)
>>>
>>> The period_size is related to the audio latency so it's decided by application
>>> according to the use case it's running. That's why there are concerns about
>>> patch 2 and also you cannot find similar constraints in other machine driver.
>> You're right. However, the problem here is the provided period size
>> does not work. Like 256, setting the period size to 320 also makes
>> users have big latency in the DSP ring buffer.
>>
>> localhost ~ # aplay -Dhw:1,0 --period-size=320 --buffer-size=640
>> /dev/zero -d 1 -f dat --test-position
>> Playing raw data '/dev/zero' : Signed 16 bit Little Endian, Rate 48000
>> Hz, Stereo
>> Suspicious buffer position (1 total): avail = 0, delay = 2640, buffer = 640
>> Suspicious buffer position (2 total): avail = 0, delay = 2640, buffer = 640
>> Suspicious buffer position (3 total): avail = 0, delay = 2720, buffer = 640
>> ...
> 
> It means that the delay value returned from the driver is bogus.
> I suppose it comes pcm_delay value calculated in sst_calc_tstamp(),
> but haven't followed the code closely yet.  Maybe checking the debug
> outputs can help to trace what's going wrong.

the problem is really that we add a constraint that the period size be a 
multiple of 1ms, and it's not respected. 320 samples is not a valid 
choice, I don't get how it ends-up being selected? there's a glitch in 
the matrix here.



WARNING: multiple messages have this Message-ID (diff)
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>, Yu-Hsuan Hsu <yuhsuan@chromium.org>
Cc: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	"Rojewski, Cezary" <cezary.rojewski@intel.com>,
	Jie Yang <yang.jie@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Sam McNally <sammc@chromium.org>, Mark Brown <broonie@kernel.org>,
	"yuhsuan@google.com" <yuhsuan@google.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Daniel Stuart <daniel.stuart14@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"Lu, Brent" <brent.lu@intel.com>,
	Damian van Soelen <dj.vsoelen@gmail.com>
Subject: Re: [PATCH v3 2/2] ASoC: Intel: Add period size constraint on strago board
Date: Thu, 13 Aug 2020 07:57:35 -0500	[thread overview]
Message-ID: <e836596b-8ed8-d85f-8226-a471ab4c23d3@linux.intel.com> (raw)
In-Reply-To: <s5h8sejvsrs.wl-tiwai@suse.de>



On 8/13/20 3:45 AM, Takashi Iwai wrote:
> On Thu, 13 Aug 2020 10:36:57 +0200,
> Yu-Hsuan Hsu wrote:
>>
>> Lu, Brent <brent.lu@intel.com> 於 2020年8月13日 週四 下午3:55寫道:
>>>
>>>>>>
>>>>>> CRAS calls snd_pcm_hw_params_set_buffer_size_max() to use as large
>>>>>> buffer as possible. So the period size is an arbitrary number in
>>>>>> different platforms. Atom SST platform happens to be 256, and CML
>>>>>> SOF platform is 1056 for example.
>>>>>
>>>>> ok, but earlier in this thread it was mentioned that values such as
>>>>> 432 are not suitable. the statement above seems to mean the period
>>>>> actual value is a "don't care", so I don't quite see why this specific
>>>>> patch2 restricting the value to 240 is necessary. Patch1 is needed for
>>>>> sure,
>>>>> Patch2 is where Takashi and I are not convinced.
>>>>
>>>> I have downloaded the patch1 but it does not work. After applying patch1,
>>>> the default period size changes to 320. However, it also has the same issue
>>>> with period size 320. (It can be verified by aplay.)
>>>
>>> The period_size is related to the audio latency so it's decided by application
>>> according to the use case it's running. That's why there are concerns about
>>> patch 2 and also you cannot find similar constraints in other machine driver.
>> You're right. However, the problem here is the provided period size
>> does not work. Like 256, setting the period size to 320 also makes
>> users have big latency in the DSP ring buffer.
>>
>> localhost ~ # aplay -Dhw:1,0 --period-size=320 --buffer-size=640
>> /dev/zero -d 1 -f dat --test-position
>> Playing raw data '/dev/zero' : Signed 16 bit Little Endian, Rate 48000
>> Hz, Stereo
>> Suspicious buffer position (1 total): avail = 0, delay = 2640, buffer = 640
>> Suspicious buffer position (2 total): avail = 0, delay = 2640, buffer = 640
>> Suspicious buffer position (3 total): avail = 0, delay = 2720, buffer = 640
>> ...
> 
> It means that the delay value returned from the driver is bogus.
> I suppose it comes pcm_delay value calculated in sst_calc_tstamp(),
> but haven't followed the code closely yet.  Maybe checking the debug
> outputs can help to trace what's going wrong.

the problem is really that we add a constraint that the period size be a 
multiple of 1ms, and it's not respected. 320 samples is not a valid 
choice, I don't get how it ends-up being selected? there's a glitch in 
the matrix here.



  reply	other threads:[~2020-08-13 12:57 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 11:03 [PATCH 0/2] Add period size constraint for Atom Chromebook Brent Lu
2020-07-29 11:03 ` Brent Lu
2020-07-29 11:03 ` [PATCH 1/2] ASoC: intel: atom: Add period size constraint Brent Lu
2020-07-29 11:03   ` Brent Lu
2020-07-29 11:19   ` Andy Shevchenko
2020-07-29 11:19     ` Andy Shevchenko
2020-07-29 11:03 ` [PATCH 2/2] ASoC: Intel: Add period size constraint on strago board Brent Lu
2020-07-29 11:03   ` Brent Lu
2020-07-29 14:08   ` Pierre-Louis Bossart
2020-07-29 14:08     ` Pierre-Louis Bossart
2020-07-30  8:02     ` Lu, Brent
2020-07-30  8:02       ` Lu, Brent
2020-07-30 15:27       ` Pierre-Louis Bossart
2020-07-30 15:44         ` Pierre-Louis Bossart
2020-07-30 16:17           ` Lu, Brent
2020-07-30 16:17             ` Lu, Brent
2020-07-30 16:56         ` Takashi Iwai
2020-07-30 16:56           ` Takashi Iwai
2020-07-31 12:28           ` Lu, Brent
2020-07-31 12:28             ` Lu, Brent
2020-07-29 11:20 ` [PATCH 0/2] Add period size constraint for Atom Chromebook Andy Shevchenko
2020-07-29 11:20   ` Andy Shevchenko
2020-07-31 12:26 ` [PATCH v3 " Brent Lu
2020-07-31 12:26   ` Brent Lu
2020-07-31 12:26   ` [PATCH v3 1/2] ASoC: intel: atom: Add period size constraint Brent Lu
2020-07-31 12:26     ` Brent Lu
2020-07-31 12:26   ` [PATCH v3 2/2] ASoC: Intel: Add period size constraint on strago board Brent Lu
2020-07-31 12:26     ` Brent Lu
2020-07-31 13:34     ` Takashi Iwai
2020-07-31 13:34       ` Takashi Iwai
2020-08-01  8:58       ` Lu, Brent
2020-08-01  8:58         ` Lu, Brent
2020-08-01  9:26         ` Takashi Iwai
2020-08-01  9:26           ` Takashi Iwai
2020-08-03 13:00           ` Lu, Brent
2020-08-03 13:00             ` Lu, Brent
2020-08-03 15:13             ` Pierre-Louis Bossart
2020-08-03 15:13               ` Pierre-Louis Bossart
2020-08-03 16:45               ` Lu, Brent
2020-08-03 16:45                 ` Lu, Brent
2020-08-03 16:56                 ` Takashi Iwai
2020-08-03 16:56                   ` Takashi Iwai
2020-08-04  4:33                   ` Lu, Brent
2020-08-04  4:33                     ` Lu, Brent
2020-08-04 14:24                     ` Pierre-Louis Bossart
2020-08-04 14:24                       ` Pierre-Louis Bossart
2020-08-06 16:41                       ` Lu, Brent
2020-08-06 16:41                         ` Lu, Brent
2020-08-10 15:03                         ` Pierre-Louis Bossart
2020-08-10 15:03                           ` Pierre-Louis Bossart
2020-08-10 17:38                           ` Yu-Hsuan Hsu
2020-08-10 17:38                             ` Yu-Hsuan Hsu
2020-08-11  2:16                             ` Lu, Brent
2020-08-11  2:16                               ` Lu, Brent
2020-08-11  2:29                               ` Yu-Hsuan Hsu
2020-08-11  2:29                                 ` Yu-Hsuan Hsu
2020-08-11  7:43                                 ` Takashi Iwai
2020-08-11  7:43                                   ` Takashi Iwai
2020-08-11  8:25                                   ` Yu-Hsuan Hsu
2020-08-11  8:25                                     ` Yu-Hsuan Hsu
2020-08-11  8:39                                     ` Takashi Iwai
2020-08-11  8:39                                       ` Takashi Iwai
2020-08-11  9:35                                       ` Yu-Hsuan Hsu
2020-08-11  9:35                                         ` Yu-Hsuan Hsu
2020-08-11 14:53                                         ` Mark Brown
2020-08-11 14:53                                           ` Mark Brown
2020-08-11 16:54                                           ` Pierre-Louis Bossart
2020-08-11 16:54                                             ` Pierre-Louis Bossart
2020-08-11 17:22                                             ` Mark Brown
2020-08-11 17:22                                               ` Mark Brown
2020-08-12  3:09                                               ` Yu-Hsuan Hsu
2020-08-12  3:09                                                 ` Yu-Hsuan Hsu
2020-08-12  6:13                                                 ` Takashi Iwai
2020-08-12  6:13                                                   ` Takashi Iwai
2020-08-12  6:53                                                   ` Yu-Hsuan Hsu
2020-08-12  6:53                                                     ` Yu-Hsuan Hsu
2020-08-12  6:58                                                     ` Takashi Iwai
2020-08-12  6:58                                                       ` Takashi Iwai
2020-08-12  7:43                                                       ` Yu-Hsuan Hsu
2020-08-12  7:43                                                         ` Yu-Hsuan Hsu
2020-08-12  7:47                                                         ` Takashi Iwai
2020-08-12  7:47                                                           ` Takashi Iwai
2020-08-12 14:46                                                           ` Pierre-Louis Bossart
2020-08-12 14:46                                                             ` Pierre-Louis Bossart
2020-08-12 14:55                                                             ` Takashi Iwai
2020-08-12 14:55                                                               ` Takashi Iwai
2020-08-12 15:54                                                               ` Pierre-Louis Bossart
2020-08-12 15:54                                                                 ` Pierre-Louis Bossart
2020-08-12 16:08                                                                 ` Lu, Brent
2020-08-12 16:08                                                                   ` Lu, Brent
2020-08-12 16:38                                                                   ` Pierre-Louis Bossart
2020-08-12 16:38                                                                     ` Pierre-Louis Bossart
2020-08-13  6:24                                                                     ` Yu-Hsuan Hsu
2020-08-13  6:24                                                                       ` Yu-Hsuan Hsu
2020-08-13  7:55                                                                       ` Lu, Brent
2020-08-13  7:55                                                                         ` Lu, Brent
2020-08-13  8:36                                                                         ` Yu-Hsuan Hsu
2020-08-13  8:36                                                                           ` Yu-Hsuan Hsu
2020-08-13  8:45                                                                           ` Takashi Iwai
2020-08-13  8:45                                                                             ` Takashi Iwai
2020-08-13 12:57                                                                             ` Pierre-Louis Bossart [this message]
2020-08-13 12:57                                                                               ` Pierre-Louis Bossart
2020-08-13 17:15                                                                               ` Yu-Hsuan Hsu
2020-08-13 17:15                                                                                 ` Yu-Hsuan Hsu
2020-08-21 16:40   ` [PATCH v3 0/2] Add period size constraint for Atom Chromebook Mark Brown
2020-08-21 16:40     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e836596b-8ed8-d85f-8226-a471ab4c23d3@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brent.lu@intel.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=daniel.stuart14@gmail.com \
    --cc=dj.vsoelen@gmail.com \
    --cc=guennadi.liakhovetski@linux.intel.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sammc@chromium.org \
    --cc=tiwai@suse.com \
    --cc=tiwai@suse.de \
    --cc=yang.jie@linux.intel.com \
    --cc=yuhsuan@chromium.org \
    --cc=yuhsuan@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.