Skip to contentSkip to conversation

Aureal issues on resume

DISCUSSION Clemens Ladisch 3 participants 11 messages Sep 2, 2011 – Oct 27, 2011 Sound

lore
Share & tools
lore
#0 lore raw

(added recipients)

-------- Original Message --------
Subject: Aureal issues on resume
Date: Fri, 02 Sep 2011 13:41:42 +0200
From: Anders Eriksson <[email protected]>
To: [email protected], [email protected]

Hi, upon resuming from hibernation, I see this in my log:

Sep  2 11:15:20 tippex kernel: [72436.287020] vortex_adb_addroutes: unending route! 0x10
Sep  2 11:15:20 tippex kernel: [72436.287127] vortex_adb_addroutes: unending route! 0x838
Sep  2 11:15:20 tippex kernel: [72436.287277] vortex_adb_addroutes: unending route! 0x11
Sep  2 11:15:20 tippex kernel: [72436.287418] vortex_adb_addroutes: unending route! 0x8b9
Sep  2 11:15:20 tippex kernel: [72436.292037] Vortex: vortex_fifo_setadbctrl fail
Sep  2 11:15:55 tippex kernel: [72471.403490] vortex_adb_delroutes: route not found! 0x10
Sep  2 11:15:55 tippex kernel: [72471.403596] vortex_adb_delroutes: route not found! 0x838
Sep  2 11:15:55 tippex kernel: [72471.403710] vortex_adb_delroutes: route not found! 0x11
Sep  2 11:15:55 tippex kernel: [72471.403811] vortex_adb_delroutes: route not found! 0x8b9

And the sound is no more. I need to reboot to get it back.

If memory serves, it's been there since 2.6.30 or so. Any ideas what can be triggering it?

lspci says it's an
00:04.0 Multimedia audio controller: Aureal Semiconductor Vortex 1 (rev 02)
Subsystem: Diamond Multimedia Systems Sonic Impact A3D
Flags: bus master, medium devsel, latency 64, IRQ 11 Memory at 50000000 (32-bit, non-prefetchable) [size=128K] I/O ports at 10b0 [size=8]
I/O ports at 10b8 [size=8]
Capabilities: [dc] Power Management version 1
Kernel driver in use: snd_au8820
Kernel modules: snd-au8820

-Anders

#1 lore raw

2011/9/2 Clemens Ladisch <[email protected]>:

Quoted 38 lines

(added recipients)

-------- Original Message --------
Subject: Aureal issues on resume
Date: Fri, 02 Sep 2011 13:41:42 +0200
From: Anders Eriksson <[email protected]>
To: [email protected], [email protected]

Hi, upon resuming from hibernation, I see this in my log:

Sep  2 11:15:20 tippex kernel: [72436.287020] vortex_adb_addroutes: unending route! 0x10 Sep  2 11:15:20 tippex kernel: [72436.287127] vortex_adb_addroutes: unending route! 0x838 Sep  2 11:15:20 tippex kernel: [72436.287277] vortex_adb_addroutes: unending route! 0x11 Sep  2 11:15:20 tippex kernel: [72436.287418] vortex_adb_addroutes: unending route! 0x8b9 Sep  2 11:15:20 tippex kernel: [72436.292037] Vortex: vortex_fifo_setadbctrl fail Sep  2 11:15:55 tippex kernel: [72471.403490] vortex_adb_delroutes: route not found! 0x10 Sep  2 11:15:55 tippex kernel: [72471.403596] vortex_adb_delroutes: route not found! 0x838 Sep  2 11:15:55 tippex kernel: [72471.403710] vortex_adb_delroutes: route not found! 0x11 Sep  2 11:15:55 tippex kernel: [72471.403811] vortex_adb_delroutes: route not found! 0x8b9

And the sound is no more. I need to reboot to get it back.

If memory serves, it's been there since 2.6.30 or so. Any ideas what can be triggering it?

lspci says it's an
00:04.0 Multimedia audio controller: Aureal Semiconductor Vortex 1 (rev 02)
       Subsystem: Diamond Multimedia Systems Sonic Impact A3D
       Flags: bus master, medium devsel, latency 64, IRQ 11 Memory at 50000000 (32-bit, non-prefetchable) [size=128K] I/O ports at 10b0 [size=8]
       I/O ports at 10b8 [size=8]
       Capabilities: [dc] Power Management version 1
       Kernel driver in use: snd_au8820
       Kernel modules: snd-au8820

Quoted 2 lines

-Anders

Those alsa au88x0 drivers does not support suspend/resume

As each audio stream is assigned different resources (e.g. SRC, mixer , ...) dynamically and the cards can play 16 mono streams or 8 stereo streams.

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 ? au8830 has 256 K mmio

#2 lore raw
Quoted 5 lines · Raymond Yau

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.

Regards,
Clemens

#3 lore raw

At Sun, 04 Sep 2011 22:32:44 +0200,

Quoted 9 lines · Clemens Ladisch
Quoted 5 lines · Raymond Yau

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.

Takashi

#4 lore raw

At Mon, 12 Sep 2011 09:53:28 +0200,

Quoted 9 lines · Takashi Iwai

At Sun, 04 Sep 2011 22:32:44 +0200,

Quoted 6 lines · Clemens Ladisch
Quoted 4 lines · Raymond Yau

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

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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

#5 lore raw

2011/9/12 Takashi Iwai <[email protected]>:

Quoted 17 lines

At Mon, 12 Sep 2011 09:53:28 +0200,

Quoted 9 lines · Takashi Iwai

At Sun, 04 Sep 2011 22:32:44 +0200,

Quoted 6 lines · Clemens Ladisch
Quoted 4 lines · Raymond Yau

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

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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.

Quoted 8 lines

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

04:02.0 Multimedia audio controller: Aureal Semiconductor Vortex 2 (rev fe)
Subsystem: Aureal Semiconductor AU8830 Vortex 3D Digital Audio Processor
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 64 (1000ns min, 3000ns max), Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 23
Region 0: Memory at ff7c0000 (32-bit, non-prefetchable) [size=256K] Region 1: I/O ports at bc00 [size=8]
Region 2: I/O ports at b880 [size=8]
Capabilities: [dc] Power Management version 1
Flags: PMEClk- DSI+ D1- D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Kernel driver in use: au8830
Kernel modules: snd-au8830

#6 lore raw

At Fri, 16 Sep 2011 10:16:11 +0800,

Quoted 28 lines · Raymond Yau

2011/9/12 Takashi Iwai <[email protected]>:

Quoted 17 lines

At Mon, 12 Sep 2011 09:53:28 +0200,

Quoted 9 lines · Takashi Iwai

At Sun, 04 Sep 2011 22:32:44 +0200,

Quoted 6 lines · Clemens Ladisch
Quoted 4 lines · Raymond Yau

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

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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.

Quoted 8 lines

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

Quoted 8 lines

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 mixer is ac97, so it's restored by ac97_codec.c. The rest are the equalizer and a3d values to be restored separately.

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#7 lore raw

2011/9/16 Takashi Iwai <[email protected]>:

Quoted 35 lines

At Fri, 16 Sep 2011 10:16:11 +0800,

Quoted 33 lines · Raymond Yau

2011/9/12 Takashi Iwai <[email protected]>:

Quoted 17 lines

At Mon, 12 Sep 2011 09:53:28 +0200,

Quoted 9 lines · Takashi Iwai

At Sun, 04 Sep 2011 22:32:44 +0200,

Quoted 6 lines · Clemens Ladisch
Quoted 4 lines · Raymond Yau

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

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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.

Quoted 8 lines

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

Quoted 9 lines
Quoted 3 lines

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

Quoted 2 lines

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 )

Ubuntu 10.04 Live CD , you can force the system to suspend

#8 lore raw

At Sat, 17 Sep 2011 10:16:19 +0800,

Quoted 65 lines · Raymond Yau

2011/9/16 Takashi Iwai <[email protected]>:

Quoted 35 lines

At Fri, 16 Sep 2011 10:16:11 +0800,

Quoted 33 lines · Raymond Yau

2011/9/12 Takashi Iwai <[email protected]>:

Quoted 17 lines

At Mon, 12 Sep 2011 09:53:28 +0200,

Quoted 9 lines · Takashi Iwai

At Sun, 04 Sep 2011 22:32:44 +0200,

Quoted 6 lines · Clemens Ladisch
Quoted 4 lines · Raymond Yau

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

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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.

Quoted 8 lines

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

Quoted 9 lines
Quoted 3 lines

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

Quoted 2 lines

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.

Quoted 7 lines

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
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#9 lore raw

2011/9/20 Takashi Iwai <[email protected]>:

Quoted 75 lines

At Sat, 17 Sep 2011 10:16:19 +0800,

Quoted 65 lines · Raymond Yau

2011/9/16 Takashi Iwai <[email protected]>:

Quoted 35 lines

At Fri, 16 Sep 2011 10:16:11 +0800,

Quoted 33 lines · Raymond Yau

2011/9/12 Takashi Iwai <[email protected]>:

Quoted 17 lines

At Mon, 12 Sep 2011 09:53:28 +0200,

Quoted 9 lines · Takashi Iwai

At Sun, 04 Sep 2011 22:32:44 +0200,

Quoted 6 lines · Clemens Ladisch
Quoted 4 lines · Raymond Yau

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

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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.

Quoted 8 lines

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

Quoted 9 lines
Quoted 3 lines

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

Quoted 2 lines

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.

Quoted 7 lines

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 )

Quoted 6 lines

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

sound/pci/au88x0/au8810.h +1 -0
index 79fbee3..98721bc 100644
@@ -188,6 +188,7 @@
 
 /* Sample timer */
 #define VORTEX_SMP_TIME		0x29198
+#define VORTEX_SMP_TIMER	0x2919c
 
 #define VORTEX_MODEM_CTRL	0x291ac
 
