All of lore.kernel.org
 help / color / mirror / Atom feed
* Oops in snd_emu10k1_efx_playback_prepare
@ 2005-03-09  5:56 Lee Revell
  2005-03-09  9:57 ` Takashi Iwai
  0 siblings, 1 reply; 10+ messages in thread
From: Lee Revell @ 2005-03-09  5:56 UTC (permalink / raw)
  To: alsa-devel

I got an Oops again that seems to be caused by something in mu
multichannel patch.  But, I don't really know what to make of it.

ksymoops seems broken for 2.6 kernels, but it was able to disassemble
the offending code.

Any ideas?

Lee

Unable to handle kernel paging request at virtual address 03020108
e08dca22
*pde = 00000000
Oops: 0000 [#1]
CPU:    0
EIP:    0060:[<e08dca22>]    Not tainted VLI
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00210286   (2.6.11) 
eax: 03020100   ebx: 00002800   ecx: 00000001   edx: deca2a08
esi: 00002800   edi: deca2a08   ebp: c2f41e48   esp: c2f41e0c
ds: 007b   es: 007b   ss: 0068
Stack: deca2000 0808001a 0000003f 00000000 00200216 00000001 00000000
df61a400 
       000000ff 00000000 0e0d000a 00000000 00002800 00002800 0000000c
c2f41e80 
       e08dd3e7 deca2000 00000000 00000000 deca2a08 00002600 00002800
00000200 
Call Trace:
 [<c0102c8f>] show_stack+0x7f/0xa0
 [<c0102e2a>] show_registers+0x15a/0x1c0
 [<c0103020>] die+0xf0/0x190
 [<c010df8b>] do_page_fault+0x31b/0x670
 [<c01028fb>] error_code+0x2b/0x30
 [<e08dd3e7>] snd_emu10k1_efx_playback_prepare+0xd7/0xf0 [snd_emu10k1]
 [<e08987f5>] snd_pcm_do_prepare+0x15/0x40 [snd_pcm]
 [<e0897d65>] snd_pcm_action_group+0x95/0x1b0 [snd_pcm]
 [<e08980c7>] snd_pcm_action_nonatomic+0x47/0x80 [snd_pcm]
 [<e0898871>] snd_pcm_prepare+0x21/0x30 [snd_pcm]
 [<e089af1b>] snd_pcm_playback_ioctl1+0x4b/0x330 [snd_pcm]
 [<e089bef7>] snd_pcm_playback_ioctl_old+0x27/0x40 [snd_pcm]
 [<c0160823>] do_ioctl+0x63/0x90
 [<c0160a42>] vfs_ioctl+0x62/0x1c0
 [<c0160c01>] sys_ioctl+0x61/0xa0
 [<c0102753>] syscall_call+0x7/0xb
Code: 00 00 00 fe 05 00 00 00 06 c9 c3 8d b4 26 00 00 00 00 8d bc 27 00
00 00 00 55 89 e5 57 56 53 83 ec 30 8b 7d 14 8b 55 14 8b 42 10 <8b> 50
08 8b 4a 60 89 4d e0 83 78 04 01 8b 77 04 0f 84 ba 05 00 


>>EIP; e08dca22 No symbols available   <=====

Trace; c0102c8f No symbols available
Trace; c0102e2a No symbols available
Trace; c0103020 No symbols available
Trace; c010df8b No symbols available
Trace; c01028fb No symbols available
Trace; e08dd3e7 No symbols available
Trace; e08987f5 No symbols available
Trace; e0897d65 No symbols available
Trace; e08980c7 No symbols available
Trace; e0898871 No symbols available
Trace; e089af1b No symbols available
Trace; e089bef7 No symbols available
Trace; c0160823 No symbols available
Trace; c0160a42 No symbols available
Trace; c0160c01 No symbols available
Trace; c0102753 No symbols available

This architecture has variable length instructions, decoding before eip
is unreliable, take these instructions with a pinch of salt.

Code;  e08dc9f7 No symbols available
00000000 <_EIP>:
Code;  e08dc9f7 No symbols available
   0:   00 00                     add    %al,(%eax)
Code;  e08dc9f9 No symbols available
   2:   00 fe                     add    %bh,%dh
Code;  e08dc9fb No symbols available
   4:   05 00 00 00 06            add    $0x6000000,%eax
Code;  e08dca00 No symbols available
   9:   c9                        leave  
Code;  e08dca01 No symbols available
   a:   c3                        ret    
Code;  e08dca02 No symbols available
   b:   8d b4 26 00 00 00 00      lea    0x0(%esi),%esi
Code;  e08dca09 No symbols available
  12:   8d bc 27 00 00 00 00      lea    0x0(%edi),%edi
Code;  e08dca10 No symbols available
  19:   55                        push   %ebp
Code;  e08dca11 No symbols available
  1a:   89 e5                     mov    %esp,%ebp
Code;  e08dca13 No symbols available
  1c:   57                        push   %edi
Code;  e08dca14 No symbols available
  1d:   56                        push   %esi
Code;  e08dca15 No symbols available
  1e:   53                        push   %ebx
Code;  e08dca16 No symbols available
  1f:   83 ec 30                  sub    $0x30,%esp
Code;  e08dca19 No symbols available
  22:   8b 7d 14                  mov    0x14(%ebp),%edi
Code;  e08dca1c No symbols available
  25:   8b 55 14                  mov    0x14(%ebp),%edx
Code;  e08dca1f No symbols available
  28:   8b 42 10                  mov    0x10(%edx),%eax

This decode from eip onwards should be reliable

Code;  e08dca22 No symbols available
00000000 <_EIP>:
Code;  e08dca22 No symbols available   <=====
   0:   8b 50 08                  mov    0x8(%eax),%edx   <=====
Code;  e08dca25 No symbols available
   3:   8b 4a 60                  mov    0x60(%edx),%ecx
Code;  e08dca28 No symbols available
   6:   89 4d e0                  mov    %ecx,0xffffffe0(%ebp)
Code;  e08dca2b No symbols available
   9:   83 78 04 01               cmpl   $0x1,0x4(%eax)
Code;  e08dca2f No symbols available
   d:   8b 77 04                  mov    0x4(%edi),%esi
Code;  e08dca32 No symbols available
  10:   0f                        .byte 0xf
Code;  e08dca33 No symbols available
  11:   84                        .byte 0x84
Code;  e08dca34 No symbols available
  12:   ba                        .byte 0xba
Code;  e08dca35 No symbols available
  13:   05                        .byte 0x5


2 warnings and 2 errors issued.  Results may not be reliable.





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Oops in snd_emu10k1_efx_playback_prepare
  2005-03-09  5:56 Oops in snd_emu10k1_efx_playback_prepare Lee Revell
@ 2005-03-09  9:57 ` Takashi Iwai
  2005-03-09 10:54   ` Takashi Iwai
  0 siblings, 1 reply; 10+ messages in thread
From: Takashi Iwai @ 2005-03-09  9:57 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

At Wed, 09 Mar 2005 00:56:19 -0500,
Lee Revell wrote:
> 
> I got an Oops again that seems to be caused by something in mu
> multichannel patch.  But, I don't really know what to make of it.
> 
> ksymoops seems broken for 2.6 kernels, but it was able to disassemble
> the offending code.
> 
> Any ideas?

In snd_emu10k1_pcm_channel_alloc(), epcm->voices[2..NUM_EFX_PLAYBACK]
are not freed correctly.  Possibly did this hit?


Takashi

> 
> Lee
> 
> Unable to handle kernel paging request at virtual address 03020108
> e08dca22
> *pde = 00000000
> Oops: 0000 [#1]
> CPU:    0
> EIP:    0060:[<e08dca22>]    Not tainted VLI
> Using defaults from ksymoops -t elf32-i386 -a i386
> EFLAGS: 00210286   (2.6.11) 
> eax: 03020100   ebx: 00002800   ecx: 00000001   edx: deca2a08
> esi: 00002800   edi: deca2a08   ebp: c2f41e48   esp: c2f41e0c
> ds: 007b   es: 007b   ss: 0068
> Stack: deca2000 0808001a 0000003f 00000000 00200216 00000001 00000000
> df61a400 
>        000000ff 00000000 0e0d000a 00000000 00002800 00002800 0000000c
> c2f41e80 
>        e08dd3e7 deca2000 00000000 00000000 deca2a08 00002600 00002800
> 00000200 
> Call Trace:
>  [<c0102c8f>] show_stack+0x7f/0xa0
>  [<c0102e2a>] show_registers+0x15a/0x1c0
>  [<c0103020>] die+0xf0/0x190
>  [<c010df8b>] do_page_fault+0x31b/0x670
>  [<c01028fb>] error_code+0x2b/0x30
>  [<e08dd3e7>] snd_emu10k1_efx_playback_prepare+0xd7/0xf0 [snd_emu10k1]
>  [<e08987f5>] snd_pcm_do_prepare+0x15/0x40 [snd_pcm]
>  [<e0897d65>] snd_pcm_action_group+0x95/0x1b0 [snd_pcm]
>  [<e08980c7>] snd_pcm_action_nonatomic+0x47/0x80 [snd_pcm]
>  [<e0898871>] snd_pcm_prepare+0x21/0x30 [snd_pcm]
>  [<e089af1b>] snd_pcm_playback_ioctl1+0x4b/0x330 [snd_pcm]
>  [<e089bef7>] snd_pcm_playback_ioctl_old+0x27/0x40 [snd_pcm]
>  [<c0160823>] do_ioctl+0x63/0x90
>  [<c0160a42>] vfs_ioctl+0x62/0x1c0
>  [<c0160c01>] sys_ioctl+0x61/0xa0
>  [<c0102753>] syscall_call+0x7/0xb
> Code: 00 00 00 fe 05 00 00 00 06 c9 c3 8d b4 26 00 00 00 00 8d bc 27 00
> 00 00 00 55 89 e5 57 56 53 83 ec 30 8b 7d 14 8b 55 14 8b 42 10 <8b> 50
> 08 8b 4a 60 89 4d e0 83 78 04 01 8b 77 04 0f 84 ba 05 00 
> 
> 
> >>EIP; e08dca22 No symbols available   <=====
> 
> Trace; c0102c8f No symbols available
> Trace; c0102e2a No symbols available
> Trace; c0103020 No symbols available
> Trace; c010df8b No symbols available
> Trace; c01028fb No symbols available
> Trace; e08dd3e7 No symbols available
> Trace; e08987f5 No symbols available
> Trace; e0897d65 No symbols available
> Trace; e08980c7 No symbols available
> Trace; e0898871 No symbols available
> Trace; e089af1b No symbols available
> Trace; e089bef7 No symbols available
> Trace; c0160823 No symbols available
> Trace; c0160a42 No symbols available
> Trace; c0160c01 No symbols available
> Trace; c0102753 No symbols available
> 
> This architecture has variable length instructions, decoding before eip
> is unreliable, take these instructions with a pinch of salt.
> 
> Code;  e08dc9f7 No symbols available
> 00000000 <_EIP>:
> Code;  e08dc9f7 No symbols available
>    0:   00 00                     add    %al,(%eax)
> Code;  e08dc9f9 No symbols available
>    2:   00 fe                     add    %bh,%dh
> Code;  e08dc9fb No symbols available
>    4:   05 00 00 00 06            add    $0x6000000,%eax
> Code;  e08dca00 No symbols available
>    9:   c9                        leave  
> Code;  e08dca01 No symbols available
>    a:   c3                        ret    
> Code;  e08dca02 No symbols available
>    b:   8d b4 26 00 00 00 00      lea    0x0(%esi),%esi
> Code;  e08dca09 No symbols available
>   12:   8d bc 27 00 00 00 00      lea    0x0(%edi),%edi
> Code;  e08dca10 No symbols available
>   19:   55                        push   %ebp
> Code;  e08dca11 No symbols available
>   1a:   89 e5                     mov    %esp,%ebp
> Code;  e08dca13 No symbols available
>   1c:   57                        push   %edi
> Code;  e08dca14 No symbols available
>   1d:   56                        push   %esi
> Code;  e08dca15 No symbols available
>   1e:   53                        push   %ebx
> Code;  e08dca16 No symbols available
>   1f:   83 ec 30                  sub    $0x30,%esp
> Code;  e08dca19 No symbols available
>   22:   8b 7d 14                  mov    0x14(%ebp),%edi
> Code;  e08dca1c No symbols available
>   25:   8b 55 14                  mov    0x14(%ebp),%edx
> Code;  e08dca1f No symbols available
>   28:   8b 42 10                  mov    0x10(%edx),%eax
> 
> This decode from eip onwards should be reliable
> 
> Code;  e08dca22 No symbols available
> 00000000 <_EIP>:
> Code;  e08dca22 No symbols available   <=====
>    0:   8b 50 08                  mov    0x8(%eax),%edx   <=====
> Code;  e08dca25 No symbols available
>    3:   8b 4a 60                  mov    0x60(%edx),%ecx
> Code;  e08dca28 No symbols available
>    6:   89 4d e0                  mov    %ecx,0xffffffe0(%ebp)
> Code;  e08dca2b No symbols available
>    9:   83 78 04 01               cmpl   $0x1,0x4(%eax)
> Code;  e08dca2f No symbols available
>    d:   8b 77 04                  mov    0x4(%edi),%esi
> Code;  e08dca32 No symbols available
>   10:   0f                        .byte 0xf
> Code;  e08dca33 No symbols available
>   11:   84                        .byte 0x84
> Code;  e08dca34 No symbols available
>   12:   ba                        .byte 0xba
> Code;  e08dca35 No symbols available
>   13:   05                        .byte 0x5
> 
> 
> 2 warnings and 2 errors issued.  Results may not be reliable.
> 
> 
> 
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
> 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Oops in snd_emu10k1_efx_playback_prepare
  2005-03-09  9:57 ` Takashi Iwai
@ 2005-03-09 10:54   ` Takashi Iwai
  2005-03-09 17:21     ` Takashi Iwai
  0 siblings, 1 reply; 10+ messages in thread
From: Takashi Iwai @ 2005-03-09 10:54 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

At Wed, 09 Mar 2005 10:57:54 +0100,
I wrote:
> 
> At Wed, 09 Mar 2005 00:56:19 -0500,
> Lee Revell wrote:
> > 
> > I got an Oops again that seems to be caused by something in mu
> > multichannel patch.  But, I don't really know what to make of it.
> > 
> > ksymoops seems broken for 2.6 kernels, but it was able to disassemble
> > the offending code.
> > 
> > Any ideas?
> 
> In snd_emu10k1_pcm_channel_alloc(), epcm->voices[2..NUM_EFX_PLAYBACK]
> are not freed correctly.  Possibly did this hit?

Or maybe I misread the code.  Need more coffee now... :)

Anyway, snd_emu10k1_pcm_channel_alloc() should return immediately at
the second or later call when all voices have been already allocated.


Takashi


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Oops in snd_emu10k1_efx_playback_prepare
  2005-03-09 10:54   ` Takashi Iwai
@ 2005-03-09 17:21     ` Takashi Iwai
  2005-03-10 21:35       ` Lee Revell
  0 siblings, 1 reply; 10+ messages in thread
From: Takashi Iwai @ 2005-03-09 17:21 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 894 bytes --]

At Wed, 09 Mar 2005 11:54:30 +0100,
I wrote:
> 
> At Wed, 09 Mar 2005 10:57:54 +0100,
> I wrote:
> > 
> > At Wed, 09 Mar 2005 00:56:19 -0500,
> > Lee Revell wrote:
> > > 
> > > I got an Oops again that seems to be caused by something in mu
> > > multichannel patch.  But, I don't really know what to make of it.
> > > 
> > > ksymoops seems broken for 2.6 kernels, but it was able to disassemble
> > > the offending code.
> > > 
> > > Any ideas?
> > 
> > In snd_emu10k1_pcm_channel_alloc(), epcm->voices[2..NUM_EFX_PLAYBACK]
> > are not freed correctly.  Possibly did this hit?
> 
> Or maybe I misread the code.  Need more coffee now... :)
> 
> Anyway, snd_emu10k1_pcm_channel_alloc() should return immediately at
> the second or later call when all voices have been already allocated.

The quick fix patch is below.
But I'm not sure whether this is really related with the given bug.


Takashi

[-- Attachment #2: Type: text/plain, Size: 1147 bytes --]

Index: alsa-kernel/pci/emu10k1/emupcm.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/pci/emu10k1/emupcm.c,v
retrieving revision 1.45
diff -u -r1.45 emupcm.c
--- alsa-kernel/pci/emu10k1/emupcm.c	8 Mar 2005 16:07:16 -0000	1.45
+++ alsa-kernel/pci/emu10k1/emupcm.c	9 Mar 2005 17:18:09 -0000
@@ -109,14 +109,17 @@
 		snd_emu10k1_voice_free(epcm->emu, epcm->voices[1]);
 		epcm->voices[1] = NULL;
 	}
-	if (voices == 1 && epcm->voices[0] != NULL)
-		return 0;		/* already allocated */
-	if (voices == 2 && epcm->voices[0] != NULL && epcm->voices[1] != NULL)
-		return 0;
-	if (voices > 1) {
-		if (epcm->voices[0] != NULL && epcm->voices[1] == NULL) {
-			snd_emu10k1_voice_free(epcm->emu, epcm->voices[0]);
-			epcm->voices[0] = NULL;
+	for (i = 0; i < voices; i++) {
+		if (epcm->voices[i] == NULL)
+			break;
+	}
+	if (i == voices)
+		return 0; /* already allocated */
+
+	for (i = 0; i < ARRAY_SIZE(epcm->voices); i++) {
+		if (epcm->voices[i]) {
+			snd_emu10k1_voice_free(epcm->emu, epcm->voices[i]);
+			epcm->voices[i] = NULL;
 		}
 	}
 	err = snd_emu10k1_voice_alloc(epcm->emu,

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Oops in snd_emu10k1_efx_playback_prepare
  2005-03-09 17:21     ` Takashi Iwai
@ 2005-03-10 21:35       ` Lee Revell
  2005-03-11 16:26         ` Takashi Iwai
  0 siblings, 1 reply; 10+ messages in thread
From: Lee Revell @ 2005-03-10 21:35 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Wed, 2005-03-09 at 18:21 +0100, Takashi Iwai wrote:
> At Wed, 09 Mar 2005 11:54:30 +0100,
> I wrote:
> > 
> > At Wed, 09 Mar 2005 10:57:54 +0100,
> > I wrote:
> > > 
> > > At Wed, 09 Mar 2005 00:56:19 -0500,
> > > Lee Revell wrote:
> > > > 
> > > > I got an Oops again that seems to be caused by something in mu
> > > > multichannel patch.  But, I don't really know what to make of it.
> > > > 
> > > > ksymoops seems broken for 2.6 kernels, but it was able to disassemble
> > > > the offending code.
> > > > 
> > > > Any ideas?
> > > 
> > > In snd_emu10k1_pcm_channel_alloc(), epcm->voices[2..NUM_EFX_PLAYBACK]
> > > are not freed correctly.  Possibly did this hit?
> > 
> > Or maybe I misread the code.  Need more coffee now... :)
> > 
> > Anyway, snd_emu10k1_pcm_channel_alloc() should return immediately at
> > the second or later call when all voices have been already allocated.
> 
> The quick fix patch is below.
> But I'm not sure whether this is really related with the given bug.
> 

