debian/0000755000000000000000000000000012225552766007202 5ustar debian/copyright0000644000000000000000000000402112225552766011132 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: osspd Source: http://sourceforge.net/projects/osspd/ Files: * Copyright: 2008-2010 SUSE Linux Products GmbH 2008-2010 Tejun Heo 2009 Maarten Lankhorst License: GPL-2 Files: debian/* Copyright: 2012-2013 Ralf Jung License: GPL-2+ Files: debian/osspd.service Copyright: 2013 Jan Alexander Steffens (heftig) 2013 Ralf Jung License: GPL-2 License: GPL-2 This package is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". debian/watch0000644000000000000000000000006112225552766010230 0ustar version=3 http://sf.net/osspd/ossp-(.+)\.tar\.gz debian/osspd-pulseaudio.prerm0000644000000000000000000000021312225552766013545 0ustar #!/bin/sh set -e if [ "$1" = "remove" ]; then update-alternatives --remove ossp-slave /usr/lib/osspd/ossp-padsp fi #DEBHELPER# exit 0 debian/osspd-alsa.postinst0000644000000000000000000000021712225552766013055 0ustar #!/bin/sh set -e update-alternatives --install /usr/lib/osspd/ossp-slave \ ossp-slave /usr/lib/osspd/ossp-alsap 60 #DEBHELPER# exit 0 debian/osspd-alsa.install0000644000000000000000000000003112225552766012632 0ustar usr/lib/osspd/ossp-alsap debian/osspd.modprobe0000644000000000000000000000010412225552766012056 0ustar blacklist snd-pcm-oss blacklist snd-mixer-oss blacklist snd-seq-oss debian/osspd-pulseaudio.postinst0000644000000000000000000000021712225552766014307 0ustar #!/bin/sh set -e update-alternatives --install /usr/lib/osspd/ossp-slave \ ossp-slave /usr/lib/osspd/ossp-padsp 70 #DEBHELPER# exit 0 debian/osspd.init0000644000000000000000000000473212225552766011225 0ustar #! /bin/sh ### BEGIN INIT INFO # Provides: osspd # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: OSS Proxy Daemon: Userland OSS emulation # Description: Daemon providing a userland implementation of OSS devices. # Currently it supports forwarding OSS sound streams to # PulseAudio and ALSA. ### END INIT INFO # Author: Ralf Jung PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="OSS Proxy Daemon" NAME=osspd DAEMON=/usr/sbin/$NAME DAEMON_ARGS="--dsp-slave=/usr/lib/osspd/ossp-slave" PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # Define LSB log_* functions. . /lib/lsb/init-functions # # Function that starts the daemon/service # do_start() { modprobe cuse # make sure the cuse module is loaded # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile --exec $DAEMON --test > /dev/null \ || return 1 # -f: run in foreground, start-stop-daemon does the forking - this is required to let start-stop-daemon handle the pidfile start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile --exec $DAEMON -- -f \ $DAEMON_ARGS \ || return 2 } # # Function that stops the daemon/service # do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME return "$?" } case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) log_end_msg 0 ;; 2) log_end_msg 1 ;; esac ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) log_end_msg 0 ;; 2) log_end_msg 1 ;; esac ;; status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; restart|force-reload) log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 exit 3 ;; esac : debian/osspd.service0000644000000000000000000000027112225552766011714 0ustar [Unit] Description=OSS Proxy Daemon [Service] ExecStartPre=/sbin/modprobe cuse ExecStart=/usr/sbin/osspd -f --dsp-slave=/usr/lib/osspd/ossp-slave [Install] WantedBy=multi-user.target debian/osspd-alsa.prerm0000644000000000000000000000021312225552766012313 0ustar #!/bin/sh set -e if [ "$1" = "remove" ]; then update-alternatives --remove ossp-slave /usr/lib/osspd/ossp-alsap fi #DEBHELPER# exit 0 debian/osspd.docs0000644000000000000000000000000712225552766011201 0ustar README debian/patches/0000755000000000000000000000000012225552766010631 5ustar debian/patches/0005-Add-pthread-compiler-and-linker-flag.patch0000644000000000000000000000142712225552766021116 0ustar From: Ralf Jung Date: Sat, 11 May 2013 14:24:17 +0200 Subject: Add -pthread compiler and linker flag (based on patch in Ubuntu by Logan Rosen ) Forwarded: http://sourceforge.net/mailarchive/forum.php?thread_name=518E3901.8050206%40ralfj.de&forum_name=osspd-users --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 236176e..11f2836 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,9 @@ # DESTDIR is completely respected CC := gcc AR := ar -CFLAGS := -Wall $(CFLAGS) $(CPPFLAGS) +CFLAGS := -Wall -pthread $(CFLAGS) $(CPPFLAGS) XLDFLAGS := $(LDFLAGS) -LDFLAGS := -L. -lossp $(LDFLAGS) +LDFLAGS := -L. -lossp -pthread $(LDFLAGS) prefix := /usr/local DESTDIR := UDEVDIR := /etc/udev/rules.d debian/patches/0002-honor-CPPFLAGS.patch0000644000000000000000000000101012225552766014543 0ustar From: Ralf Jung Date: Sat, 15 Sep 2012 13:36:23 +0200 Subject: honor CPPFLAGS Forwarded: Committed upstream as 3a9a0196 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8111c9b..8d8fe87 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # DESTDIR is completely respected CC := gcc AR := ar -CFLAGS := -Wall $(CFLAGS) +CFLAGS := -Wall $(CFLAGS) $(CPPFLAGS) XLDFLAGS := $(LDFLAGS) LDFLAGS := -L. -lossp $(LDFLAGS) prefix := /usr/local debian/patches/0001-Fix-compilation-with-Werror-format-security.patch0000644000000000000000000000206412225552766022656 0ustar From: Ralf Jung Date: Sat, 15 Sep 2012 13:36:06 +0200 Subject: Fix compilation with -Werror=format-security Forwarded: Committed upstream as 097dc7b6 --- ossp-slave.c | 4 ++-- osspd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ossp-slave.c b/ossp-slave.c index 4c5cb2d..a290636 100644 --- a/ossp-slave.c +++ b/ossp-slave.c @@ -89,7 +89,7 @@ void ossp_slave_init(int argc, char **argv) } if (!have_uid || !have_gid || ossp_cmd_fd < 0 || ossp_notify_fd < 0) { - fprintf(stderr, usage); + fputs(usage, stderr); _exit(1); } @@ -105,7 +105,7 @@ void ossp_slave_init(int argc, char **argv) void *p; if (!mmap_off || !mmap_size) { - fprintf(stderr, usage); + fputs(usage, stderr); _exit(1); } diff --git a/osspd.c b/osspd.c index 37c9b35..1dbe586 100644 --- a/osspd.c +++ b/osspd.c @@ -2109,7 +2109,7 @@ static int process_arg(void *data, const char *arg, int key, switch (key) { case 0: - fprintf(stderr, usage); + fputs(usage, stderr); param->help = 1; return 0; case 1: debian/patches/0003-PA-recommends-users-not-to-be-in-the-audio-group-so-.patch0000644000000000000000000000163512225552766023741 0ustar From: Ralf Jung Date: Thu, 13 Sep 2012 19:13:25 +0200 Subject: PA recommends users *not* to be in the audio group, so allow everyone to use these devices Forwarded: not-needed --- 98-osscuse.rules | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/98-osscuse.rules b/98-osscuse.rules index c1430fd..9b40bec 100644 --- a/98-osscuse.rules +++ b/98-osscuse.rules @@ -1,7 +1,6 @@ -# Since these devices are not part of 'sound' subsystem the group is forced -# to audio by name +# Allow everyone to use these devices # /dev/cuse can stay mode 0660 root:root since osspd is run as root # and drops privileges to user level when opened by user -KERNEL=="dsp", GROUP="audio" -KERNEL=="mixer", GROUP="audio" -KERNEL=="adsp", GROUP="audio" +KERNEL=="dsp", SUBSYSTEM=="cuse", MODE="0666" +KERNEL=="mixer", SUBSYSTEM=="cuse", MODE="0666" +KERNEL=="adsp", SUBSYSTEM=="cuse", MODE="0666" debian/patches/series0000644000000000000000000000040112225552766012041 0ustar 0001-Fix-compilation-with-Werror-format-security.patch 0002-honor-CPPFLAGS.patch 0003-PA-recommends-users-not-to-be-in-the-audio-group-so-.patch 0004-Allow-to-set-slave-installation-path-during-compilat.patch 0005-Add-pthread-compiler-and-linker-flag.patch debian/patches/0004-Allow-to-set-slave-installation-path-during-compilat.patch0000644000000000000000000000622612225552766024365 0ustar From: Ralf Jung Date: Wed, 19 Sep 2012 13:12:58 +0200 Subject: Allow to set slave installation path during compilation Forwarded: not-needed --- Makefile | 8 +++++--- osspd.c | 12 ++---------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 8d8fe87..236176e 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ LDFLAGS := -L. -lossp $(LDFLAGS) prefix := /usr/local DESTDIR := UDEVDIR := /etc/udev/rules.d +SLAVESDIR := $(prefix)/sbin ifeq "$(origin OSSPD_CFLAGS)" "undefined" OSSPD_CFLAGS := $(shell pkg-config --cflags fuse) @@ -38,8 +39,9 @@ headers := ossp.h ossp-util.h ossp-slave.h all: osspd ossp-padsp ossp-alsap install: - mkdir -p $(DESTDIR)$(prefix)/sbin - install -m755 osspd ossp-padsp ossp-alsap $(DESTDIR)$(prefix)/sbin + mkdir -p $(DESTDIR)$(prefix)/sbin $(DESTDIR)$(SLAVESDIR) + install -m755 osspd $(DESTDIR)$(prefix)/sbin + install -m755 ossp-padsp ossp-alsap $(DESTDIR)$(SLAVESDIR) mkdir -p $(DESTDIR)$(UDEVDIR) install -m644 98-osscuse.rules $(DESTDIR)$(UDEVDIR) @@ -50,7 +52,7 @@ libossp.a: ossp.c ossp.h ossp-util.c ossp-util.h ossp-slave.c ossp-slave.h $(AR) rc $@ ossp.o ossp-util.o ossp-slave.o osspd: osspd.c libossp.a $(headers) - $(CC) $(CFLAGS) $(OSSPD_CFLAGS) -o $@ $< $(OSSPD_LDFLAGS) $(LDFLAGS) + $(CC) $(CFLAGS) $(OSSPD_CFLAGS) -DSLAVE_DEFAULT_PATH=\"$(SLAVESDIR)\" -o $@ $< $(OSSPD_LDFLAGS) $(LDFLAGS) ossp-padsp: ossp-padsp.c libossp.a $(headers) $(CC) $(CFLAGS) $(OSSP_PADSP_CFLAGS) -o $@ $< $(OSSP_PADSP_LDFLAGS) $(LDFLAGS) diff --git a/osspd.c b/osspd.c index 1dbe586..6b63c07 100644 --- a/osspd.c +++ b/osspd.c @@ -2005,7 +2005,7 @@ static const char *usage = " --max=MAX maximum number of open streams (default 256)\n" " --umax=MAX maximum number of open streams per UID (default --max)\n" " --exit-on-idle exit if idle\n" -" --dsp-slave=PATH DSP slave (default ossp-padsp in the same dir)\n" +" --dsp-slave=PATH DSP slave (default: " SLAVE_DEFAULT_PATH "/ossp-padsp)\n" " --log=LEVEL log level (0..6)\n" " --timestamp timestamp log messages\n" " -v increase verbosity, can be specified multiple times\n" @@ -2131,7 +2131,6 @@ int main(int argc, char **argv) .max_streams = DFL_MAX_STREAMS, }; struct fuse_args args = FUSE_ARGS_INIT(argc, argv); - char path_buf[PATH_MAX], *dir; char adsp_buf[64] = "", mixer_buf[64] = ""; struct sigaction sa; struct stat stat_buf; @@ -2175,19 +2174,12 @@ int main(int argc, char **argv) if (sigaction(SIGPIPE, &sa, NULL)) fatal_e(-errno, "failed to ignore SIGPIPE"); - /* determine slave path and check for availability */ - ret = readlink("/proc/self/exe", path_buf, PATH_MAX - 1); - if (ret < 0) - fatal_e(-errno, "failed to determine executable path"); - path_buf[ret] = '\0'; - dir = dirname(path_buf); - if (param.dsp_slave_path) { strncpy(dsp_slave_path, param.dsp_slave_path, PATH_MAX - 1); dsp_slave_path[PATH_MAX - 1] = '\0'; } else { ret = snprintf(dsp_slave_path, PATH_MAX, "%s/%s", - dir, "ossp-padsp"); + SLAVE_DEFAULT_PATH, "ossp-padsp"); if (ret >= PATH_MAX) fatal("dsp slave pathname too long"); } debian/changelog0000644000000000000000000000247012225552766011057 0ustar osspd (1.3.2-5) unstable; urgency=low * Fix systemd service file. -- Ralf Jung Thu, 10 Oct 2013 18:29:28 +0200 osspd (1.3.2-4) unstable; urgency=low * Move backends into their own packages. * Manage the ossp slave via update-alternatives. * Add a systemd service file (taken from Arch). * Add modprobe file to blacklist OSS modules - thanks, Stephen (Closes: #712705). -- Ralf Jung Thu, 26 Sep 2013 22:28:08 +0200 osspd (1.3.2-3) unstable; urgency=low * Provide oss-compat, as we provide OSS, and conflict with it since it takes the OSS major/minor numbers. * Update Standards-Version to 3.9.4. No changes needed. * Add "-pthreads" compiler and linker flag. Patch based on Ubuntu patch by Logan Rosen . * Add links to git repository. -- Ralf Jung Sat, 18 May 2013 18:18:14 +0200 osspd (1.3.2-2) unstable; urgency=low * 0004-Allow-to-set-slave-installation-path-during-compilat.patch: Removed unused variables. * Change architecture to linux-any as Hurd and FreeBSD lack epoll. * Extend package description. -- Ralf Jung Tue, 02 Oct 2012 13:26:56 +0200 osspd (1.3.2-1) unstable; urgency=low * Initial release (Closes: #687711). -- Ralf Jung Thu, 20 Sep 2012 11:07:39 +0200 debian/source/0000755000000000000000000000000012225552766010502 5ustar debian/source/format0000644000000000000000000000001412225552766011710 0ustar 3.0 (quilt) debian/control0000644000000000000000000000500412225552766010604 0ustar Source: osspd Section: sound Priority: optional Maintainer: Ralf Jung Build-Depends: debhelper (>= 9), dh-systemd, libasound2-dev, libfuse-dev, libpulse-dev Standards-Version: 3.9.4 Homepage: http://sourceforge.net/projects/osspd/ Vcs-Browser: http://www.ralfj.de/git/osspd.git Vcs-Git: git://ralfj.de/osspd.git Package: osspd Architecture: linux-any Depends: lsb-base (>= 3.2-14), osspd-pulseaudio | osspd-backend, ${misc:Depends}, ${shlibs:Depends} Provides: oss-compat Conflicts: oss-compat Description: OSS Proxy Daemon: Userland OSS emulation OSS Proxy Daemon is a Linux userland OSS sound device (/dev/[a]dsp and /dev/mixer) implementation using CUSE. Currently it supports forwarding OSS sound streams to PulseAudio and ALSA. . Actually emulating the OSS devices makes for a more robust emulation compared to OSS wrappers using LD_PRELOAD, like aoss and padsp. It also works better when running foreign-architecture applications or using old libc versions for compatibility reasons. Package: osspd-pulseaudio Architecture: linux-any Provides: osspd-backend Depends: pulseaudio, ${misc:Depends}, ${shlibs:Depends} Recommends: osspd Replaces: osspd (<< 1.3.2-4) Breaks: osspd (<< 1.3.2-4) Description: OSS Proxy Daemon: PulseAudio backend OSS Proxy Daemon is a Linux userland OSS sound device (/dev/[a]dsp and /dev/mixer) implementation using CUSE. Currently it supports forwarding OSS sound streams to PulseAudio and ALSA. . This package contains the PulseAudio backend for osspd. Package: osspd-alsa Architecture: linux-any Provides: osspd-backend Depends: ${misc:Depends}, ${shlibs:Depends} Recommends: osspd Replaces: osspd (<< 1.3.2-4) Breaks: osspd (<< 1.3.2-4) Description: OSS Proxy Daemon: ALSA backend (experimental) OSS Proxy Daemon is a Linux userland OSS sound device (/dev/[a]dsp and /dev/mixer) implementation using CUSE. Currently it supports forwarding OSS sound streams to PulseAudio and ALSA. . This package contains the experimental ALSA backend for osspd. Package: osspd-dbg Architecture: linux-any Depends: osspd (= ${binary:Version}), ${misc:Depends} Section: debug Priority: extra Description: OSS Proxy Daemon: Debugging symbols OSS Proxy Daemon is a Linux userland OSS sound device (/dev/[a]dsp and /dev/mixer) implementation using CUSE. Currently it supports forwarding OSS sound streams to PulseAudio and ALSA. . This package contains the debugging symbols for the OSS Proxy Daemon and its backends. debian/osspd.manpages0000644000000000000000000000001712225552766012045 0ustar debian/osspd.8 debian/osspd-pulseaudio.install0000644000000000000000000000003112225552766014064 0ustar usr/lib/osspd/ossp-padsp debian/compat0000644000000000000000000000000212225552766010400 0ustar 9 debian/rules0000755000000000000000000000113612225552766010263 0ustar #!/usr/bin/make -f SLAVESDIR=/usr/lib/osspd UDEVDIR=/lib/udev/rules.d %: dh $@ --parallel --with=systemd override_dh_auto_build: dh_auto_build -- SLAVESDIR=$(SLAVESDIR) UDEVDIR=$(UDEVDIR) override_dh_auto_install: dh_auto_install -- prefix=/usr SLAVESDIR=$(SLAVESDIR) UDEVDIR=$(UDEVDIR) override_dh_strip: dh_strip --dbg-package=osspd-dbg override_dh_installdocs: mkdir -p debian/osspd-dbg/usr/share/doc ln -s osspd debian/osspd-dbg/usr/share/doc/osspd-dbg dh_installdocs override_dh_install: dh_install --fail-missing # Disable tests, they require running the osspd override_dh_auto_test: debian/osspd.install0000644000000000000000000000006112225552766011717 0ustar lib/udev/rules.d/98-osscuse.rules usr/sbin/osspd debian/osspd.80000644000000000000000000000323412225552766010425 0ustar .TH OSSPD "8" "September 2012" "osspd 1.3.2" .SH NAME osspd \- OSS Proxy Daemon .SH SYNOPSIS \fBosspd\fR [\fIoptions\fR] .SH DESCRIPTION \fBosspd\fR implements the OSS devices (/dev/[a]dsp and /dev/mixer) in userland using CUSE. Sound data is forwarded to a DSP slave: Implementaions for PulseAudio and ASLA exist, but the ALSA slave should still be considered experimental. .SH OPTIONS .TP \fB\-\-dsp\fR=\fINAME\fR DSP device name (default dsp) .TP \fB\-\-dsp\-maj\fR=\fIMAJ\fR DSP device major number (default 14) .TP \fB\-\-dsp\-min\fR=\fIMIN\fR DSP device minor number (default 3) .TP \fB\-\-adsp\fR=\fINAME\fR Aux DSP device name (default adsp, blank to disable) .TP \fB\-\-adsp\-maj\fR=\fIMAJ\fR Aux DSP device major number (default 14) .TP \fB\-\-adsp\-min\fR=\fIMIN\fR Aux DSP device minor number (default 12) .TP \fB\-\-mixer\fR=\fINAME\fR mixer device name (default mixer, blank to disable) .TP \fB\-\-mixer\-maj\fR=\fIMAJ\fR mixer device major number (default 14) .TP \fB\-\-mixer\-min\fR=\fIMIN\fR mixer device minor number (default 0) .TP \fB\-\-max\fR=\fIMAX\fR maximum number of open streams (default 256) .TP \fB\-\-umax\fR=\fIMAX\fR maximum number of open streams per UID (default \fB\-\-max\fR) .TP \fB\-\-exit\-on\-idle\fR exit if idle .TP \fB\-\-dsp\-slave\fR=\fIPATH\fR DSP slave (default ossp\-padsp in the same dir) .TP \fB\-\-log\fR=\fILEVEL\fR log level (0..6) .TP \fB\-\-timestamp\fR timestamp log messages .TP \fB\-v\fR increase verbosity, can be specified multiple times .TP \fB\-f\fR Run in foreground (don't daemonize) .SH "SEE ALSO" A more technical documentation describing some of the inner workings can be found at \fI/usr/share/doc/osspd/README.gz\fR.