From steve@energistic.com  Tue Apr  8 18:37:21 2008
Return-Path: <steve@energistic.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 38AA8106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  8 Apr 2008 18:37:21 +0000 (UTC)
	(envelope-from steve@energistic.com)
Received: from energistic.com (mail.energistic.com [216.54.148.60])
	by mx1.freebsd.org (Postfix) with ESMTP id F0E9F8FC0A
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  8 Apr 2008 18:37:20 +0000 (UTC)
	(envelope-from steve@energistic.com)
Received: from energistic.com (localhost [127.0.0.1])
	by energistic.com (8.14.2/8.14.2) with ESMTP id m38I7QjN004178
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 8 Apr 2008 14:07:27 -0400 (EDT)
	(envelope-from steve@energistic.com)
Received: (from steve@localhost)
	by energistic.com (8.14.2/8.14.2/Submit) id m38I7Qn0001486;
	Tue, 8 Apr 2008 14:07:26 -0400 (EDT)
	(envelope-from steve)
Message-Id: <200804081807.m38I7Qn0001486@energistic.com>
Date: Tue, 8 Apr 2008 14:07:26 -0400 (EDT)
From: Steve Ames <steve@energistic.com>
Reply-To: Steve Ames <steve@energistic.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: fix pwlib to allow multiple apps to access sound in parallel
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         122584
>Category:       ports
>Synopsis:       fix devel/pwlib to allow multiple apps to access sound in parallel
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rafan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 08 18:40:04 UTC 2008
>Closed-Date:    Sun Jan 04 08:37:14 UTC 2009
>Last-Modified:  Sun Jan 04 08:37:14 UTC 2009
>Originator:     Steve Ames
>Release:        FreeBSD 7.0-STABLE i386
>Organization:
>Environment:
System: FreeBSD energistic.com 7.0-STABLE FreeBSD 7.0-STABLE #106: Mon Mar 24 15:55:01 EDT 2008 steve@energistic.com:/usr/obj/usr/src/sys/VV i386


	
>Description:
	This patch allows Ekiga and KDE apps use sound in parallel without conflict.
>How-To-Repeat:
	Per the submitter (Matthias Apitz (matthias.apitz AT oclc.org)):

	The art of pick-up the filename of the audio device conflicts with other
	applications of the desktop using the (virtual) audio channels; the
	filename should just be "/dev/dsp0" for FreeBSD and the rest is handled
	via the devfs(5) file system; a patch like the below works for me fine
	and Ekiga plays sound parallel to the apps of KDE.

	This change has already been imported into the pwlib codebase.

>Fix:

	Apply following patch:

	http://steve.energistic.com/h323-ports/pwlib-1.12.0.2.patch


diff -ruN pwlib.old/Makefile pwlib/Makefile
--- pwlib.old/Makefile	2008-03-13 10:27:16.000000000 -0400
+++ pwlib/Makefile	2008-04-08 14:00:36.000000000 -0400
@@ -7,7 +7,7 @@
 
 PORTNAME=	pwlib
 PORTVERSION=	1.12.0
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	1
 CATEGORIES=	devel
 MASTER_SITES=    ${MASTER_SITE_SOURCEFORGE}
diff -ruN pwlib.old/files/patch-plugins-sound_oss-sound_oss_cxx pwlib/files/patch-plugins-sound_oss-sound_oss_cxx
--- pwlib.old/files/patch-plugins-sound_oss-sound_oss_cxx	2008-03-01 02:24:51.000000000 -0500
+++ pwlib/files/patch-plugins-sound_oss-sound_oss_cxx	2008-04-08 13:59:40.000000000 -0400
@@ -1,6 +1,22 @@
---- plugins/sound_oss/sound_oss.cxx.orig	2007-10-19 02:22:33.000000000 -0400
-+++ plugins/sound_oss/sound_oss.cxx	2007-12-30 20:46:38.000000000 -0500
-@@ -643,6 +643,7 @@
+--- plugins/sound_oss/sound_oss.orig	2008-04-08 13:54:44.000000000 -0400
++++ plugins/sound_oss/sound_oss.cxx	2008-04-08 13:57:40.000000000 -0400
+@@ -399,6 +399,15 @@
+             PINDEX cardnum = numbers.AsInteger(); //dspN.M is truncated to dspN.
+             // If we have not yet inserted something for this cardnum, insert it
+             if (dsp.GetAt(cardnum+1) == NULL) {
++#if defined P_FREEBSD
++		// in FreeBSD the file name should be used via the devfs(5) and
++		// is just "/dev/dsp0" and devfs(5) takes care of virtual channels,
++		// like /dev/dsp0.0 /dev/dsp0.1 ...
++		// everything else would conflict with other KDE apps using the
++		// audio
++		devname = devdir + "dsp0";
++		PTRACE(1, "OSS\tCollectSoundDevices FreeBSD devname set to devfs(5) name:" << devname );
++ #endif
+               dsp.SetAt(cardnum+1, devname);
+             }
+           }
+@@ -643,6 +652,7 @@
          arg = val = (entry.numChannels == 2) ? 1 : 0;
          if (ConvertOSError(::ioctl(os_handle, SNDCTL_DSP_STEREO, &arg)) || (arg != val)) {
  







>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-ports-bugs 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Apr 8 20:40:45 UTC 2008 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=122584 
Responsible-Changed-From-To: freebsd-ports-bugs->rafan 
Responsible-Changed-By: rafan 
Responsible-Changed-When: Sun Apr 13 09:16:42 UTC 2008 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122584 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/122584: commit references a PR
Date: Sun, 13 Apr 2008 12:44:09 +0000 (UTC)

 rafan       2008-04-13 12:43:55 UTC
 
   FreeBSD ports repository
 
   Modified files:
     devel/pwlib          Makefile 
     devel/pwlib/files    patch-plugins-sound_oss-sound_oss_cxx 
   Log:
   - Allow multiple apps to access sound device in parallel
   - Bump PORTREVISION
   
   PR:             ports/122584
   Submitted by:   Steve Ames <steve at energistic.com> (maintainer)
   
   Revision  Changes    Path
   1.46      +1 -1      ports/devel/pwlib/Makefile
   1.2       +19 -3     ports/devel/pwlib/files/patch-plugins-sound_oss-sound_oss_cxx
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: rafan 
State-Changed-When: Sun Apr 13 12:50:24 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122584 

From: "Piet Delport" <pjdelport@gmail.com>
To: bug-followup@FreeBSD.org, steve@energistic.com
Cc:  
Subject: Re: ports/122584: fix devel/pwlib to allow multiple apps to access sound in parallel
Date: Fri, 20 Jun 2008 18:24:28 +0200

 Note:  This patch breaks the use of more than one audio device, by
 hardcoding the devname to "dsp0".
 
 I use Ekiga with input from dsp0 and output to dsp1, and have to
 recompile without this patch to avoid everything going to dsp0.
State-Changed-From-To: closed->open 
State-Changed-By: rafan 
State-Changed-When: Sat Jun 21 07:01:52 UTC 2008 
State-Changed-Why:  
reopen it. From sound(4) it seems that we should just use 'dsp' instead of 
'dsp0' when using devfs. Can anyone please test this? Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122584 

From: "Piet Delport" <pjdelport@gmail.com>
To: "Steve Ames" <steve@energistic.com>
Cc: bug-followup@freebsd.org
Subject: Re: ports/122584: fix devel/pwlib to allow multiple apps to access sound in parallel
Date: Tue, 24 Jun 2008 02:04:37 +0200

 On Fri, Jun 20, 2008 at 7:00 PM, Steve Ames <steve@energistic.com> wrote:
 >
 > Hrm. this patch fixes some other issues. Do you have a patch for getting
 > your situation to work that doesn't undo the results of this patch?
 
 No, but i presume the solution would be to truncate the devname, so
 that "dsp0.0" -> "dsp0", "dsp1.0" -> "dsp1", and so on?
State-Changed-From-To: open->feedback 
State-Changed-By: rafan 
State-Changed-When: Fri Jul 18 14:35:08 UTC 2008 
State-Changed-Why:  
Can someone please test if  

http://people.freebsd.org/~rafan/pwlib.diff 

works or not? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122584 
State-Changed-From-To: feedback->suspended 
State-Changed-By: rafan 
State-Changed-When: Sat Aug 9 12:55:10 UTC 2008 
State-Changed-Why:  
unless someone can test the patch, not much I can do here. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122584 
State-Changed-From-To: suspended->closed 
State-Changed-By: rafan 
State-Changed-When: Sun Jan 4 08:37:13 UTC 2009 
State-Changed-Why:  
Close this PR per last comment. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122584 
>Unformatted:
