From owner-svn-ports-head@freebsd.org Tue Aug 11 11:14:59 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6099C3AB001; Tue, 11 Aug 2020 11:14:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BQqxH1kxSz4NYJ; Tue, 11 Aug 2020 11:14:59 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B8FA1A359; Tue, 11 Aug 2020 11:14:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07BBEwhY010216; Tue, 11 Aug 2020 11:14:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07BBEwCr010213; Tue, 11 Aug 2020 11:14:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008111114.07BBEwCr010213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 11 Aug 2020 11:14:58 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r544681 - in head/audio/virtual_oss: . files X-SVN-Group: ports-head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/audio/virtual_oss: . files X-SVN-Commit-Revision: 544681 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2020 11:14:59 -0000 Author: hselasky Date: Tue Aug 11 11:14:58 2020 New Revision: 544681 URL: https://svnweb.freebsd.org/changeset/ports/544681 Log: Update virtual_oss to 1.2.6 - Added support for configurable main output and recording level compressor. - Added support for simple HTTP streaming frontend. - Added system startup rc.d script. - Fixed a jitter bug. - Updated documentation. Approved by: pi (implicit) Added: head/audio/virtual_oss/files/ head/audio/virtual_oss/files/virtual_oss.in (contents, props changed) Modified: head/audio/virtual_oss/Makefile head/audio/virtual_oss/distinfo Modified: head/audio/virtual_oss/Makefile ============================================================================== --- head/audio/virtual_oss/Makefile Tue Aug 11 11:11:27 2020 (r544680) +++ head/audio/virtual_oss/Makefile Tue Aug 11 11:14:58 2020 (r544681) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= virtual_oss -PORTVERSION= 1.2.5 +PORTVERSION= 1.2.6 CATEGORIES= audio MASTER_SITES= http://www.selasky.org/hans_petter/distfiles/ \ http://home.selasky.org/distfiles/ @@ -15,8 +15,9 @@ LICENSE= BSD2CLAUSE LIB_DEPENDS= libsamplerate.so:audio/libsamplerate USES= tar:bzip2 uidfix +USE_RC_SUBR= virtual_oss -OPTIONS_DEFINE= BLUETOOTH BT_SPEAKER DEBUG EQUALIZER +OPTIONS_DEFINE= BLUETOOTH BT_SPEAKER DEBUG EQUALIZER HTTPD OPTIONS_DEFAULT=BLUETOOTH EQUALIZER MAKE_ARGS= HAVE_CUSE="YES" @@ -36,6 +37,9 @@ EQUALIZER_MAKE_ARGS= HAVE_EQUALIZER="YES" EQUALIZER_LIB_DEPENDS= libfftw3.so:math/fftw3 EQUALIZER_PLIST_FILES= sbin/virtual_equalizer \ man/man8/virtual_equalizer.8.gz + +HTTPD_DESC= Build with HTTP server support +HTTPD_MAKE_ARGS= HAVE_HTTPD="YES" PLIST_FILES= sbin/virtual_oss \ man/man8/virtual_oss.8.gz Modified: head/audio/virtual_oss/distinfo ============================================================================== --- head/audio/virtual_oss/distinfo Tue Aug 11 11:11:27 2020 (r544680) +++ head/audio/virtual_oss/distinfo Tue Aug 11 11:14:58 2020 (r544681) @@ -1,3 +1,3 @@ -TIMESTAMP = 1583245310 -SHA256 (virtual_oss-1.2.5.tar.bz2) = a6e1b66df121f4684113f9c9d560dc6faf8d1f793cd2098644f1a2b4f516fba9 -SIZE (virtual_oss-1.2.5.tar.bz2) = 46118 +TIMESTAMP = 1597143009 +SHA256 (virtual_oss-1.2.6.tar.bz2) = c17d28bf7abaecd9b190146f946bfdd9445baf064277db6c9acbded0bdc22ce2 +SIZE (virtual_oss-1.2.6.tar.bz2) = 53212 Added: head/audio/virtual_oss/files/virtual_oss.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/audio/virtual_oss/files/virtual_oss.in Tue Aug 11 11:14:58 2020 (r544681) @@ -0,0 +1,122 @@ +#!/bin/sh +# $FreeBSD$ +# +# PROVIDE: virtual_oss +# BEFORE: LOGIN sndiod +# KEYWORD: shutdown + +# +# Add the following lines to /etc/rc.conf.local, /etc/rc.conf or +# /etc/rc.conf.d/virtual_oss to enable this service: +# +# virtual_oss_enable (bool): Set to NO by default. +# Set it to "YES" to enable virtual_oss. +# virtual_oss_configs (string): List of configurations to use +# Default is "dsp" +# virtual_oss_dsp (string): Arguments passed to virtual_oss config named dsp +# Default is +# -T /dev/sndstat # register vdsp in sndstat +# -C 2 -c 2 # use two channels +# -S # resample if needed +# -i 8 # real-time priority +# -r 48000 # sample rate +# -b 24 # bit depth +# -s 1024 # buffer (can be 5.2ms) +# -f /dev/dsp0 # hardware device to use +# -d dsp # vdev to create +# -t dsp.ctl # control device + +. /etc/rc.subr + +name=virtual_oss +desc="Virtual OSS device manager" +rcvar=${name}_enable +start_precmd="${name}_precmd" +start_cmd="${name}_start" +stop_cmd="${name}_stop" +# required_modules="cuse" +virtual_oss_default_args="\ + -T /dev/sndstat \ + -S \ + -i 8 \ + -C 2 -c 2 \ + -r 48000 \ + -b 24 \ + -s 1024 \ + -f /dev/dsp0 \ + -c 2 \ + -d dsp \ + -t dsp.ctl" +configs= + +load_rc_config $name + +: ${virtual_oss_enable:="NO"} +: ${virtual_oss_configs:="dsp"} +: ${virtual_oss_dsp:="$virtual_oss_default_args"} +: ${virtual_oss_delay:=1} + +command="%%PREFIX%%/sbin/${name}" +command_args="-B" + +pidpath="/var/run/${name}" + +virtual_oss_precmd() +{ + /usr/bin/install -d -m 0755 -o root ${pidpath} +} + +start_instance() +{ + config=$* + instance_args=$(eval "echo \$virtual_oss_${config}") + if [ -z "${instance_args}" ]; then + echo "No such config ${config}" + else + echo -n "Starting Virtual OSS config ${config} ..." + ${command} \ + ${command_args} \ + -D ${pidpath}/${config}.pid \ + ${instance_args} + echo " done" + fi +} + +stop_instance() +{ + config=$* + instance_args=`eval "echo \$virtual_oss_${config}"` + if [ -z "${instance_args}" ]; then + echo "No such config ${config}" + elif [ -e "${pidpath}/${config}.pid" ]; then + pid=`check_pidfile ${pidpath}/${config}.pid ${command}` + if [ ! -z "${pid}" ]; then + echo -n "Stopping Virtual OSS config ${config} ... " + kill $pid + rm -f ${pidpath}/${config}.pid + echo "done" + fi + fi +} + +virtual_oss_start() +{ + configs=$* + [ -z "${configs}" ] && configs="${virtual_oss_configs}" + for config in ${configs}; do + start_instance $config + sleep ${virtual_oss_delay} + done +} + +virtual_oss_stop() +{ + configs=$* + [ -z "${configs}" ] && configs="${virtual_oss_configs}" + for config in ${configs}; do + stop_instance ${config} + sleep ${virtual_oss_delay} + done +} + +run_rc_command $*