[alsa-devel] Aureal issues on resume

Raymond Yau superquad.vortex2 at gmail.com
Thu Oct 20 11:42:40 CEST 2011


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 |



ALSA au88x0.c:131: vortex suspending...
snd_au8830 0000:04:02.0: PCI INT A disabled
vortex suspended
...

ALSA au88x0.c:248: vortex resuming...
snd_au8830 0000:04:02.0: restoring config space at offset 0x1 (was
0x2900007, writing 0x2900003)
snd_au8830 0000:04:02.0: PCI INT A -> GSI 23 (level, low) -> IRQ 23
ALSA au88x0.c:350: vortex resumed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: au88x0_suspend_resume.patch
Type: application/octet-stream
Size: 11161 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20111020/2288b361/attachment.dll 


More information about the Alsa-devel mailing list