[alsa-devel] [PATCH, beta] Echoaudio, add suspend/resume support
pochini at shiny.it
Thu Jan 7 23:44:37 CET 2010
The following patched add suspend/resume support to all echoaudio drivers.
They seem to work fine, but more testing is needed. Some testing have been
performed on an IndigoIOx and a Layla3G (thanks to Mark Hills). The most
important part which has not been tested is rawmidi.
Is someone willing to try ? The following patches are against
alsa-driver-188.8.131.52, but should be possible to apply them cleanly on other
versions as well because no changes have been done recently.
1/4 Add firmware cache #1:
When CONFIG_PM is enabled the firmware cannot be released because
the driver may need it again to resume the card.
With this patch the firmware is passed as an index of the struct
firmware card_fw in place of a pointer. That same index is then
uses to locate the firmware in the firmware cache.
2/4 Add firmware cache #2:
This patch changes get_firmware(), free_firmware() and adds
free_firmware_cache(). The first two functions implement a very
simple cache and the latter is used to actually release all the
stored firmwares when the module is unloaded.
When CONFIG_PM is not enabled those functions act as before and
free_firmware_cache() is a nop.
3/4 Add suspend support:
This patch adds snd_echo_suspend() and snd_echo_resume() callbacks
and suspend/resume trigger event handlers.
It also makes hardware initialization and mixer setup two clearly
distinct stages, so they can be used also in the resume procedure
without messing the settings up. As a bonus all init_hw() functions
(one for each card) are a little shorter and cleaner.
4/4 patch the patch:
The patches are here, in the same order as above:
Or if you prefer a single patch (54KB):
Please test and report, especially the rawmidi part. TIA.
More information about the Alsa-devel