Thanks, I'll try this.  Unfortunately the bug is very hard to hit (I
have only triggered it twice) and I have no idea how to reproduce it.
It's somwhow associated with restarting JACK.

Lee



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Oops in snd_emu10k1_efx_playback_prepare
  2005-03-10 21:35       ` Lee Revell
@ 2005-03-11 16:26         ` Takashi Iwai
  2005-03-19  3:30           ` Lee Revell
  0 siblings, 1 reply; 10+ messages in thread
From: Takashi Iwai @ 2005-03-11 16:26 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

At Thu, 10 Mar 2005 16:35:45 -0500,
Lee Revell wrote:
> 
> On Wed, 2005-03-09 at 18:21 +0100, Takashi Iwai wrote:
> > At Wed, 09 Mar 2005 11:54:30 +0100,
> > I wrote:
> > > 
> > > At Wed, 09 Mar 2005 10:57:54 +0100,
> > > I wrote:
> > > > 
> > > > At Wed, 09 Mar 2005 00:56:19 -0500,
> > > > Lee Revell wrote:
> > > > > 
> > > > > I got an Oops again that seems to be caused by something in mu
> > > > > multichannel patch.  But, I don't really know what to make of it.
> > > > > 
> > > > > ksymoops seems broken for 2.6 kernels, but it was able to disassemble
> > > > > the offending code.
> > > > > 
> > > > > Any ideas?
> > > > 
> > > > In snd_emu10k1_pcm_channel_alloc(), epcm->voices[2..NUM_EFX_PLAYBACK]
> > > > are not freed correctly.  Possibly did this hit?
> > > 
> > > Or maybe I misread the code.  Need more coffee now... :)
> > > 
> > > Anyway, snd_emu10k1_pcm_channel_alloc() should return immediately at
> > > the second or later call when all voices have been already allocated.
> > 
> > The quick fix patch is below.
> > But I'm not sure whether this is really related with the given bug.
> > 
> 
> Thanks, I'll try this.  Unfortunately the bug is very hard to hit (I
> have only triggered it twice) and I have no idea how to reproduce it.
> It's somwhow associated with restarting JACK.

I'll apply this fix to CVS anyway.
Please report if you hit the bug again.


thanks,

Takashi


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Oops in snd_emu10k1_efx_playback_prepare
  2005-03-11 16:26         ` Takashi Iwai
@ 2005-03-19  3:30           ` Lee Revell
  2005-03-19  3:37             ` Lee Revell
  0 siblings, 1 reply; 10+ messages in thread
From: Lee Revell @ 2005-03-19  3:30 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Fri, 2005-03-11 at 17:26 +0100, Takashi Iwai wrote:
> At Thu, 10 Mar 2005 16:35:45 -0500,
> Lee Revell wrote:
> > 
> > On Wed, 2005-03-09 at 18:21 +0100, Takashi Iwai wrote:
> > > At Wed, 09 Mar 2005 11:54:30 +0100,
> > > I wrote:
> > > > 
> > > > At Wed, 09 Mar 2005 10:57:54 +0100,
> > > > I wrote:
> > > > > 
> > > > > At Wed, 09 Mar 2005 00:56:19 -0500,
> > > > > Lee Revell wrote:
> > > > > > 
> > > > > > I got an Oops again that seems to be caused by something in mu
> > > > > > multichannel patch.  But, I don't really know what to make of it.
> > > > > > 
> > > > > > ksymoops seems broken for 2.6 kernels, but it was able to disassemble
> > > > > > the offending code.
> > > > > > 
> > > > > > Any ideas?
> > > > > 
> > > > > In snd_emu10k1_pcm_channel_alloc(), epcm->voices[2..NUM_EFX_PLAYBACK]
> > > > > are not freed correctly.  Possibly did this hit?
> > > > 
> > > > Or maybe I misread the code.  Need more coffee now... :)
> > > > 
> > > > Anyway, snd_emu10k1_pcm_channel_alloc() should return immediately at
> > > > the second or later call when all voices have been already allocated.
> > > 
> > > The quick fix patch is below.
> > > But I'm not sure whether this is really related with the given bug.
> > > 
> > 
> > Thanks, I'll try this.  Unfortunately the bug is very hard to hit (I
> > have only triggered it twice) and I have no idea how to reproduce it.
> > It's somwhow associated with restarting JACK.
> 
> I'll apply this fix to CVS anyway.
> Please report if you hit the bug again.
> 
> 

I hit it again.  It's slightly different this time.

The problem triggered when I stopped JACK then restarted with a smaller
period size.

Lee

