* pm, hello ??
@ 2006-01-30 21:55 Giuliano Pochini
2006-01-31 14:06 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Giuliano Pochini @ 2006-01-30 21:55 UTC (permalink / raw)
To: Alsa-devel
I'm trying to add suspend/resume capability to the echoaudio driver. I wrote
susp/res functions, I attached them to struct pci_driver, I added
SNDRV_PCM_INFO_RESUME in struct snd_pcm_hardware.info, I added the two
cases in the trigger callback and the kernel has CONFIG_PM enabled. None of
the new code is called when I write in
/sys/devices/pci0001:10/0001:10:15.0/power/state . What am I missing ?
--
Giuliano.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: pm, hello ??
2006-01-30 21:55 pm, hello ?? Giuliano Pochini
@ 2006-01-31 14:06 ` Takashi Iwai
2006-02-09 22:12 ` Giuliano Pochini
0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2006-01-31 14:06 UTC (permalink / raw)
To: Giuliano Pochini; +Cc: Alsa-devel
At Mon, 30 Jan 2006 22:55:11 +0100,
Giuliano Pochini wrote:
>
>
> I'm trying to add suspend/resume capability to the echoaudio driver. I wrote
> susp/res functions, I attached them to struct pci_driver, I added
> SNDRV_PCM_INFO_RESUME in struct snd_pcm_hardware.info, I added the two
> cases in the trigger callback and the kernel has CONFIG_PM enabled. None of
> the new code is called when I write in
> /sys/devices/pci0001:10/0001:10:15.0/power/state . What am I missing ?
No idea. I bet something wrong in your kernel configuration or a
simple mistake like wrongly installed kernel image, etc.
BTW, SNDRV_PCM_INFO_RESUME should be added only if your driver really
supports the "full resume" mode. i.e. the stream restarts at the very
same position where suspended. Otherwise, dont' set that flag. Still
the driver works as "partial resume". Then the prepare is called
after resume to reset to a sane state.
Takashi
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: pm, hello ??
2006-01-31 14:06 ` Takashi Iwai
@ 2006-02-09 22:12 ` Giuliano Pochini
2006-02-09 22:56 ` Lee Revell
0 siblings, 1 reply; 4+ messages in thread
From: Giuliano Pochini @ 2006-02-09 22:12 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
On Tue, 31 Jan 2006 15:06:35 +0100
Takashi Iwai <tiwai@suse.de> wrote:
> At Mon, 30 Jan 2006 22:55:11 +0100,
> Giuliano Pochini wrote:
> >
> > I'm trying to add suspend/resume capability to the echoaudio driver. I wrote
> > susp/res functions, I attached them to struct pci_driver, I added
> > SNDRV_PCM_INFO_RESUME in struct snd_pcm_hardware.info, I added the two
> > cases in the trigger callback and the kernel has CONFIG_PM enabled. None of
> > the new code is called when I write in
> > /sys/devices/pci0001:10/0001:10:15.0/power/state . What am I missing ?
>
> No idea. I bet something wrong in your kernel configuration or a
> simple mistake like wrongly installed kernel image, etc.
Finally I found some time to debug it.
It happens that "echo 3 > file" actually writes "3\n" into the file.
lib/vsprintf.c:simple_strtoul() returns the first non-digit character in the
second argument. Then driver/base/power/sysfs.c:state_store() does:
if (*rest)
return -EINVAL;
*rest is always '\n', so it exits here.
> BTW, SNDRV_PCM_INFO_RESUME should be added only if your driver really
> supports the "full resume" mode. i.e. the stream restarts at the very
> same position where suspended. Otherwise, dont' set that flag. Still
> the driver works as "partial resume". Then the prepare is called
> after resume to reset to a sane state.
Nice to know. I can't resume the card exactly as it was before, indeed,
because the internal state of the DSP is unknown to the driver. I can only
restore all gains, monitors, etc., and restart transport from the last
period(s).
--
Giuliano.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: pm, hello ??
2006-02-09 22:12 ` Giuliano Pochini
@ 2006-02-09 22:56 ` Lee Revell
0 siblings, 0 replies; 4+ messages in thread
From: Lee Revell @ 2006-02-09 22:56 UTC (permalink / raw)
To: Giuliano Pochini; +Cc: Takashi Iwai, alsa-devel
On Thu, 2006-02-09 at 23:12 +0100, Giuliano Pochini wrote:
> Finally I found some time to debug it.
>
> It happens that "echo 3 > file" actually writes "3\n" into the file.
> lib/vsprintf.c:simple_strtoul() returns the first non-digit character
> in the
> second argument. Then driver/base/power/sysfs.c:state_store() does:
> if (*rest)
> return -EINVAL;
> *rest is always '\n', so it exits here.
There was a discussion not long ago on LKML about whether sysfs should
strip the trailing newline. The consensus was that this is bloat, and
echo -n should be used. I'm not sure I agree...
Lee
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-02-09 22:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-30 21:55 pm, hello ?? Giuliano Pochini
2006-01-31 14:06 ` Takashi Iwai
2006-02-09 22:12 ` Giuliano Pochini
2006-02-09 22:56 ` Lee Revell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox