06-16-2020, 01:47 AM
After a suspend from memory, sound does not work.
On my machine (Manjaro ARM XFCE 20.06 Kernel 5.7), the sound driver snd_soc_es8316 needs to reset the sound chip. The problem is the kernel is preventing unloading and reloading of the sound driver snd_soc_es8316.
My first attempt was initializing the sound chip from the shell mimicking what the es8316 driver is doing in its probe function:
I got some static noise making me believe I talked to the right device
It has not helped.
The es8316 driver can't be un- and reloaded but un- and rebound. Execute this line after returning from suspend:
It's quite easy to crash the kernel. I suspect the sound driver should not be accessed in the split-second between its unbinding and binding. So far, I have only seen kernel crashes when executing the unbind/bind command while playing music. I have not seen any kernel crashes otherwise. You never know what happens on a modern Linux in the background, so YMMV.
I have some vague ideas for a proper solution. Will not happen any time soon. Hope others will step in.
On my machine (Manjaro ARM XFCE 20.06 Kernel 5.7), the sound driver snd_soc_es8316 needs to reset the sound chip. The problem is the kernel is preventing unloading and reloading of the sound driver snd_soc_es8316.
My first attempt was initializing the sound chip from the shell mimicking what the es8316 driver is doing in its probe function:
Code:
# modprobe i2c-dev
# i2cset -y -f 1 0x11 0x00 0x3f
# i2cset -y -f 1 0x11 0x00 0x80
# i2cset -y -f 1 0x11 0x0c 0xff
# i2cset -y -f 1 0x11 0x03 0x32
I got some static noise making me believe I talked to the right device

The es8316 driver can't be un- and reloaded but un- and rebound. Execute this line after returning from suspend:
Code:
$ sudo tee /sys/bus/i2c/drivers/es8316/{un,}bind <<< 1-0011
It's quite easy to crash the kernel. I suspect the sound driver should not be accessed in the split-second between its unbinding and binding. So far, I have only seen kernel crashes when executing the unbind/bind command while playing music. I have not seen any kernel crashes otherwise. You never know what happens on a modern Linux in the background, so YMMV.
I have some vague ideas for a proper solution. Will not happen any time soon. Hope others will step in.