[alsa-devel] Aureal issues on resume

Takashi Iwai tiwai at suse.de
Thu Oct 27 18:24:24 CEST 2011


At Thu, 20 Oct 2011 17:42:40 +0800,
Raymond Yau wrote:
> 
> 2011/9/20 Takashi Iwai <tiwai at suse.de>:
> > At Sat, 17 Sep 2011 10:16:19 +0800,
> > Raymond Yau wrote:
> >>
> >> 2011/9/16 Takashi Iwai <tiwai at suse.de>:
> >> > At Fri, 16 Sep 2011 10:16:11 +0800,
> >> > Raymond Yau wrote:
> >> >>
> >> >> 2011/9/12 Takashi Iwai <tiwai at suse.de>:
> >> >> > At Mon, 12 Sep 2011 09:53:28 +0200,
> >> >> > Takashi Iwai wrote:
> >> >> >>
> >> >> >> At Sun, 04 Sep 2011 22:32:44 +0200,
> >> >> >> Clemens Ladisch wrote:
> >> >> >> >
> >> >> >> > Raymond Yau wrote:
> >> >> >> > > The possible way is to save the contents of 128K memory mapped I/O
> >> >> >> > > ports before suspend to non-volatile memory and restore them after
> >> >> >> > > resume
> >> >> >> > >
> >> >> >> > > Is there any way for alsa driver to allocate non-volatile memory ?
> >> >> >> >
> >> >> >> > 'Normal' memory is saved over suspend.  Just use {k|v}malloc.
> >> >> >>
> >> >> >> If it's a 128kB bulk memory, vmalloc() is a more sensible choice.
> >> >> >
> >> >> > BTW, in many cases, you don't have to save/restore the whole mmio
> >> >> > region.  Instead, stop the stream, save / restore some important
> >> >> > registers and do the similar procedure for the normal prepare callback
> >> >> > in the resume, and restart the stream again.
> >> >> >
> >> >> >
> >> >> > Takashi
> >> >> >
> >> >>
> >> >> The current au8830 alsa driver seem use less than 192Kbytes out of
> >> >> 256Kbytes mmio
> >> >>
> >> >> http://thread.gmane.org/gmane.linux.kernel/564963/focus=47907
> >> >>
> >> >> your patch seem initialse the request queue in figure 16 of pat 6167465
> >> >>
> >> >> and the driver need to restore mixer and equalizer mmio for au8830 in figure 13
> >> >
> >> > Yeah, that's what I mentioned in the thread.
> >> >
> >> > Basically you'll need to restore the values assigned in hw_params()
> >> > for PCM.
> >> >
> >>
> >> The error messages are due to snd_vortex_suspend() call snd_vortex_adb_init()
> >>
> >> There are static routes for the codec, mixin, mixout and equalizer and
> >> dynamic routes of playback/capture streams
> >>
> >> Those VORTEX_ADB_RTBASE and VORTEX_ADB_CHNBASE mmio ports are two
> >> linked list, those vortex_route_* function are adding the routes to
> >> the tail of those linked lists
> >>
> >> so the only is to restore the routes since the driver does not keep
> >> track of the order of routes of the playback stream  or capture stream
> >> to the linked list
> >>
> >> > The mixer is ac97, so it's restored by ac97_codec.c.  The rest are the
> >> > equalizer and a3d values to be restored separately.
> >>
> >> I mean the hardware mixer (mixin and mixout) inside au88x0 chip.
> >>
> >> May be need to initialise mpu401_uart or joystick
> >>
> >>
> >> Is there any way to force the system to suspend, it seem that gnome
> >> power management in Fedora 10 does not provide any way to suspend
> >> while playing an audio ? ( screen saver set to 1 minutes, put the
> >> computer into sleep when inactive for 2 minutes )
> >
> > See files in Documentation/power directory.
> > You may call s2ram, powersave, or whatever command directly, too.
> >
> >
> > Takashi
> >
> 
> 
> 1)Make sure that your computer can suspend and resume normally without
> au88x0 sound card
> 2)Backup all your important data before you try the patch with your
> au88x0 sound card
> 3)Only tested with au8830 , so it may need some modification for
> au8820 and au8810
> 
> my au8830 ,with two streams playing at different sampling rate at the
> same time, can suspend with the following script and resume as
> expected by pressing power button with the attached patch
> 
> sync
> echo 1 > /sys/power/pm_trace
> echo mem > /sys/power/state
> 
> 
> It is strange that it can resume without uncomment those SNDRV_PCM_INFO_RESUME
> in au88x0_pcm.c
> 
> static struct snd_pcm_hardware snd_vortex_playback_hw_adb = {
> 	.info =
> 	    (SNDRV_PCM_INFO_MMAP | /* SNDRV_PCM_INFO_RESUME | */
> 	     SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_INTERLEAVED |

This is normal.
SNDRV_PCM_INFO_RESUME means that the driver supports the full resume,
that is, the driver recovers the everything including the stream-restart
in the resume.  Most of drivers don't have it, and let the user-space
re-trigger the stream upon resume.

So, I believe the situation will be improved with your patch, at
least.  Could you brush it up to be merged to the upstream with the
usual things (a proper commit log and your sign-off)?


thanks,

Takashi


More information about the Alsa-devel mailing list