The HDMI sound is already working out-of-the-box using kernel 5.3-rc1, but when suspend/resume is executed, the sound become choppy and/or slow after resume.
It turns out that the clock supplied to i2s block is halved (some bug in suspend stuff),
as a workaround, the clock value must be divided by two to overcome this problem:
inside hw_params function of i2s.c module (/sound/soc/samsung/i2s.c, the rclk_srcrate must be halved , before return from hw_params I inserted:
Code: Select all
if(mod == 0){
priv->rclk_srcrate = priv->rclk_srcrate / 2; //workaround-2, clock is being halved due to unknwon bug
printk(KERN_EMERG "i2s hw_param rclk_srcrate after resume %lu !\n", priv->rclk_srcrate);
}
return 0;
This clock is used inside config_setup function to calculate proper value of PSR register to generate the audio clock rate.
Also, to force using internal clock of i2s block, I inserted the following code inside i2s_resume function:
Code: Select all
static int i2s_resume(struct snd_soc_dai *dai)
{
struct samsung_i2s_priv *priv = dev_get_drvdata(dai->dev);
printk(KERN_EMERG "i2s resume of dai !\n");
priv->suspend_i2smod = 0;//workaround-1 , to force using internal codec clock source (CDCLKCON bit = 0)
//see another workaround inside hw_param
return pm_runtime_force_resume(dai->dev);
}