SAI Constant Clocks

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SAI Constant Clocks

716 Views
starkers
Contributor II

We have a product where we are using multiple SAI interfaces of the IMX8MNano and kernel 5.15.

We see an issue where by the mclk remains active at all times, but the bclk and fsclck are not active until data is received on the data line.

This causes a number of dacs to exhibit a small pop sound when the tx line data flow starts. Understandably as the mclk remains active, so does the dac but the other clocks are missing when data is initially presented to it.

We have been editing the fsl,sai.c files to try and stop this behavior in the relevant switch statements for data states, but this is also not working as it seems the registry bits are over written elsewhere.

Is there a known simple fix for this behavior to force all clocks to remain active for an SAI interface, regardless of the data flow?

 

0 Kudos
Reply
1 Reply

701 Views
starkers
Contributor II

We solved this. For anyone else experiencing this issue, you can fix the clocks by specifying a rate in alsa's asound.conf. When the device is initialized, it will use this fixed rate and the blck and fsclk remain active. This will only work if you can use fixed rates. An example of an alsa config with a softvol chain and fixed rates to keep the clocks alive:

pcm.player1 {
type softvol
slave.pcm "player1v"
control.name "p1.m"
control.card 0
resolution 2
}

pcm.player1v { #volume
type softvol
slave {
pcm "1out"
}
control {
name "p1.v"
card 0
}
}

pcm.1out {
type dmix
ipc_key 87882222
ipc_key_add_uid false
ipc_perm 0666
slave {
pcm "hw:SAI3"
rate 48000
period_size 128
buffer_size 2048
format S32_LE
}
}

 

0 Kudos
Reply