[alsa-devel] Not able to restart audio after hibernation

Rajeev kumar rajeev-dlh.kumar at st.com
Fri Jan 6 11:47:50 CET 2012

Hello Mark,

I am testing my audio driver on spear platform with the linux kernel 
2.6.37. During testing I put my system in hibernation mode and found 
that there is no sound after resume. The steps I am using for 
hibernation are
1. Have audio player on, select some audio, (using aplay utils)
2. Hibernate machine
3. Resume from hibernate

After resume it seems that there is no data available in the buffer to 
play, as application is giving pcm_write error and  exit.

While going through the suspend/resume implementation in the alsa 
framework, get to know that feature to support hibernation is missing.
The suspend/resume implementation for audio is with dev_pm_ops which is 
present in snd-core.c . If we look into the structure, we have only 
suspend, resume and poweroff feature present in it. To support 
hibernation we need freeze,thaw and restore also.
Please correct me if I am wrong?

Just for experiment I modified the structure and added freeze, thaw and 
restore functionality, but the result is same. The new modified 
structure looks like

static const struct dev_pm_ops soc_pm_ops = {
	.suspend = soc_suspend,
	.resume = soc_resume,
	.freeze = soc_suspend,
	.thaw = soc_resume,
	.restore = soc_resume,

	.poweroff = soc_poweroff,

Just for info audio is working fine in case of suspend-to-ram.

Best Regards

More information about the Alsa-devel mailing list