Unable to handle kernel paging request at virtual address 936e4158
c01d3d63
*pde = 00000000
Oops: 0000 [#1]
CPU:    0
EIP:    0060:[<c01d3d63>]    Not tainted VLI
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00210012   (2.6.12-rc1) 
eax: 00000008   ebx: 936e4170   ecx: 00000002   edx: d0b9fe3c
esi: 936e4158   edi: d0b9fe3c   ebp: d0b9fe0c   esp: d0b9fdf8
ds: 007b   es: 007b   ss: 0068
Stack: 00200046 def60000 0779dfff 03020100 00000001 d0b9fe50 e08e2178 d0b9fe3c 
       936e4158 00000008 00000000 00200216 00000001 00000000 de61e000 00000005 
       00000000 00000002 00000005 00001780 00001780 0000000f d0b9fe88 e08e2597 
Call Trace:
 [<c01031cf>] show_stack+0x7f/0xa0
 [<c010336a>] show_registers+0x15a/0x1c0
 [<c0103560>] die+0xf0/0x190
 [<c010e34b>] do_page_fault+0x31b/0x670
 [<c0102e23>] error_code+0x2b/0x30
 [<e08e2178>] snd_emu10k1_pcm_init_voice+0x5c8/0x610 [snd_emu10k1]
 [<e08e2597>] snd_emu10k1_efx_playback_prepare+0xd7/0xf0 [snd_emu10k1]
 [<e08987f5>] snd_pcm_do_prepare+0x15/0x40 [snd_pcm]
 [<e0897eb4>] snd_pcm_action_single+0x34/0x70 [snd_pcm]
 [<e08980f3>] snd_pcm_action_nonatomic+0x73/0x80 [snd_pcm]
 [<e0898871>] snd_pcm_prepare+0x21/0x30 [snd_pcm]
 [<e089af67>] snd_pcm_playback_ioctl1+0x47/0x2d0 [snd_pcm]
 [<e089be97>] snd_pcm_playback_ioctl_old+0x27/0x40 [snd_pcm]
 [<c01631a3>] do_ioctl+0x63/0x90
 [<c0163362>] vfs_ioctl+0x62/0x1c0
 [<c0163521>] sys_ioctl+0x61/0x80
 [<c0102c75>] syscall_call+0x7/0xb
Code: 90 90 90 90 90 90 90 90 55 89 e5 83 ec 14 8b 45 10 89 75 f8 89 7d fc 8b 55 08 8b 75 0c 3d ff 01 00 00 77 24 89 c1 89 d7 c1 e9 02 <f3> a5 a8 02 74 02 66 a5 a8 01 74 01 a4 89 d0 8b 75 f8 8b 7d fc 


>>EIP; c01d3d63 No symbols available   <=====

Trace; c01031cf No symbols available
Trace; c010336a No symbols available
Trace; c0103560 No symbols available
Trace; c010e34b No symbols available
Trace; c0102e23 No symbols available
Trace; e08e2178 No symbols available
Trace; e08e2597 No symbols available
Trace; e08987f5 No symbols available
Trace; e0897eb4 No symbols available
Trace; e08980f3 No symbols available
Trace; e0898871 No symbols available
Trace; e089af67 No symbols available
Trace; e089be97 No symbols available
Trace; c01631a3 No symbols available
Trace; c0163362 No symbols available
Trace; c0163521 No symbols available
Trace; c0102c75 No symbols available

This architecture has variable length instructions, decoding before eip
is unreliable, take these instructions with a pinch of salt.

Code;  c01d3d38 No symbols available
00000000 <_EIP>:
Code;  c01d3d38 No symbols available
   0:   90                        nop    
Code;  c01d3d39 No symbols available
   1:   90                        nop    
Code;  c01d3d3a No symbols available
   2:   90                        nop    
Code;  c01d3d3b No symbols available
   3:   90                        nop    
Code;  c01d3d3c No symbols available
   4:   90                        nop    
Code;  c01d3d3d No symbols available
   5:   90                        nop    
Code;  c01d3d3e No symbols available
   6:   90                        nop    
Code;  c01d3d3f No symbols available
   7:   90                        nop    
Code;  c01d3d40 No symbols available
   8:   55                        push   %ebp
Code;  c01d3d41 No symbols available
   9:   89 e5                     mov    %esp,%ebp
Code;  c01d3d43 No symbols available
   b:   83 ec 14                  sub    $0x14,%esp
Code;  c01d3d46 No symbols available
   e:   8b 45 10                  mov    0x10(%ebp),%eax
Code;  c01d3d49 No symbols available
  11:   89 75 f8                  mov    %esi,0xfffffff8(%ebp)
Code;  c01d3d4c No symbols available
  14:   89 7d fc                  mov    %edi,0xfffffffc(%ebp)
Code;  c01d3d4f No symbols available
  17:   8b 55 08                  mov    0x8(%ebp),%edx
Code;  c01d3d52 No symbols available
  1a:   8b 75 0c                  mov    0xc(%ebp),%esi
Code;  c01d3d55 No symbols available
  1d:   3d ff 01 00 00            cmp    $0x1ff,%eax
Code;  c01d3d5a No symbols available
  22:   77 24                     ja     48 <_EIP+0x48>
Code;  c01d3d5c No symbols available
  24:   89 c1                     mov    %eax,%ecx
Code;  c01d3d5e No symbols available
  26:   89 d7                     mov    %edx,%edi
Code;  c01d3d60 No symbols available
  28:   c1 e9 02                  shr    $0x2,%ecx

This decode from eip onwards should be reliable

Code;  c01d3d63 No symbols available
00000000 <_EIP>:
Code;  c01d3d63 No symbols available   <=====
   0:   f3 a5                     repz movsl %ds:(%esi),%es:(%edi)   <=====
Code;  c01d3d65 No symbols available
   2:   a8 02                     test   $0x2,%al
Code;  c01d3d67 No symbols available
   4:   74 02                     je     8 <_EIP+0x8>
Code;  c01d3d69 No symbols available
   6:   66 a5                     movsw  %ds:(%esi),%es:(%edi)
Code;  c01d3d6b No symbols available
   8:   a8 01                     test   $0x1,%al
Code;  c01d3d6d No symbols available
   a:   74 01                     je     d <_EIP+0xd>
Code;  c01d3d6f No symbols available
   c:   a4                        movsb  %ds:(%esi),%es:(%edi)
Code;  c01d3d70 No symbols available
   d:   89 d0                     mov    %edx,%eax
Code;  c01d3d72 No symbols available
   f:   8b 75 f8                  mov    0xfffffff8(%ebp),%esi
Code;  c01d3d75 No symbols available
  12:   8b 7d fc                  mov    0xfffffffc(%ebp),%edi


2 warnings and 2 errors issued.  Results may not be reliable.





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Oops in snd_emu10k1_efx_playback_prepare
  2005-03-19  3:30           ` Lee Revell
@ 2005-03-19  3:37             ` Lee Revell
  2005-03-23 11:35               ` Takashi Iwai
  0 siblings, 1 reply; 10+ messages in thread
From: Lee Revell @ 2005-03-19  3:37 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Fri, 2005-03-18 at 22:30 -0500, Lee Revell wrote:
> Unable to handle kernel paging request at virtual address 936e4158

Sorry, ksymoops is really useless.  The oops from dmesg is a lot better:

Unable to handle kernel paging request at virtual address 936e4158
 printing eip:
c01d3d63
*pde = 00000000
Oops: 0000 [#1]
PREEMPT 
Modules linked in: snd_usb_audio snd_usb_lib snd_emu10k1_synth
snd_emux_synth snd_seq_virmidi snd_seq_midi_emul snd_seq_oss
snd_seq_midi snd_seq_midi_event snd_seq snd_emu10k1 snd_rawmidi
snd_seq_device snd_ac97_codec snd_pcm_oss snd_mixer_oss snd_pcm
snd_timer snd_page_alloc snd_util_mem snd_hwdep snd realtime commoncap
af_packet e100 mii uhci_hcd agpgart evdev psmouse usbhid ehci_hcd
usbcore
CPU:    0
EIP:    0060:[<c01d3d63>]    Not tainted VLI
EFLAGS: 00210012   (2.6.12-rc1) 
EIP is at memcpy+0x23/0x60
eax: 00000008   ebx: 936e4170   ecx: 00000002   edx: d0b9fe3c
esi: 936e4158   edi: d0b9fe3c   ebp: d0b9fe0c   esp: d0b9fdf8
ds: 007b   es: 007b   ss: 0068
Process jackd (pid: 13176, threadinfo=d0b9e000 task=d2d4f580)
Stack: 00200046 def60000 0779dfff 03020100 00000001 d0b9fe50 e08e2178
d0b9fe3c 
       936e4158 00000008 00000000 00200216 00000001 00000000 de61e000
00000005 
       00000000 00000002 00000005 00001780 00001780 0000000f d0b9fe88
e08e2597 
Call Trace:
 [<c01031cf>] show_stack+0x7f/0xa0
 [<c010336a>] show_registers+0x15a/0x1c0
 [<c0103560>] die+0xf0/0x190
 [<c010e34b>] do_page_fault+0x31b/0x670
 [<c0102e23>] error_code+0x2b/0x30
 [<e08e2178>] snd_emu10k1_pcm_init_voice+0x5c8/0x610 [snd_emu10k1]
 [<e08e2597>] snd_emu10k1_efx_playback_prepare+0xd7/0xf0 [snd_emu10k1]
 [<e08987f5>] snd_pcm_do_prepare+0x15/0x40 [snd_pcm]
 [<e0897eb4>] snd_pcm_action_single+0x34/0x70 [snd_pcm]
 [<e08980f3>] snd_pcm_action_nonatomic+0x73/0x80 [snd_pcm]
 [<e0898871>] snd_pcm_prepare+0x21/0x30 [snd_pcm]
 [<e089af67>] snd_pcm_playback_ioctl1+0x47/0x2d0 [snd_pcm]
 [<e089be97>] snd_pcm_playback_ioctl_old+0x27/0x40 [snd_pcm]
 [<c01631a3>] do_ioctl+0x63/0x90
 [<c0163362>] vfs_ioctl+0x62/0x1c0
 [<c0163521>] sys_ioctl+0x61/0x80
 [<c0102c75>] syscall_call+0x7/0xb
Code: 90 90 90 90 90 90 90 90 55 89 e5 83 ec 14 8b 45 10 89 75 f8 89 7d
fc 8b 55 08 8b 75 0c 3d ff 01 00 00 77 24 89 c1 89 d7 c1 e9 02 <f3> a5
a8 02 74 02 66 a5 a8 01 74 01 a4 89 d0 8b 75 f8 8b 7d fc 
 <6>note: jackd[13176] exited with preempt_count 1

Now, the only memcpy's in snd_emu10k1_pcm_init_voice are these:

311         /* volume parameters */
312         if (extra) {
313                 attn = 0;
314                 memset(send_routing, 0, sizeof(send_routing));
315                 send_routing[0] = 0;
316                 send_routing[1] = 1;
317                 send_routing[2] = 2;
318                 send_routing[3] = 3;
319                 memset(send_amount, 0, sizeof(send_amount));
320         } else {
321                 /* mono, left, right (master voice = left) */
322                 tmp = stereo ? (master ? 1 : 2) : 0;
323                 memcpy(send_routing, &mix->send_routing[tmp][0], 8);
324                 memcpy(send_amount, &mix->send_volume[tmp][0], 8);
325         }
326 

It looks like this is related to the change I made to the send routing
controls for the multichannel device.

Lee



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Oops in snd_emu10k1_efx_playback_prepare
  2005-03-19  3:37             ` Lee Revell
@ 2005-03-23 11:35               ` Takashi Iwai
  2005-03-23 20:41                 ` Lee Revell
  0 siblings, 1 reply; 10+ messages in thread
From: Takashi Iwai @ 2005-03-23 11:35 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 3627 bytes --]

At Fri, 18 Mar 2005 22:37:12 -0500,
Lee Revell wrote:
> 
> On Fri, 2005-03-18 at 22:30 -0500, Lee Revell wrote:
> > Unable to handle kernel paging request at virtual address 936e4158
> 
> Sorry, ksymoops is really useless.  The oops from dmesg is a lot better:
> 
> Unable to handle kernel paging request at virtual address 936e4158
>  printing eip:
> c01d3d63
> *pde = 00000000
> Oops: 0000 [#1]
> PREEMPT 
> Modules linked in: snd_usb_audio snd_usb_lib snd_emu10k1_synth
> snd_emux_synth snd_seq_virmidi snd_seq_midi_emul snd_seq_oss
> snd_seq_midi snd_seq_midi_event snd_seq snd_emu10k1 snd_rawmidi
> snd_seq_device snd_ac97_codec snd_pcm_oss snd_mixer_oss snd_pcm
> snd_timer snd_page_alloc snd_util_mem snd_hwdep snd realtime commoncap
> af_packet e100 mii uhci_hcd agpgart evdev psmouse usbhid ehci_hcd
> usbcore
> CPU:    0
> EIP:    0060:[<c01d3d63>]    Not tainted VLI
> EFLAGS: 00210012   (2.6.12-rc1) 
> EIP is at memcpy+0x23/0x60
> eax: 00000008   ebx: 936e4170   ecx: 00000002   edx: d0b9fe3c
> esi: 936e4158   edi: d0b9fe3c   ebp: d0b9fe0c   esp: d0b9fdf8
> ds: 007b   es: 007b   ss: 0068
> Process jackd (pid: 13176, threadinfo=d0b9e000 task=d2d4f580)
> Stack: 00200046 def60000 0779dfff 03020100 00000001 d0b9fe50 e08e2178
> d0b9fe3c 
>        936e4158 00000008 00000000 00200216 00000001 00000000 de61e000
> 00000005 
>        00000000 00000002 00000005 00001780 00001780 0000000f d0b9fe88
> e08e2597 
> Call Trace:
>  [<c01031cf>] show_stack+0x7f/0xa0
>  [<c010336a>] show_registers+0x15a/0x1c0
>  [<c0103560>] die+0xf0/0x190
>  [<c010e34b>] do_page_fault+0x31b/0x670
>  [<c0102e23>] error_code+0x2b/0x30
>  [<e08e2178>] snd_emu10k1_pcm_init_voice+0x5c8/0x610 [snd_emu10k1]
>  [<e08e2597>] snd_emu10k1_efx_playback_prepare+0xd7/0xf0 [snd_emu10k1]
>  [<e08987f5>] snd_pcm_do_prepare+0x15/0x40 [snd_pcm]
>  [<e0897eb4>] snd_pcm_action_single+0x34/0x70 [snd_pcm]
>  [<e08980f3>] snd_pcm_action_nonatomic+0x73/0x80 [snd_pcm]
>  [<e0898871>] snd_pcm_prepare+0x21/0x30 [snd_pcm]
>  [<e089af67>] snd_pcm_playback_ioctl1+0x47/0x2d0 [snd_pcm]
>  [<e089be97>] snd_pcm_playback_ioctl_old+0x27/0x40 [snd_pcm]
>  [<c01631a3>] do_ioctl+0x63/0x90
>  [<c0163362>] vfs_ioctl+0x62/0x1c0
>  [<c0163521>] sys_ioctl+0x61/0x80
>  [<c0102c75>] syscall_call+0x7/0xb
> Code: 90 90 90 90 90 90 90 90 55 89 e5 83 ec 14 8b 45 10 89 75 f8 89 7d
> fc 8b 55 08 8b 75 0c 3d ff 01 00 00 77 24 89 c1 89 d7 c1 e9 02 <f3> a5
> a8 02 74 02 66 a5 a8 01 74 01 a4 89 d0 8b 75 f8 8b 7d fc 
>  <6>note: jackd[13176] exited with preempt_count 1
> 
> Now, the only memcpy's in snd_emu10k1_pcm_init_voice are these:
> 
> 311         /* volume parameters */
> 312         if (extra) {
> 313                 attn = 0;
> 314                 memset(send_routing, 0, sizeof(send_routing));
> 315                 send_routing[0] = 0;
> 316                 send_routing[1] = 1;
> 317                 send_routing[2] = 2;
> 318                 send_routing[3] = 3;
> 319                 memset(send_amount, 0, sizeof(send_amount));
> 320         } else {
> 321                 /* mono, left, right (master voice = left) */
> 322                 tmp = stereo ? (master ? 1 : 2) : 0;
> 323                 memcpy(send_routing, &mix->send_routing[tmp][0], 8);
> 324                 memcpy(send_amount, &mix->send_volume[tmp][0], 8);
> 325         }
> 326 
> 
> It looks like this is related to the change I made to the send routing
> controls for the multichannel device.

The calculation of mix pointer seems wrong when the voices are
allocated from the tail of voice table and back to 0 (e.g. voice 30,
31, 0, 1, 2, ...)

Could you try the patch below?


Takashi

[-- Attachment #2: Type: text/plain, Size: 7130 bytes --]

Index: alsa-kernel/pci/emu10k1/emupcm.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/pci/emu10k1/emupcm.c,v
retrieving revision 1.47
diff -u -r1.47 emupcm.c
--- alsa-kernel/pci/emu10k1/emupcm.c	14 Mar 2005 14:56:17 -0000	1.47
+++ alsa-kernel/pci/emu10k1/emupcm.c	23 Mar 2005 11:33:01 -0000
@@ -275,11 +275,11 @@
 				       int master, int extra,
 				       emu10k1_voice_t *evoice,
 				       unsigned int start_addr,
-				       unsigned int end_addr)
+				       unsigned int end_addr,
+				       emu10k1_pcm_mixer_t *mix)
 {
 	snd_pcm_substream_t *substream = evoice->epcm->substream;
 	snd_pcm_runtime_t *runtime = substream->runtime;
-	emu10k1_pcm_mixer_t *mix;
 	unsigned int silent_page, tmp;
 	int voice, stereo, w_16;
 	unsigned char attn, send_amount[8];
@@ -289,11 +289,6 @@
 	unsigned int ccis;
 
 	voice = evoice->number;
-	if (evoice->epcm->type == PLAYBACK_EFX) 
-		mix = &emu->efx_pcm_mixer[voice - evoice->epcm->voices[0]->number];
-	else
-		mix = &emu->pcm_mixer[substream->number];
-
 	stereo = runtime->channels == 2;
 	w_16 = snd_pcm_format_width(runtime->format) == 16;
 
@@ -497,14 +492,16 @@
 	}
 	end_addr += start_addr;
 	snd_emu10k1_pcm_init_voice(emu, 1, 1, epcm->extra,
-				   start_addr, end_addr);
+				   start_addr, end_addr, NULL);
 	start_addr = epcm->start_addr;
 	end_addr = epcm->start_addr + snd_pcm_lib_buffer_bytes(substream);
 	snd_emu10k1_pcm_init_voice(emu, 1, 0, epcm->voices[0],
-				   start_addr, end_addr);
+				   start_addr, end_addr,
+				   &emu->pcm_mixer[substream->number]);
 	if (epcm->voices[1])
 		snd_emu10k1_pcm_init_voice(emu, 0, 0, epcm->voices[1],
-					   start_addr, end_addr);
+					   start_addr, end_addr,
+					   &emu->pcm_mixer[substream->number]);
 	return 0;
 }
 
@@ -526,16 +523,18 @@
 	channel_size = ( end_addr - start_addr ) / NUM_EFX_PLAYBACK;
 
 	snd_emu10k1_pcm_init_voice(emu, 1, 1, epcm->extra,
-				   start_addr, start_addr + (channel_size / 2));
+				   start_addr, start_addr + (channel_size / 2), NULL);
 
 	/* only difference with the master voice is we use it for the pointer */
 	snd_emu10k1_pcm_init_voice(emu, 1, 0, epcm->voices[0],
-				   start_addr, start_addr + channel_size);
+				   start_addr, start_addr + channel_size,
+				   &emu->efx_pcm_mixer[0]);
 
 	start_addr += channel_size;
 	for (i = 1; i < NUM_EFX_PLAYBACK; i++) {
 		snd_emu10k1_pcm_init_voice(emu, 0, 0, epcm->voices[i],
-					   start_addr, start_addr+channel_size);
+					   start_addr, start_addr + channel_size,
+					   &emu->efx_pcm_mixer[i]);
 		start_addr += channel_size;
 	}
 
@@ -654,12 +653,13 @@
 	}
 }
 
-static void snd_emu10k1_playback_prepare_voice(emu10k1_t *emu, emu10k1_voice_t *evoice, int master, int extra)
+static void snd_emu10k1_playback_prepare_voice(emu10k1_t *emu, emu10k1_voice_t *evoice,
+					       int master, int extra,
+					       emu10k1_pcm_mixer_t *mix)
 {
 	snd_pcm_substream_t *substream;
 	snd_pcm_runtime_t *runtime;
-	emu10k1_pcm_mixer_t *mix;
-	unsigned int attn;
+	unsigned int attn, vattn;
 	unsigned int voice, tmp;
 
 	if (evoice == NULL)	/* skip second voice for mono */
@@ -668,15 +668,12 @@
 	runtime = substream->runtime;
 	voice = evoice->number;
 
-	mix = evoice->epcm->type == PLAYBACK_EFX
-		? &emu->efx_pcm_mixer[voice - evoice->epcm->voices[0]->number]
-		: &emu->pcm_mixer[substream->number];
-
 	attn = extra ? 0 : 0x00ff;
 	tmp = runtime->channels == 2 ? (master ? 1 : 2) : 0;
+	vattn = mix != NULL ? (mix->attn[tmp] << 16) : 0;
 	snd_emu10k1_ptr_write(emu, IFATN, voice, attn);
-	snd_emu10k1_ptr_write(emu, VTFT, voice, (mix->attn[tmp] << 16) | 0xffff);
-	snd_emu10k1_ptr_write(emu, CVCF, voice, (mix->attn[tmp] << 16) | 0xffff);
+	snd_emu10k1_ptr_write(emu, VTFT, voice, vattn | 0xffff);
+	snd_emu10k1_ptr_write(emu, CVCF, voice, vattn | 0xffff);
 	snd_emu10k1_ptr_write(emu, DCYSUSV, voice, 0x7f7f);
 	snd_emu10k1_voice_clear_loop_stop(emu, voice);
 }	
