From: Richard Kettlewell
Date: Sat, 17 Apr 2010 09:39:20 +0000 (+0100)
Subject: Remove libao plugin entirely; too much pain coping with platforms
X-Git-Tag: 5.0~5
X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/6a213ecb25c0c91d6fbd022a20b53c2ff9cbaf3d?ds=sidebyside
Remove libao plugin entirely; too much pain coping with platforms
where it does/does not work.
---
diff --git a/CHANGES.html b/CHANGES.html
index aa04fd9..ed1e9b4 100644
--- a/CHANGES.html
+++ b/CHANGES.html
@@ -96,8 +96,8 @@ span.command {
SoX. SoX support will be
removed in a future version.
- The libao plugin is not built if you have libao 1.0.0 (because the
- plugin API is broken in that version).
+ The libao plugin has been removed, because the plugin API is not
+ usable in libao 1.0.0.
Playlists are now supported. These allow a collection of tracks to be
prepared offline and played as a unit.
diff --git a/README.raw b/README.raw
index 6ddeb8b..a107964 100644
--- a/README.raw
+++ b/README.raw
@@ -16,20 +16,6 @@ The purpose of raw format players is:
By default, built-in raw-format players are used for several encodings, so you
do not need to do anything.
-*** Use with libao
-
-To use raw format, use the execraw module and make the command choose the
-"disorder" libao driver. You may need to link the driver from wherever
-DisOrder installs it (e.g. /usr/local/lib/ao/plugins-2) to where libao will
-look for it (e.g. /usr/lib/ao/plugins-2 or /sw/lib/ao/plugins-2).
-
-For _non_ raw players it is advisable to use the new --wait-for-device option.
-This repeatedly tries to open the audio device before starting the player
-proper. It times out after a couple of seconds.
-
-See disorder_config(5) and the example configuration file for further
-information and examples.
-
** Low-Level Details
Raw format players are started slightly differently to normal ones. Before
diff --git a/configure.ac b/configure.ac
index 3c1125c..6466efd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -339,9 +339,6 @@ subdirs="${subdirs} clients doc examples debian"
if test $want_server = yes; then
subdirs="${subdirs} server plugins sounds"
- if test "$rjk_cv_libao_plugin_api_works" = yes; then
- subdirs="${subdirs} driver"
- fi
fi
if test $want_cgi = yes; then
subdirs="${subdirs} cgi templates images"
@@ -468,19 +465,6 @@ if test $want_server = yes; then
AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new],
[AC_SUBST(LIBFLAC,[-lFLAC])],
[missing_libraries="$missing_libraries libFLAC"])
- if test $ac_cv_lib_ao_ao_initialize = yes; then
- # libao 1.0.0 breaks the plugin interface
- AC_CACHE_CHECK([whether libao has a working plugin interface],
- [rjk_cv_libao_plugin_api_works],[
- AC_COMPILE_IFELSE([#include
-#include
-
-int ao_plugin_device_init(ao_device *d) {
- d->internal = 0;
-}],[rjk_cv_libao_plugin_api_works=yes],[rjk_cv_libao_plugin_api_works=no])])
- else
- rjk_cv_libao_plugin_api_works=no
- fi
fi
AC_CHECK_LIB([pthread], [pthread_create],
[AC_SUBST(LIBPTHREAD,[-lpthread])],
@@ -849,7 +833,6 @@ AC_CONFIG_FILES([Makefile
doc/Makefile
templates/Makefile
plugins/Makefile
- driver/Makefile
debian/Makefile
sounds/Makefile
python/Makefile
diff --git a/debian/rules b/debian/rules
index f761888..aecacc4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -166,7 +166,6 @@ pkg-disorder-server: build
$(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C images
$(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C server
$(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C templates
- $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C driver
$(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C plugins
$(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C sounds
$(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C doc
@@ -181,10 +180,6 @@ pkg-disorder-server: build
echo mv $$f $${f/.0.0.0};\
mv $$f $${f/.0.0.0};\
done
- @for f in debian/disorder-server/usr/lib/ao/plugins*/*.so.0.0.0; do \
- echo mv $$f $${f/.0.0.0};\
- mv $$f $${f/.0.0.0};\
- done
find debian/disorder-server -name '*.so' -print0 | xargs -r0 strip --strip-unneeded
find debian/disorder-server -name '*.so' -print0 | xargs -r0 chmod -x
$(MKDIR) debian/disorder-server/etc/disorder
@@ -211,7 +206,6 @@ pkg-disorder-server: build
strip --remove-section=.comment \
debian/disorder-server/usr/sbin/* \
debian/disorder-server${cgiexecdir}/* \
- debian/disorder-server/usr/lib/ao/plugins*/*.so \
debian/disorder-server/usr/lib/disorder/*.so
cd debian/disorder-server && \
find -name DEBIAN -prune -o -type f -print \
diff --git a/doc/disorder.3 b/doc/disorder.3
index 2b71bf9..cbd2278 100644
--- a/doc/disorder.3
+++ b/doc/disorder.3
@@ -318,8 +318,7 @@ A standalone player that writes directly to some suitable audio
device.
.TP
.B DISORDER_PLAYER_RAW
-A player that writes raw samples to \fB$DISORDER_RAW_FD\fR, for
-instance by using the \fBdisorder\fR libao driver.
+A player that writes raw samples to \fB$DISORDER_RAW_FD\fR.
.RE
.IP
Known capabilities are:
diff --git a/doc/disorder_config.5.in b/doc/disorder_config.5.in
index fd38788..a5b55ba 100644
--- a/doc/disorder_config.5.in
+++ b/doc/disorder_config.5.in
@@ -609,9 +609,6 @@ Identical to the \fBexec\fR except that the player is expected to use the
DisOrder raw player protocol.
.BR disorder-decode (8)
can decode several common audio file formats to this format.
-If your favourite format is not supported, but you have a player
-which uses libao, there is also a libao driver which supports this format;
-see below for more information about this.
.TP
.B shell \fR[\fISHELL\fR] \fICOMMAND\fR
The command is executed using the shell.
@@ -870,25 +867,6 @@ longer needs to be specified.
.IP
This must be the full URL, e.g. \fBhttp://myhost/cgi-bin/jukebox\fR and not
\fB/cgi-bin/jukebox\fR.
-.SH "LIBAO DRIVER"
-.SS "Raw Protocol Players"
-Raw protocol players are expected to use the \fBdisorder\fR libao driver.
-Programs that use libao generally have command line options to select the
-driver and pass options to it.
-.SS "Driver Options"
-The known driver options are:
-.TP
-.B fd
-The file descriptor to write to.
-If this is not specified then the driver looks like the environment
-variable \fBDISORDER_RAW_FD\fR.
-If that is not set then the default is 1 (i.e. standard output).
-.TP
-.B fragile
-If this is set to a nonzero value then the driver will call \fB_exit\fR(2) if a
-write to the output file descriptor fails.
-This is a workaround for buggy players such as \fBogg123\fR that ignore
-write errors.
.SH "REGEXP SUBSTITUTION RULES"
Regexps are PCRE regexps, as defined in \fBpcrepattern\fR(3).
The only option used is \fBPCRE_UTF8\fR.
diff --git a/driver/Makefile.am b/driver/Makefile.am
deleted file mode 100644
index df8fe1f..0000000
--- a/driver/Makefile.am
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# This file is part of DisOrder
-# Copyright (C) 2005, 2007, 2008 Richard Kettlewell
-#
-# This program 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 3 of the License, or
-# (at your option) any later version.
-#
-# This program 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 .
-#
-
-
-aolib_LTLIBRARIES=libdisorder.la
-aolibdir=${libdir}/ao/plugins-2
-finkaolibdir=${finkdir}/lib/ao/plugins-2
-usraolibdir=/usr/lib/ao/plugins-2
-AM_CPPFLAGS=-I${top_srcdir}/lib
-
-libdisorder_la_SOURCES=disorder.c
-libdisorder_la_LDFLAGS=-module
-
-install-data-hook:
-
-# Link ao driver into right location. If you have some other location then
-# you'll need to modify this or link it manually.
-#
-# We don't mess with this for now; since disorder-decode covers some common
-# cases, the libao driver is less useful than it was.
-link-ao-driver:
- @if test -d ${DESTDIR}${finkaolibdir} \
- && test ${finkaolibdir} != ${aolibdir}; then \
- echo rm -f ${DESTDIR}${finkaolibdir}/libdisorder.*; \
- rm -f ${DESTDIR}${finkaolibdir}/libdisorder.*; \
- echo ln ${aolibdir}/libdisorder.* ${DESTDIR}${finkaolibdir}; \
- ln ${DESTDIR}${aolibdir}/libdisorder.* ${DESTDIR}${finkaolibdir}; \
- fi
- @if test -d ${DESTDIR}${usraolibdir} \
- && test ${usraolibdir} != ${aolibdir}; then \
- echo rm -f ${DESTDIR}${usraolibdir}/libdisorder.*; \
- rm -f ${DESTDIR}${usraolibdir}/libdisorder.*; \
- echo ln ${DESTDIR}${aolibdir}/libdisorder.* ${DESTDIR}${usraolibdir}; \
- ln ${DESTDIR}${aolibdir}/libdisorder.* ${DESTDIR}${usraolibdir}; \
- fi
diff --git a/driver/disorder.c b/driver/disorder.c
deleted file mode 100644
index 143b043..0000000
--- a/driver/disorder.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * This file is part of DisOrder.
- * Copyright (C) 2005, 2007, 2010 Richard Kettlewell
- *
- * This program 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 3 of the License, or
- * (at your option) any later version.
- *
- * This program 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 .
- */
-/** @file driver/disorder.c
- * @brief libao driver used by DisOrder
- *
- * The output from this driver is expected to be fed to @c
- * disorder-normalize to convert to the confnigured target format.
- *
- * @attention This driver will not build with libao 1.0.0. libao has
- * taken away half the plugin API and not provided any replacement.
- */
-
-#include "common.h"
-
-#include
-#include
-#include
-#include
-#include
-
-#include "speaker-protocol.h"
-
-/* extra declarations to help out lazy */
-int ao_plugin_test(void);
-ao_info *ao_plugin_driver_info(void);
-char *ao_plugin_file_extension(void);
-
-/** @brief Private data structure for this driver */
-struct internal {
- int fd; /* output file descriptor */
- int exit_on_error; /* exit on write error */
-
- /** @brief Record of sample format */
- struct stream_header header;
-
-};
-
-/* like write() but never returns EINTR/EAGAIN or short */
-static int do_write(int fd, const void *ptr, size_t n) {
- size_t written = 0;
- int ret;
- struct pollfd ufd;
-
- memset(&ufd, 0, sizeof ufd);
- ufd.fd = fd;
- ufd.events = POLLOUT;
- while(written < n) {
- ret = write(fd, (const char *)ptr + written, n - written);
- if(ret < 0) {
- switch(errno) {
- case EINTR: break;
- case EAGAIN:
- /* Someone sneakily gave us a nonblocking file descriptor, wait until
- * we can write again */
- ret = poll(&ufd, 1, -1);
- if(ret < 0 && errno != EINTR) return -1;
- break;
- default:
- return -1;
- }
- } else
- written += ret;
- }
- return written;
-}
-
-/* return 1 if this driver can be opened */
-int ao_plugin_test(void) {
- return 1;
-}
-
-/* return info about this driver */
-ao_info *ao_plugin_driver_info(void) {
- static const char *options[] = { "fd" };
- static const ao_info info = {
- AO_TYPE_LIVE, /* type */
- (char *)"DisOrder format driver", /* name */
- (char *)"disorder", /* short_name */
- (char *)"http://www.greenend.org.uk/rjk/disorder/", /* comment */
- (char *)"Richard Kettlewell", /* author */
- AO_FMT_NATIVE, /* preferred_byte_format */
- 0, /* priority */
- (char **)options, /* options */
- 1, /* option_count */
- };
- return (ao_info *)&info;
-}
-
-/* initialize the private data structure */
-int ao_plugin_device_init(ao_device *device) {
- struct internal *i = malloc(sizeof (struct internal));
- const char *e;
-
- if(!i) return 0;
- memset(i, 0, sizeof *i);
- if((e = getenv("DISORDER_RAW_FD")))
- i->fd = atoi(e);
- else
- i->fd = 1;
- device->internal = i;
- return 1;
-}
-
-/* set an option */
-int ao_plugin_set_option(ao_device *device,
- const char *key,
- const char *value) {
- struct internal *i = device->internal;
-
- if(!strcmp(key, "fd"))
- i->fd = atoi(value);
- else if(!strcmp(key, "fragile"))
- i->exit_on_error = atoi(value);
- /* unknown options are required to be ignored */
- return 1;
-}
-
-/* open the device */
-int ao_plugin_open(ao_device *device, ao_sample_format *format) {
- struct internal *i = device->internal;
-
- /* we would like native-order samples */
- device->driver_byte_format = AO_FMT_NATIVE;
- i->header.rate = format->rate;
- i->header.channels = format->channels;
- i->header.bits = format->bits;
- i->header.endian = ENDIAN_NATIVE;
- return 1;
-}
-
-/* play some samples */
-int ao_plugin_play(ao_device *device, const char *output_samples,
- uint_32 num_bytes) {
- struct internal *i = device->internal;
-
- /* Fill in and write the header */
- i->header.nbytes = num_bytes;
- if(do_write(i->fd, &i->header, sizeof i->header) < 0) {
- if(i->exit_on_error) _exit(-1);
- return 0;
- }
-
- /* Write the sample data */
- if(do_write(i->fd, output_samples, num_bytes) < 0) {
- if(i->exit_on_error) _exit(-1);
- return 0;
- }
- return 1;
-}
-
-/* close the device */
-int ao_plugin_close(ao_device attribute((unused)) *device) {
- return 1;
-}
-
-/* delete private data structures */
-void ao_plugin_device_clear(ao_device *device) {
- free(device->internal);
- device->internal = 0;
-}
-
-/* report preferred filename extension */
-char *ao_plugin_file_extension(void) {
- return 0;
-}
-
-/*
-Local Variables:
-c-basic-offset:2
-comment-column:40
-End:
-*/