[alsa-devel] Shutdown() vector in ALSA
James Courtier-Dutton
James at superbug.co.uk
Tue Jun 12 11:15:56 CEST 2007
Takashi Iwai wrote:
> At Tue, 12 Jun 2007 14:26:08 +0530,
> Nobin Mathew wrote:
>> why no ALSA driver has shutdown() vector implemented?
>
> Because no hardware required it, so far.
> The shutdown callback is called only when the device is powered off
> while the driver is still active.
>
>> Is this vector needed to ensure the proper shutdown of the system?
>>
>> What all needs to be taken care if i want to implement shutdown(),
>> except hardware shutdown.
>>
>>
>> struct snd_shutdown_f_ops {
>> struct file_operations f_ops;
>> struct snd_shutdown_f_ops *next;
>> };
>>
>> what this operations means? defined in sound/core/init.c
>
> This has nothing to do with the driver's shutdown callback.
>
>
>> Is there any need to call these functions?
>> snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
>> for (i = 0; i < chip->pcm_devs; i++)
>> snd_pcm_suspend_all(chip->pcm[i]);
>
> At shutdown, the user processes will be terminated sooner or later.
> Thus no freezing is necessary at all.
>
> What I may be concerned would be a case like the hardware can be
> damaged by an accidental turn-off, or, some termination is required
> to make the device in a cold state (e.g. otherwise the firwmare won't
> be loaded at the next time).
> In other cases, usually the init script does necessary things at
> shutdown.
>
>
> Takashi
It might be nice to implement it, purely to help prevent the click or
thump on the speakers at shutdown.
I know the creative sound cards have a register that one should touch to
prevent such a click or thump on poweroff, although I have never
actually implemented support for it yet.
James
More information about the Alsa-devel
mailing list