From owner-svn-ports-all@freebsd.org Fri Nov 11 05:19:21 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C342C3A37A; Fri, 11 Nov 2016 05:19:21 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EE77C79; Fri, 11 Nov 2016 05:19:21 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAB5JK7o034621; Fri, 11 Nov 2016 05:19:20 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAB5JKJW034618; Fri, 11 Nov 2016 05:19:20 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201611110519.uAB5JKJW034618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Fri, 11 Nov 2016 05:19:20 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r425860 - in branches/2016Q4/audio/pulseaudio: . files X-SVN-Group: ports-branches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 05:19:21 -0000 Author: jbeich Date: Fri Nov 11 05:19:19 2016 New Revision: 425860 URL: https://svnweb.freebsd.org/changeset/ports/425860 Log: MFH: r425809 r425812 audio/pulseaudio: respect hw.snd.default_unit PR: 211684 Submitted by: lightside Reviewed by: Tobias Kortkamp Approved by: maintainer timeout (3 months) Approved by: ports-secteam (junovitch) Modified: branches/2016Q4/audio/pulseaudio/Makefile branches/2016Q4/audio/pulseaudio/files/patch-src_modules_module-detect.c branches/2016Q4/audio/pulseaudio/files/pkg-message.in Directory Properties: branches/2016Q4/ (props changed) Modified: branches/2016Q4/audio/pulseaudio/Makefile ============================================================================== --- branches/2016Q4/audio/pulseaudio/Makefile Fri Nov 11 03:42:50 2016 (r425859) +++ branches/2016Q4/audio/pulseaudio/Makefile Fri Nov 11 05:19:19 2016 (r425860) @@ -6,6 +6,7 @@ PORTNAME= pulseaudio PORTVERSION= 8.0 +PORTREVISION= 2 CATEGORIES= audio MASTER_SITES= http://freedesktop.org/software/pulseaudio/releases/ Modified: branches/2016Q4/audio/pulseaudio/files/patch-src_modules_module-detect.c ============================================================================== --- branches/2016Q4/audio/pulseaudio/files/patch-src_modules_module-detect.c Fri Nov 11 03:42:50 2016 (r425859) +++ branches/2016Q4/audio/pulseaudio/files/patch-src_modules_module-detect.c Fri Nov 11 05:19:19 2016 (r425860) @@ -10,13 +10,52 @@ static const char* const valid_modargs[] = { "just-one", -@@ -157,8 +159,7 @@ static int detect_oss(pa_core *c, int ju +@@ -157,11 +159,45 @@ static int detect_oss(pa_core *c, int ju continue; } else if (sscanf(line, "pcm%u: ", &device) == 1) { - /* FreeBSD support, the devices are named /dev/dsp0.0, dsp0.1 and so on */ - pa_snprintf(args, sizeof(args), "device=/dev/dsp%u.0", device); + pa_snprintf(args, sizeof(args), "device=/dev/dsp%u", device); ++ pa_module *m = pa_module_load(c, "module-oss", args); - if (!pa_module_load(c, "module-oss", args)) +- if (!pa_module_load(c, "module-oss", args)) ++ if (!m) ++ continue; ++ ++ if (!pa_endswith(line, "default")) continue; ++ ++ const char *p = strrchr(line, '('); ++ ++ if (!p) ++ continue; ++ ++ if (!c->default_sink && (strstr(p, "play") || (strstr(p, "p:") && !strstr(p, "(0p:")))) { ++ uint32_t idx = PA_IDXSET_INVALID; ++ pa_sink *s; ++ PA_IDXSET_FOREACH(s, c->sinks, idx) { ++ if (s->module == m) { ++ if (!pa_namereg_set_default_sink(c, s)) ++ pa_log_error("failed to set default sink for device: /dev/dsp%u", device); ++ ++ break; ++ } ++ } ++ } ++ ++ if (!c->default_source && (strstr(p, "rec") || (strstr(p, "r:") && !strstr(p, "/0r:")))) { ++ uint32_t idx = PA_IDXSET_INVALID; ++ pa_source *s; ++ PA_IDXSET_FOREACH(s, c->sources, idx) { ++ if (s->module == m) { ++ if (!pa_namereg_set_default_source(c, s)) ++ pa_log_error("failed to set default source for device: /dev/dsp%u", device); ++ ++ break; ++ } ++ } ++ } + } + + n++; Modified: branches/2016Q4/audio/pulseaudio/files/pkg-message.in ============================================================================== --- branches/2016Q4/audio/pulseaudio/files/pkg-message.in Fri Nov 11 03:42:50 2016 (r425859) +++ branches/2016Q4/audio/pulseaudio/files/pkg-message.in Fri Nov 11 05:19:19 2016 (r425860) @@ -1,8 +1,10 @@ +Pulseaudio tries to determine default values for FreeBSD OSS driver at first +start, based on /dev/sndstat output. The hw.snd.default_unit sysctl may affect +these values, but restart of the Pulseaudio might be needed to rescan it again, +e.g. `pacmd exit`. -Pulseaudio doesn't know about the hw.snd.default_unit=3 sysctl for the -FreeBSD OSS driver that is used to select the active input/output. So -for Pulseaudio we also need to tell it which input/output to use. The -difference is that Pulseaudio has separate input and output configure lines. +Pulseaudio has separate input and output configure lines. You can change them +with using following commands: To change the default sink (output): # pacmd set-default-sink 3 @@ -11,7 +13,7 @@ To change the default source (input): This can also be set in %%PREFIX%%/etc/pulse/default.pa -Replace the number '3' with the new default your want to set. +Replace the number '3' with the new default you want to set. The audio/freedesktop-sound-theme is needed if the default sound files