From nobody@FreeBSD.org  Wed Aug  7 08:09:47 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id A3229CAC
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  7 Aug 2013 08:09:47 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 77110224C
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  7 Aug 2013 08:09:47 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r7789kfR059373
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 7 Aug 2013 08:09:46 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r7789k6j059369;
	Wed, 7 Aug 2013 08:09:46 GMT
	(envelope-from nobody)
Message-Id: <201308070809.r7789k6j059369@oldred.freebsd.org>
Date: Wed, 7 Aug 2013 08:09:46 GMT
From: Natacha Port <natbsd@instinctive.eu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: audio/mumble: dubious patch to allow OSS device selection
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: marius@nuenneri.ch

>Number:         181104
>Category:       ports
>Synopsis:       audio/mumble: dubious patch to allow OSS device selection
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    feld
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 07 08:10:00 UTC 2013
>Closed-Date:    Sun Nov 17 23:09:22 UTC 2013
>Last-Modified:  Sun Nov 17 23:10:00 UTC 2013
>Originator:     Natacha Port
>Release:        9.1
>Organization:
>Environment:
FreeBSD yulai 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
Mumble OSS implementation performs device enumeration only when SOUND_VERSION is at least 0x040002, but OSS in FreeBSD base defines it as 0x040000. So only default input and output devices are available.

However, the actual code seems to be almost adequate for device enumeration in FreeBSD, the only caveat being that oss_audioinfo::handle is empty, but oss_audioinfo::name is a good enough unique identifier.

The attached patch removes SOUND_VERSION test and uses oss_audioinfo::name instead of oss_audioinfo::handle. I have been using it for about 1.5 years now, first on 8.2-RELEASE then on 9.1-RELEASE, both on amd64, without noticing any side-effect. However I don't know whether it's portable enough and/or clean enough to make it to the ports tree.
>How-To-Repeat:
 - Start mumble
 - Select preferences or audio wizard
    -> notice that input or output device selection is grayed out, leaving you no option other than "Default OSS device"
>Fix:
Copy the attached patch as audio/mumble/files/patch-src-mumble-OSS.cpp

Patch attached with submission follows:

--- src/mumble/OSS.cpp.orig	2013-08-03 14:01:25.000000000 +0200
+++ src/mumble/OSS.cpp	2013-08-03 14:12:51.000000000 +0200
@@ -153,7 +153,6 @@
 	qhOutput.insert(QString(), QLatin1String("Default OSS Device"));
 	qhDevices.insert(QString(), QLatin1String("/dev/dsp"));
 
-#if (SOUND_VERSION >= 0x040002)
 	int mixerfd = open("/dev/mixer", O_RDWR, 0);
 	if (mixerfd == -1) {
 		qWarning("OSSEnumerator: Failed to open /dev/mixer");
@@ -182,15 +181,14 @@
 		if (ainfo.caps & PCM_CAP_HIDDEN)
 			continue;
 
-		qhDevices.insert(handle, device);
+		qhDevices.insert(name, device);
 
 		if (ainfo.caps & PCM_CAP_INPUT)
-			qhInput.insert(handle, name);
+			qhInput.insert(name, name);
 		if (ainfo.caps & PCM_CAP_OUTPUT)
-			qhOutput.insert(handle, name);
+			qhOutput.insert(name, name);
 	}
 	close(mixerfd);
-#endif
 }
 
 OSSInput::OSSInput() {


>Release-Note:
>Audit-Trail:

From: Natacha =?iso-8859-1?Q?Port=E9?= <natbsd@instinctive.eu>
To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org
Cc:  
Subject: Re: misc/181104: audio/mumble: dubious patch to allow OSS device
 selection
Date: Wed, 7 Aug 2013 10:43:09 +0200

 Hello,
 
 on Wednesday 07 August 2013 at 08:10, FreeBSD-gnats-submit@FreeBSD.org wrote:
 > >Category:       misc
 
 The category is actually ports, I must have misclicked on the combobox.
 Sorry for the inconvenience /o\
Responsible-Changed-From-To: freebsd-bugs->freebsd-ports-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Aug 9 00:09:16 UTC 2013 
Responsible-Changed-Why:  
ports PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=181104 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Fri Aug 9 00:09:32 UTC 2013 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

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

From: Edwin Groothuis <edwin@FreeBSD.org>
To: marius@nuenneri.ch
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/181104: audio/mumble: dubious patch to allow OSS device selection
Date: Fri, 9 Aug 2013 00:09:32 UT

 Maintainer of audio/mumble,
 
 Please note that PR ports/181104 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/181104
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org
Responsible-Changed-From-To: freebsd-ports-bugs->feld 
Responsible-Changed-By: feld 
Responsible-Changed-When: Wed Oct 30 15:03:13 UTC 2013 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=181104 
State-Changed-From-To: feedback->closed 
State-Changed-By: feld 
State-Changed-When: Sun Nov 17 23:09:20 UTC 2013 
State-Changed-Why:  
Committed. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/181104: commit references a PR
Date: Sun, 17 Nov 2013 23:07:10 +0000 (UTC)

 Author: feld
 Date: Sun Nov 17 23:07:02 2013
 New Revision: 334131
 URL: http://svnweb.freebsd.org/changeset/ports/334131
 
 Log:
   Take maintainership
   Add patch that allows audio device selection with FreeBSD's OSS
   
   PR:		ports/181104
   Submitted by:	Natacha Porte
   Approved by:	swills (mentor)
 
 Added:
   head/audio/mumble/files/patch-src-mumble-OSS.cpp   (contents, props changed)
 Modified:
   head/audio/mumble/Makefile
 
 Modified: head/audio/mumble/Makefile
 ==============================================================================
 --- head/audio/mumble/Makefile	Sun Nov 17 22:16:16 2013	(r334130)
 +++ head/audio/mumble/Makefile	Sun Nov 17 23:07:02 2013	(r334131)
 @@ -3,11 +3,11 @@
  
  PORTNAME=	mumble
  PORTVERSION=	1.2.4
 -PORTREVISION=	3
 +PORTREVISION=	4
  CATEGORIES=	audio
  MASTER_SITES=	SF/${PORTNAME}/Mumble/${PORTVERSION}
  
 -MAINTAINER=	ports@FreeBSD.org
 +MAINTAINER=	feld@FreeBSD.org
  COMMENT=	A voice chat software primarily intended for use while gaming
  
  LIB_DEPENDS+=	libspeex.so:${PORTSDIR}/audio/speex \
 
 Added: head/audio/mumble/files/patch-src-mumble-OSS.cpp
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/audio/mumble/files/patch-src-mumble-OSS.cpp	Sun Nov 17 23:07:02 2013	(r334131)
 @@ -0,0 +1,30 @@
 +--- src/mumble/OSS.cpp.orig	2013-08-03 14:01:25.000000000 +0200
 ++++ src/mumble/OSS.cpp	2013-08-03 14:12:51.000000000 +0200
 +@@ -153,7 +153,6 @@
 + 	qhOutput.insert(QString(), QLatin1String("Default OSS Device"));
 + 	qhDevices.insert(QString(), QLatin1String("/dev/dsp"));
 + 
 +-#if (SOUND_VERSION >= 0x040002)
 + 	int mixerfd = open("/dev/mixer", O_RDWR, 0);
 + 	if (mixerfd == -1) {
 + 		qWarning("OSSEnumerator: Failed to open /dev/mixer");
 +@@ -182,15 +181,14 @@
 + 		if (ainfo.caps & PCM_CAP_HIDDEN)
 + 			continue;
 + 
 +-		qhDevices.insert(handle, device);
 ++		qhDevices.insert(name, device);
 + 
 + 		if (ainfo.caps & PCM_CAP_INPUT)
 +-			qhInput.insert(handle, name);
 ++			qhInput.insert(name, name);
 + 		if (ainfo.caps & PCM_CAP_OUTPUT)
 +-			qhOutput.insert(handle, name);
 ++			qhOutput.insert(name, name);
 + 	}
 + 	close(mixerfd);
 +-#endif
 + }
 + 
 + OSSInput::OSSInput() {
 +
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