@@ -725,7 +722,9 @@
 	emu10k1_t *emu = snd_pcm_substream_chip(substream);
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	emu10k1_pcm_t *epcm = runtime->private_data;
+	emu10k1_pcm_mixer_t *mix;
 	int result = 0;
+
 	// printk("trigger - emu10k1 = 0x%x, cmd = %i, pointer = %i\n", (int)emu, cmd, substream->ops->pointer(substream));
 	spin_lock(&emu->reg_lock);
 	switch (cmd) {
@@ -734,9 +733,10 @@
 		snd_emu10k1_playback_invalidate_cache(emu, 0, epcm->voices[0]);
 		/* follow thru */
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-		snd_emu10k1_playback_prepare_voice(emu, epcm->voices[0], 1, 0);
-		snd_emu10k1_playback_prepare_voice(emu, epcm->voices[1], 0, 0);
-		snd_emu10k1_playback_prepare_voice(emu, epcm->extra, 1, 1);
+		mix = &emu->pcm_mixer[substream->number];
+		snd_emu10k1_playback_prepare_voice(emu, epcm->voices[0], 1, 0, mix);
+		snd_emu10k1_playback_prepare_voice(emu, epcm->voices[1], 0, 0, mix);
+		snd_emu10k1_playback_prepare_voice(emu, epcm->extra, 1, 1, NULL);
 		snd_emu10k1_playback_trigger_voice(emu, epcm->voices[0], 1, 0);
 		snd_emu10k1_playback_trigger_voice(emu, epcm->voices[1], 0, 0);
 		snd_emu10k1_playback_trigger_voice(emu, epcm->extra, 1, 1);
@@ -851,7 +851,7 @@
 	emu10k1_t *emu = snd_pcm_substream_chip(substream);
 	snd_pcm_runtime_t *runtime = substream->runtime;
 	emu10k1_pcm_t *epcm = runtime->private_data;
-	int i = 0;
+	int i;
 	int result = 0;
 
 	spin_lock(&emu->reg_lock);
@@ -865,16 +865,16 @@
 
 		/* follow thru */
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-		snd_emu10k1_playback_prepare_voice(emu, epcm->voices[0], 0, 0);
-		snd_emu10k1_playback_prepare_voice(emu, epcm->extra, 1, 1);
-		for (i = 1; i < NUM_EFX_PLAYBACK; i++) {	
-			snd_emu10k1_playback_prepare_voice(emu, epcm->voices[i], 0, 0);
-		}
+		snd_emu10k1_playback_prepare_voice(emu, epcm->extra, 1, 1, NULL);
+		snd_emu10k1_playback_prepare_voice(emu, epcm->voices[0], 0, 0,
+						   &emu->efx_pcm_mixer[0]);
+		for (i = 1; i < NUM_EFX_PLAYBACK; i++)
+			snd_emu10k1_playback_prepare_voice(emu, epcm->voices[i], 0, 0,
+							   &emu->efx_pcm_mixer[i]);
 		snd_emu10k1_playback_trigger_voice(emu, epcm->voices[0], 0, 0);
 		snd_emu10k1_playback_trigger_voice(emu, epcm->extra, 1, 1);
-		for (i = 1; i < NUM_EFX_PLAYBACK; i++) {	
+		for (i = 1; i < NUM_EFX_PLAYBACK; i++)
 			snd_emu10k1_playback_trigger_voice(emu, epcm->voices[i], 0, 0);
-		}
 		epcm->running = 1;
 		break;
 	case SNDRV_PCM_TRIGGER_STOP:
Index: alsa-kernel/pci/emu10k1/voice.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/pci/emu10k1/voice.c,v
retrieving revision 1.6
diff -u -r1.6 voice.c
--- alsa-kernel/pci/emu10k1/voice.c	14 Mar 2005 14:55:56 -0000	1.6
+++ alsa-kernel/pci/emu10k1/voice.c	23 Mar 2005 11:33:01 -0000
@@ -62,15 +62,13 @@
 			continue;
 		}
 			
-		/* make sure the block of voices does not cross the 32 voice boundary */
-		//if (((i % 32) + number) > 32)
-		//	continue;
-
 		skip = 0;
 		for (k = 0; k < number; k++) {
 			voice = &emu->voices[(i+k) % NUM_G];
-			if (voice->use)
+			if (voice->use) {
 				skip = 1;
+				break;
+			}
 		}
 		if (!skip) {
 			// printk("allocated voice %d\n", i);

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Oops in snd_emu10k1_efx_playback_prepare
  2005-03-23 11:35               ` Takashi Iwai
@ 2005-03-23 20:41                 ` Lee Revell
  0 siblings, 0 replies; 10+ messages in thread
From: Lee Revell @ 2005-03-23 20:41 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Wed, 2005-03-23 at 12:35 +0100, Takashi Iwai wrote:
> The calculation of mix pointer seems wrong when the voices are
> allocated from the tail of voice table and back to 0 (e.g. voice 30,
> 31, 0, 1, 2, ...)
> 
> Could you try the patch below?
> 

Takashi-san,

It seems to work.

Thank you very much for cleaning up this code.  This was my first
serious attempt at hacking a Linux driver, and it would not have been
possible without help from you and everyone else on this list.

Lee



-------------------------------------------------------
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-03-23 20:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-09  5:56 Oops in snd_emu10k1_efx_playback_prepare Lee Revell
2005-03-09  9:57 ` Takashi Iwai
2005-03-09 10:54   ` Takashi Iwai
2005-03-09 17:21     ` Takashi Iwai
2005-03-10 21:35       ` Lee Revell
2005-03-11 16:26         ` Takashi Iwai
2005-03-19  3:30           ` Lee Revell
2005-03-19  3:37             ` Lee Revell
2005-03-23 11:35               ` Takashi Iwai
2005-03-23 20:41                 ` Lee Revell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.