This patch allows bplay to be compiled as a package for OpenWRT. bplay is a buffered audio play/record program. Handles WAV, VOC and raw sound files. Should allow glitch-free recording at 44100Hz/16 bit stereo on most hardware.
In the context of OpenWRT, bplay's primary advantage over alternate audio players/recorders is its small size. The binary takes up ~23k of flash when installed, and has minimal dependencies (only libc6). Testing: It works for me to play and record WAV format files at 48000Hz, 16-bit mono using OSS and a USB sound card on my ASUS 520gu. There may be some issues with inaccurate file length information in the WAV file headers according to other applications (eg. sndfile-info), but if this is true it didn't present major problems for me, so I didn't look into it. And here is some additional information from text found elsewhere on the Internet: bplay plays raw audio, WAV, and VOC files. It's also able to record to these files. It uses a variety of techniques to get the highest speed possible so that it can run acceptably even on slow machines. One of these techniques require that the installed programs be setuid root. For the paranoid hoping to use this, there was a Debian package modified by Ian Jackson (ijack...@gnu.org) which disables the feature that needs the setuid bit. The author is David Monro (dav...@gh.cs.usyd.edu.au). Note that in a message he wrote in 1999, he referred to the code as "very old". This version appears to be circa 2000, and I am not aware of a more recent version. (see http://lkml.indiana.edu/hypermail/linux/kernel/9909.1/1010.html). I could not find an official home page for bplay, or source repository, so I specified http://ftp.de.debian.org/debian/pool/main/b/bplay in the Makefile Signed-off-by: Dan Brown <danbr...@gmail.com> --- Index: package/bplay/patches/010-dev-sound-dsp.patch =================================================================== --- package/bplay/patches/010-dev-sound-dsp.patch (revision 0) +++ package/bplay/patches/010-dev-sound-dsp.patch (revision 0) @@ -0,0 +1,30 @@ +diff -ruN bplay-0.991.orig/bplay.1 bplay-0.991/bplay.1 +--- bplay-0.991.orig/bplay.1 2009-01-01 17:15:13.000000000 -0800 ++++ bplay-0.991/bplay.1 2009-01-04 13:08:37.000000000 -0800 +@@ -67,7 +67,7 @@ + Print debug information to stderr. Debug level ranges from 0 to 2, + where 0 is no debug information. + .SH FILES +-.I /dev/dsp ++.I /dev/dsp (or /dev/sound/dsp for kernel versions < 2.6) + The audio device. + .SH BUGS + .PP +diff -ruN bplay-0.991.orig/sndfunc.c bplay-0.991/sndfunc.c +--- bplay-0.991.orig/sndfunc.c 2009-01-01 17:15:13.000000000 -0800 ++++ bplay-0.991/sndfunc.c 2009-01-04 13:18:14.000000000 -0800 +@@ -13,8 +13,13 @@ + #include <sys/types.h> + #include <sys/soundcard.h> + #include <sys/ioctl.h> ++#include <linux/version.h> + +-#define AUDIO "/dev/dsp" ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) ++ #define AUDIO "/dev/sound/dsp" ++#else ++ #define AUDIO "/dev/dsp" ++#endif + + /* Globals */ + int audio, abuf_size, fmt_mask; Index: package/bplay/Makefile =================================================================== --- package/bplay/Makefile (revision 0) +++ package/bplay/Makefile (revision 0) @@ -0,0 +1,41 @@ +# Makefile for bplay +# created by Dan Brown, 2009 + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bplay +PKG_VERSION:=0.991 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz +PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/b/bplay +PKG_MD5SUM:=7bb4c7bbd81b83f403b994f8faaad113 + +include $(INCLUDE_DIR)/package.mk + +define Package/bplay + SECTION:=sound + CATEGORY:=Sound + TITLE:=bplay is a buffered audio file player/recorder +endef + +define Package/bplay/description + The bplay package provides a simple command-line + utility for playing and recording audio files in + raw sample, VOC and WAV formats. To use this + program you need a soundcard of some kind and the + appropriate driver configured into your kernel. + When run the program creates two processes which + share a memory buffer. It does reading/writing on + the disk and the sound device simultaneously, in + order to be less liable to `pause' because the + disk is too slow or too busy. +endef + +define Package/bplay/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/{bplay,brec} $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,bplay)) + _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel