[Pkg-alsa-devel] Bug#236394: marked as done (Accidentally reverted pcm_direct.c fixes)

Debian Bug Tracking System owner@bugs.debian.org
Wed, 17 Mar 2004 10:33:15 -0800


Your message dated Wed, 17 Mar 2004 13:17:04 -0500
with message-id <E1B3fbE-0004YZ-00@newraff.debian.org>
and subject line Bug#236394: fixed in alsa-lib 1.0.3b-1
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 6 Mar 2004 01:37:27 +0000
>From michel@daenzer.net Fri Mar 05 17:37:26 2004
Return-path: <michel@daenzer.net>
Received: from 217-162-0-234.dclient.hispeed.ch (thor.asgaard.local) [217.162.0.234] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1AzQko-0003rV-00; Fri, 05 Mar 2004 17:37:26 -0800
Received: from daenzer by thor.asgaard.local with local (Exim 4.30)
	id 1AzQkk-0008WV-Tv; Sat, 06 Mar 2004 02:37:22 +0100
Content-Type: multipart/mixed; boundary="===============1977696669=="
MIME-Version: 1.0
From: Michel Daenzer <daenzer@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Accidentally reverted pcm_direct.c fixes
X-Mailer: reportbug 2.48
Date: Sat, 06 Mar 2004 02:37:22 +0100
Message-Id: <E1AzQkk-0008WV-Tv@thor.asgaard.local>
Sender: Michel Daenzer <michel@daenzer.net>
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_05 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-5.0 required=4.0 tests=HAS_PACKAGE autolearn=no 
	version=2.60-bugs.debian.org_2004_03_05
X-Spam-Level: 

This is a multi-part MIME message sent by reportbug.

--===============1977696669==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: libasound2
Version: 1.0.2-1
Severity: normal
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


These fixes were accidentally reverted due to sf.net CVS problems. At least
the last hunk is needed for smooth playback with xine using the dmix plugin.

I posted about this to the alsa-devel under the subject 'reverted
pcm_direct.c fixes', and the fixes have been reinstated in CVS, but the
thread isn't available in the archives yet. I can post an URL as soon as
it's there, if that would be helpful.


- -- System Information:
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (101, 'experimental')
Architecture: powerpc (ppc)
Kernel: Linux 2.6.3-ben1
Locale: LANG=de_CH.UTF-8, LC_CTYPE=de_CH.UTF-8

Versions of packages libasound2 depends on:
ii  libc6                       2.3.2.ds1-11 GNU C Library: Shared libraries an

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFASStRWoGvjmrbsgARAp1BAJ0fA/VNqDs0LOwofZPsI+3VY+UO+ACgrH6v
UFeNJ9CjnpIrLbL3vfFyCXE=
=mzpE
-----END PGP SIGNATURE-----

--===============1977696669==
Content-Type: text/x-c; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="alsa-lib-cvs.diff"

Index: src/pcm/pcm_direct.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_direct.c,v
retrieving revision 1.17
diff -p -u -r1.17 pcm_direct.c
--- src/pcm/pcm_direct.c	25 Feb 2004 11:24:30 -0000	1.17
+++ src/pcm/pcm_direct.c	5 Mar 2004 17:31:02 -0000
@@ -100,11 +100,21 @@ int snd_pcm_direct_semaphore_up(snd_pcm_
 int snd_pcm_direct_shm_create_or_connect(snd_pcm_direct_t *dmix)
 {
 	struct shmid_ds buf;
-	int ret = 0;
+	int tmpid, err;
 	
+retryget:
 	dmix->shmid = shmget(dmix->ipc_key, sizeof(snd_pcm_direct_share_t), IPC_CREAT | 0666);
-	if (dmix->shmid < 0)
-		return -errno;
+	err = -errno;
+	if (dmix->shmid < 0){
+		if (errno == EINVAL)
+		if ((tmpid = shmget(dmix->ipc_key, 0, 0666)) != -1)
+		if (!shmctl(tmpid, IPC_STAT, &buf))
+		if (!buf.shm_nattch)
+	    	/* no users so destroy the segment */
+		if (!shmctl(tmpid, IPC_RMID, NULL))
+		    goto retryget;
+		return err;
+	}
 	dmix->shmptr = shmat(dmix->shmid, 0, 0);
 	if (dmix->shmptr == (void *) -1) {
 		snd_pcm_direct_shm_discard(dmix);
@@ -117,9 +127,9 @@ int snd_pcm_direct_shm_create_or_connect
 	}
 	if (buf.shm_nattch == 1) {	/* we're the first user, clear the segment */
 		memset(dmix->shmptr, 0, sizeof(snd_pcm_direct_share_t));
-		ret = 1;
+		return 1;
 	}
-	return ret;
+	return 0;
 }
 
 int snd_pcm_direct_shm_discard(snd_pcm_direct_t *dmix)
@@ -409,15 +419,23 @@ int snd_pcm_direct_poll_revents(snd_pcm_
 {
 	snd_pcm_direct_t *dmix = pcm->private_data;
 	unsigned short events;
-	static snd_timer_read_t rbuf[5];	/* can be overwriten by multiple plugins, we don't need the value */
+	/* rbuf might be overwriten by multiple plugins */
+	/* we don't need the value */
+	static snd_timer_read_t rbuf[5];
 
 	assert(pfds && nfds == 1 && revents);
 	events = pfds[0].revents;
 	if (events & POLLIN) {
-		events |= POLLOUT;
-		events &= ~POLLIN;
+		int empty = 0;
+		if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
+			events |= POLLOUT;
+			events &= ~POLLIN;
+			empty = snd_pcm_mmap_playback_avail(pcm) < pcm->avail_min;
+		} else {
+			empty = snd_pcm_mmap_capture_avail(pcm) < pcm->avail_min;
+		}
 		/* empty the timer read queue */
-		while (snd_timer_read(dmix->timer, &rbuf, sizeof(rbuf)) == sizeof(rbuf)) ;
+		while (empty && snd_timer_read(dmix->timer, &rbuf, sizeof(rbuf)) == sizeof(rbuf)) ;
 	}
 	*revents = events;
 	return 0;

--===============1977696669==--

---------------------------------------
Received: (at 236394-close) by bugs.debian.org; 17 Mar 2004 18:23:13 +0000
>From katie@ftp-master.debian.org Wed Mar 17 10:23:13 2004
Return-path: <katie@ftp-master.debian.org>
Received: from newraff.debian.org [208.185.25.31] (mail)
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1B3fhA-0003ki-00; Wed, 17 Mar 2004 10:23:12 -0800
Received: from katie by newraff.debian.org with local (Exim 3.35 1 (Debian))
	id 1B3fbE-0004YZ-00; Wed, 17 Mar 2004 13:17:04 -0500
From: dbharris@debian.org (David B. Harris)
To: 236394-close@bugs.debian.org
X-Katie: $Revision: 1.45 $
Subject: Bug#236394: fixed in alsa-lib 1.0.3b-1
Message-Id: <E1B3fbE-0004YZ-00@newraff.debian.org>
Sender: Archive Administrator <katie@ftp-master.debian.org>
Date: Wed, 17 Mar 2004 13:17:04 -0500
Delivered-To: 236394-close@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_12 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-5.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2004_03_12
X-Spam-Level: 

Source: alsa-lib
Source-Version: 1.0.3b-1

We believe that the bug you reported is fixed in the latest version of
alsa-lib, which is due to be installed in the Debian FTP archive:

alsa-lib_1.0.3b-1.diff.gz
  to pool/main/a/alsa-lib/alsa-lib_1.0.3b-1.diff.gz
alsa-lib_1.0.3b-1.dsc
  to pool/main/a/alsa-lib/alsa-lib_1.0.3b-1.dsc
alsa-lib_1.0.3b.orig.tar.gz
  to pool/main/a/alsa-lib/alsa-lib_1.0.3b.orig.tar.gz
libasound2-dev_1.0.3b-1_i386.deb
  to pool/main/a/alsa-lib/libasound2-dev_1.0.3b-1_i386.deb
libasound2-doc_1.0.3b-1_all.deb
  to pool/main/a/alsa-lib/libasound2-doc_1.0.3b-1_all.deb
libasound2-plugins_1.0.3b-1_i386.deb
  to pool/main/a/alsa-lib/libasound2-plugins_1.0.3b-1_i386.deb
libasound2_1.0.3b-1_i386.deb
  to pool/main/a/alsa-lib/libasound2_1.0.3b-1_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 236394@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
David B. Harris <dbharris@debian.org> (supplier of updated alsa-lib package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Wed, 17 Mar 2004 12:40:44 -0500
Source: alsa-lib
Binary: libasound2-dev libasound2-plugins libasound2-doc libasound2
Architecture: source all i386
Version: 1.0.3b-1
Distribution: unstable
Urgency: medium
Maintainer: Debian-Alsa Psychos <pkg-alsa-devel@lists.alioth.debian.org>
Changed-By: David B. Harris <dbharris@debian.org>
Description: 
 libasound2 - Advanced Linux Sound Architecture (libraries)
 libasound2-dev - Advanced Linux Sound Architecture (development)
 libasound2-doc - Advanced Linux Sound Architecture (developer's documentation)
 libasound2-plugins - Advanced Linux Sound Architecture (additional plugins)
Closes: 236294 236394 238212
Changes: 
 alsa-lib (1.0.3b-1) unstable; urgency=medium
 .
   * New upstream release
     + Various and sundry dmix problems fixed (Closes: #236394)
     + snd_pcm_mmap_commit fixed (Closes: #238212)
     + Urgency set to 'medium' as these bugs caused problems for a lot of
       people.
   * Don't distribute ancient and non-updated changelog.gz (Closes: #236294)
Files: 
 95856208d1372c6d6f3ee5b3f0e7893b 1179 libs optional alsa-lib_1.0.3b-1.dsc
 4b69544480f0f15a06e10881c49472f5 789254 libs optional alsa-lib_1.0.3b.orig.tar.gz
 257310b990412cf7297c1b163f997dd1 8664 libs optional alsa-lib_1.0.3b-1.diff.gz
 d225dc67358085a96e10eff8c7129bf9 292530 libs optional libasound2_1.0.3b-1_i386.deb
 e9e7ffc38fd67d130be63f8950273ed9 419810 libdevel optional libasound2-dev_1.0.3b-1_i386.deb
 c645701d27ed9c0d73a2c18c11593689 15558 libs optional libasound2-plugins_1.0.3b-1_i386.deb
 0c4708dbec29cd45e92f7a37fb66e043 367798 libdevel optional libasound2-doc_1.0.3b-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iQEVAwUBQFiSZGdoLXfrvKobAQLlSQgAw9e54jJ43Hf9FP5B82owf8CRzPylhEgl
M22KiUYLCOiAZwMXtwhuOqx2NKsFeXXNN1A5dOZxN6YFi7H5aXEFd7oUll8MIS4e
BvqCmhbOIqaezHDPEwsZ7Q9n288chxrlAUUpKVBnuiyaTvnfmsIQOTyTMJvn9QaG
cz4kMcJrdz5ADiWtqgWeKApJ2YX6OVuiptVJokc9Vx4cl1jFnAwFMOiNuM0V6uX/
lD7UpbBfTSlEjSITKaZGADcJzRvorPMOCLgD1uZK/RiBRy2q57tK1saSynnt0o/q
x9kxtWiBGN0PuMpve20eaJqSZ8C82ieQAOpwYuZFRP2bLwXCxIi+6A==
=7Tlz
-----END PGP SIGNATURE-----