sound/pci/au88x0/au8820.h +3 -0
index cafdb96..471b074 100644
@@ -14,6 +14,8 @@
 #define CARD_NAME "Aureal Vortex"
 #define CARD_NAME_SHORT "au8820"
 
+#define NR_WT_BANK 1
+
 /* Number of ADB and WT channels */
 #define NR_ADB		0x10
 #define NR_WT		0x20
@@ -171,6 +173,7 @@
 
 /* Sample timer */
 #define VORTEX_SMP_TIME 0x11998
+#define VORTEX_SMP_TIMER 0x1199c
 
 /* IRQ */
 #define VORTEX_IRQ_SOURCE 0x12800	/* Interrupt source flags. */
sound/pci/au88x0/au8830.h +4 -0
index 999b29a..3ca2e6f 100644
@@ -14,6 +14,8 @@
 #define CARD_NAME "Aureal Vortex 2"
 #define CARD_NAME_SHORT "au8830"
 
+#define NR_WT_BANK 2
+
 #define NR_ADB 0x20
 #define NR_SRC 0x10
 #define NR_A3D 0x10
@@ -52,6 +54,8 @@
 #define VORTEX_ENGINE_CTRL 0x27ae8
 #define 	ENGINE_INIT 0x1380000
 
+#define VORTEX_DMA_ADBREQQUE 0x27afc
+
 /* WTDMA */
 #define VORTEX_WTDMA_CTRL 0x27900	/* format, DMA pos */
 #define VORTEX_WTDMA_STAT 0x27d00	/* DMA subbuf, DMA pos */
sound/pci/au88x0/au88x0.c +240 -2

266 lines not on this page · raw message

sound/pci/au88x0/au88x0.h +19 -0
index 02f6e08..e983e68 100644
@@ -184,6 +184,25 @@ struct snd_vortex {
 	u16 vendor;
 	u16 device;
 	u8 rev;
+#if CONFIG_PM
+	struct {
+		u32	adb_sr;
+		u32	ctrl;
+		u32     ctrl2;
+		u32     engine_ctrl;
+		u32	irq_ctrl;
+		u32	irq_source;
+		u32	mixer_sr;
+		u32     smp_time;
+		u32	srcblock_sr;
+#ifdef CHIP_AU8820
+		u32	mmio[0x8000];
+#else
+		u32	mmio[0x10000];
+#endif
+	} apm; 
+#endif
+
 };
 
 /* Functions. */
sound/pci/au88x0/au88x0_core.c +6 -8
index 4891503..6e52593 100644
@@ -2370,20 +2370,18 @@ static void vortex_settimer(vortex_t * vortex, int period)
 	hwwrite(vortex->mmio, VORTEX_IRQ_STAT, period);
 }
 
-#if 0
-static void vortex_enable_timer_int(vortex_t * card)
+static void vortex_enable_timer_int(vortex_t * vortex)
 {
-	hwwrite(card->mmio, VORTEX_IRQ_CTRL,
-		hwread(card->mmio, VORTEX_IRQ_CTRL) | IRQ_TIMER | 0x60);
+	hwwrite(vortex->mmio, VORTEX_IRQ_CTRL,
+		hwread(vortex->mmio, VORTEX_IRQ_CTRL) | IRQ_TIMER | 0x60);
 }
 
-static void vortex_disable_timer_int(vortex_t * card)
+static void vortex_disable_timer_int(vortex_t * vortex)
 {
-	hwwrite(card->mmio, VORTEX_IRQ_CTRL,
-		hwread(card->mmio, VORTEX_IRQ_CTRL) & ~IRQ_TIMER);
+	hwwrite(vortex->mmio, VORTEX_IRQ_CTRL,
+		hwread(vortex->mmio, VORTEX_IRQ_CTRL) & ~IRQ_TIMER);
 }
 
-#endif
 static void vortex_enable_int(vortex_t * card)
 {
 	// CAsp4ISR__EnableVortexInt_void_
#10 lore raw

At Thu, 20 Oct 2011 17:42:40 +0800,

Quoted 101 lines · Raymond Yau

2011/9/20 Takashi Iwai <[email protected]>:

Quoted 75 lines

At Sat, 17 Sep 2011 10:16:19 +0800,

Quoted 65 lines · Raymond Yau

2011/9/16 Takashi Iwai <[email protected]>:

Quoted 35 lines

At Fri, 16 Sep 2011 10:16:11 +0800,

Quoted 33 lines · Raymond Yau

2011/9/12 Takashi Iwai <[email protected]>:

Quoted 17 lines

At Mon, 12 Sep 2011 09:53:28 +0200,

Quoted 9 lines · Takashi Iwai

At Sun, 04 Sep 2011 22:32:44 +0200,

Quoted 6 lines · Clemens Ladisch
Quoted 4 lines · Raymond Yau

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

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

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.

Quoted 8 lines

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

Quoted 9 lines
Quoted 3 lines

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

Quoted 2 lines

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.

Quoted 7 lines

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 )

Quoted 6 lines

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

Quoted 7 lines

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
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel