* Re: Odroid-XU4 sound issue after suspend-resume
[not found] ` <CAF-0O_4xOQNkX5ZyyVz7zZDAP9XBeUKv65T0cd+oAAV1ahLQ9Q@mail.gmail.com>
@ 2019-08-07 8:22 ` Sylwester Nawrocki
2019-08-07 16:35 ` Sylwester Nawrocki
0 siblings, 1 reply; 2+ messages in thread
From: Sylwester Nawrocki @ 2019-08-07 8:22 UTC (permalink / raw)
To: Jaafar Ali
Cc: linux-samsung-soc, linux-kernel, kgene, Krzysztof Kozlowski, sam,
linux-clk
Hi Jaafar,
On 8/5/19 15:27, Jaafar Ali wrote:
> Dear All,
> Kernel 5.3-rc1
> OS: ubuntu 18.04
> Hardware: Odroid-XU4
> The sound of Odroid-XU4 after suspend/resume cycle is choppy and slow.
> I have found a workaround, the I2SMOD register value should be set to
> zero after resume to force using internal codec clock (cdclkcon bit = 0),
> also the rclk_srcrate which is obtained from the function
> *clk_get_rate(rclksrc) *inside *hw_params* function is not correct and
> must be divided by 2 to obtain proper value, i2s_resume function
> is modified to:
>
> static int i2s_resume(struct snd_soc_dai *dai)
> {
> struct samsung_i2s_priv *priv = dev_get_drvdata(dai->dev);
> priv->suspend_i2smod = 0;//workaround-1 ,
> return pm_runtime_force_resume(dai->dev);
>
> }
>
> inside hw_params function, the rclk_srcrate must be halved to solve
> unknown problem of clock shift, so before return from hw_params we
> must insert:
> if(mod == 0){
> priv->rclk_srcrate = priv->rclk_srcrate / 2; //workaround-2,
> }
>
> With these two workaround sound issue was solved, but I hope we can
> get concrete fix.
Thank you for the bug report. I spent some time on debugging this and
it turned out that there is a clock mux between EPLL and the audio
subsystem which looses its configuration during suspend/resume cycle.
So we end up with the I2S controller clocked from the main oscillator
clock (24 MHz) rather than the EPLL (196.608 MHz) after system suspend/
resume. I will post a patch for clk-exynos5420 driver shortly.
--
Regards,
Sylwester
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Odroid-XU4 sound issue after suspend-resume
2019-08-07 8:22 ` Odroid-XU4 sound issue after suspend-resume Sylwester Nawrocki
@ 2019-08-07 16:35 ` Sylwester Nawrocki
0 siblings, 0 replies; 2+ messages in thread
From: Sylwester Nawrocki @ 2019-08-07 16:35 UTC (permalink / raw)
To: Jaafar Ali
Cc: linux-samsung-soc, linux-kernel, kgene, Krzysztof Kozlowski, sam,
linux-clk
On 8/7/19 10:22, Sylwester Nawrocki wrote:
> On 8/5/19 15:27, Jaafar Ali wrote:
>> Dear All,
>> Kernel 5.3-rc1
>> OS: ubuntu 18.04
>> Hardware: Odroid-XU4
>> The sound of Odroid-XU4 after suspend/resume cycle is choppy and slow.
>> I have found a workaround, the I2SMOD register value should be set to
>> zero after resume to force using internal codec clock (cdclkcon bit = 0),
>> also the rclk_srcrate which is obtained from the function
>> *clk_get_rate(rclksrc) *inside *hw_params* function is not correct and
>> must be divided by 2 to obtain proper value, i2s_resume function
>> is modified to:
>>
>> static int i2s_resume(struct snd_soc_dai *dai)
>> {
>> struct samsung_i2s_priv *priv = dev_get_drvdata(dai->dev);
>> priv->suspend_i2smod = 0;//workaround-1 ,
>> return pm_runtime_force_resume(dai->dev);
>>
>> }
>>
>> inside hw_params function, the rclk_srcrate must be halved to solve
>> unknown problem of clock shift, so before return from hw_params we
>> must insert:
>> if(mod == 0){
>> priv->rclk_srcrate = priv->rclk_srcrate / 2; //workaround-2,
>> }
>>
>> With these two workaround sound issue was solved, but I hope we can
>> get concrete fix.
> Thank you for the bug report. I spent some time on debugging this and
> it turned out that there is a clock mux between EPLL and the audio
> subsystem which looses its configuration during suspend/resume cycle.
> So we end up with the I2S controller clocked from the main oscillator
> clock (24 MHz) rather than the EPLL (196.608 MHz) after system suspend/
> resume. I will post a patch for clk-exynos5420 driver shortly.
My apologies, I forgot to add you at Cc of related patches, they are
available at patchwork:
https://patchwork.kernel.org/patch/11082423
https://patchwork.kernel.org/patch/11082427
Could you try and test and let me know if that fixes your issue?
--
Thanks,
Sylwester
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-07 16:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20190805133249epcas2p3aea30967f18f03f7fc1ed9dc7cbcb1d5@epcas2p3.samsung.com>
[not found] ` <CAF-0O_4xOQNkX5ZyyVz7zZDAP9XBeUKv65T0cd+oAAV1ahLQ9Q@mail.gmail.com>
2019-08-07 8:22 ` Odroid-XU4 sound issue after suspend-resume Sylwester Nawrocki
2019-08-07 16:35 ` Sylwester Nawrocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).