All of lore.kernel.org
 help / color / mirror / Atom feed
* Small patch for alsa-lib
@ 2004-01-20 12:32 Adam Tla/lka
  2004-01-20 12:45 ` Jaroslav Kysela
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Tla/lka @ 2004-01-20 12:32 UTC (permalink / raw)
  To: alsa-devel

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

Welcome

I observe that while using xmms with ALSA output plugin
and alsa-20040120 compiled lib we get shared memory usage growing.
Any opening of new sound source (sound file etc.) adds a new shm segment 
while old segments stay in memory until xmms exits.
Sometimes they stay even after application closing and must be removed 
manually.
I am sending a small patch which should remove this behaviour.

Regards
-- 
Adam Tla/lka      mailto:atlka@pg.gda.pl    ^v^ ^v^ ^v^
Computer Center,  Technical University of Gdansk, Poland
PGP public key:   finger atlka@sunrise.pg.gda.pl

[-- Attachment #2: alsa-20040120.patch --]
[-- Type: text/plain, Size: 793 bytes --]

--- alsa-20040120/alsa-lib/src/pcm/pcm_mmap_old.c	2004-01-20 11:03:28.000000000 +0100
+++ alsa-20040120/alsa-lib/src/pcm/pcm_mmap.c	2004-01-20 13:04:03.000000000 +0100
@@ -462,11 +462,16 @@
 			if (i->u.shm.area) {
 				snd_shm_area_destroy(i->u.shm.area);
 				i->u.shm.area = NULL;
-			} else {
-				err = shmdt(i->addr);
-				if (err < 0) {
-					SYSERR("shmdt failed");
-					return -errno;
+				if (pcm->access == SND_PCM_ACCESS_MMAP_INTERLEAVED ||
+				    pcm->access == SND_PCM_ACCESS_RW_INTERLEAVED) {
+					unsigned int c1;
+					for (c1 = c + 1; c1 < pcm->channels; c1++) {
+						snd_pcm_channel_info_t *i1 = &pcm->mmap_channels[c1];
+						if (i1->u.shm.area) {
+							snd_shm_area_destroy(i1->u.shm.area);
+							i1->u.shm.area = NULL;
+						}
+					}
 				}
 			}
 			break;

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

* Re: Small patch for alsa-lib
  2004-01-20 12:32 Small patch for alsa-lib Adam Tla/lka
@ 2004-01-20 12:45 ` Jaroslav Kysela
  0 siblings, 0 replies; 2+ messages in thread
From: Jaroslav Kysela @ 2004-01-20 12:45 UTC (permalink / raw)
  To: Adam Tla/lka; +Cc: alsa-devel

On Tue, 20 Jan 2004, Adam Tla/lka wrote:

> Welcome
> 
> I observe that while using xmms with ALSA output plugin
> and alsa-20040120 compiled lib we get shared memory usage growing.
> Any opening of new sound source (sound file etc.) adds a new shm segment 
> while old segments stay in memory until xmms exits.
> Sometimes they stay even after application closing and must be removed 
> manually.
> I am sending a small patch which should remove this behaviour.

Thanks for this patch. It's in CVS now.

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

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

end of thread, other threads:[~2004-01-20 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-20 12:32 Small patch for alsa-lib Adam Tla/lka
2004-01-20 12:45 ` Jaroslav Kysela

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.