1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00

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)
This commit is contained in:
Hans Petter Selasky 2020-08-11 11:14:58 +00:00
parent 1d21db50cb
commit 87b6d70bf2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=544681
3 changed files with 131 additions and 5 deletions

View File

@ -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"
@ -37,6 +38,9 @@ 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

View File

@ -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

View File

@ -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 $*