From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Oops in snd_emu10k1_efx_playback_prepare Date: Wed, 09 Mar 2005 18:21:18 +0100 Message-ID: References: <1110347780.7123.21.camel@mindpipe> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: multipart/mixed; boundary="Multipart_Wed_Mar__9_18:21:18_2005-1" In-Reply-To: Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Lee Revell Cc: alsa-devel List-Id: alsa-devel@alsa-project.org --Multipart_Wed_Mar__9_18:21:18_2005-1 Content-Type: text/plain; charset=US-ASCII 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 --Multipart_Wed_Mar__9_18:21:18_2005-1 Content-Type: text/plain; charset=US-ASCII 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, --Multipart_Wed_Mar__9_18:21:18_2005-1-- ------------------------------------------------------- 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