Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save atmos/654276 to your computer and use it in GitHub Desktop.
Save atmos/654276 to your computer and use it in GitHub Desktop.
# use and abuse of pipes with audio data
http://www.debian-administration.org/articles/145
testing shit
Note these instructions are all based on the mightyOhm articles. This is a little bit different because I wanted to get alsa sound working (instead of dsp) so that I could overlay effects
and background sound simultaneously.
What to do
==========
install mightyohm trx
setup network and wireless
vi /etc/opkg.conf
src/gz snapshots http://192.168.24.104/mightyohm
opkg update
opkg install kmod-usb-ohci kmod-alsa alsa-lib
bplay
=====
# Note you may need to also change "dest root /" to "dest root /jffs" to use the overlay
vi /etc/opkg.conf
src/gz snapshots http://192.168.24.104/packages
Mpd
===
vi /etc/opkg.conf
src/gz snapshots http://mightyohm.com/files/kamikaze-2.4/packages/mipsel
opkg update
install mpd mpc
reboot
vi /usr/share/alsa/alsa.conf
change
defaults.pcm.ipc_gid audio
to
defaults.pcm.ipc_gid root
blind flashing:
===============
configure local machine lan hardware to 192.168.1.185 manual address (so you are on the .1 network)
connect network cable (not crossover) from local machine to LAN1 port
if your current network (wireless) is on a .1 network you can (a) change it (b) turn off wireless while you do stuff
power off router
hold down Restore button
power on router
LED should start flashing once per second, release Restore button
ping 192.168.1.1
cd < whereever the trx file is, maybe kamikaze/bin >
tftp
trace
timeout 1
mode binary
connect 192.168.1.1
put openwrt-brcm-2.4-squashfs.trx
wait 10 minutes, don't touch anything.
reboot the router (unplug, wait a couple seconds, plug it back in)
ping 192.168.1.1 (wait until it starts responding)
telnet 192.168.1.1
network setup
=============
vi /etc/config/wireless
config wifi-device wl0
option type broadcom
option channel 6 # the channel your wireless network is on
config wifi-iface
option device wl0
option network lan
option mode sta
option ssid MyNetwork # the SSID of your network
option encryption psk # the encryption mode of your network (or wep)
option key XXXXXXXXXX # add this line with your preshared key in place of X...X
vi /etc/config/network
# Only update this section:
#### LAN configuration
config interface lan
option type bridge
option ifname "eth0.0"
option proto dhcp
#### You could optionally give a manual address still, but make sure it is on your wireless subnet
#option ipaddr 192.168.1.1
#option netmask 255.255.255.0
#### WAN configuration
config interface wan
option type bridge
option ifname "eth0.1"
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0
vi /etc/config/firewall
#### Update the wan zone so it looks like the lan zone
config zone
option name wan
option input ACCEPT
option output ACCEPT
option forward REJECT
/etc/init.d/network restart
#### This will disconnect you. Change the network cable to be plugged into the WAN port and
#### you can again telnet to 192.168.1.1. You can also telnet to your wireless network by
#### finding out which dhcp address it picked up (check your normal wireless router for clients)
Setting up MPD
==============
root@OpenWrt:/# mkdir ~/.mpd
root@OpenWrt:/# mkdir ~/.mpd/playlists
root@OpenWrt:/# mkdir ~/music
root@OpenWrt:/# mpd
unable to open db file "/root/.mpd/mpd.db": No such file or directory
current locale is "C"
setting filesystem charset to ISO-8859-1
No "audio_output" defined in config file
Attempt to detect audio output device
Attempting to detect a oss audio device
Error opening OSS device "/dev/dsp": No such file or directory
Successfully detected a oss audio device
# An example configuration file for MPD
# See the mpd.conf man page for a more detailed description of each parameter.
######################## REQUIRED PATHS ########################
port 6602
music_directory "/mpd2/music"
playlist_directory "/mpd2/playlists"
db_file "/mpd2/mpd.db"
log_file "/mpd2/mpd.log"
error_file "/mpd2/mpd.error"
################################################################
debug:
make sure there is no /etc/module.d/60-usb-audio
# You need to enable netcat server in the busybox core
https://dev.openwrt.org/ticket/2905
# How to add a package (https://forum.openwrt.org/viewtopic.php?id=16040)
(1) find the package you are looking for and check it out/copy into $base/package/<package name>
(2) Fixup the makefile
(3) Compile just that package and rebuild the index!
make package/<name>/{clean,compile} package/index
(4) Select the package (M)
make menuconfig
(5) Rebuild the index again
make package/index
(6) Copy those packages to your webserver so opkg can see it
# Installing rawrec
opkg update
opkg install rawrec
opkg install libpthread
include $(TOPDIR)/rules.mk
PKG_NAME:=rawrec
PKG_VERSION:=0.9.98
PKG_RELEASE:=1
#PKG_MD5SUM:=800856d0211de5728cea1cbde923201d
PKG_SOURCE_URL:=http://sourceforge.net/projects/rawrec/files/$(PKG_NAME)/$(PKG_VERSION)/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_CAT:=zcat
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
include $(INCLUDE_DIR)/package.mk
define Package/rawrec
SECTION:=sound
CATEGORY:=Sound
TITLE:=rawrec is a direct audio file player/recorder
endef
define Package/rawrec/description
The rawrec package provides a simple command-line
utility for playing and recording audio files in
raw sample.
endef
define Package/rawrec/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/src/{rawplay,rawrec} $(1)/usr/bin/
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/src \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)"
endef
$(eval $(call BuildPackage,rawrec))
include $(TOPDIR)/rules.mk
PKG_NAME:=rawrec
PKG_VERSION:=0.9.98
PKG_RELEASE:=1
#PKG_MD5SUM:=800856d0211de5728cea1cbde923201d
PKG_SOURCE_URL:=http://sourceforge.net/projects/rawrec/files/$(PKG_NAME)/$(PKG_VERSION)/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_CAT:=zcat
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
include $(INCLUDE_DIR)/package.mk
define Package/rawrec
SECTION:=sound
CATEGORY:=Sound
TITLE:=rawrec is a direct audio file player/recorder
endef
define Package/rawrec/description
The rawrec package provides a simple command-line
utility for playing and recording audio files in
raw sample.
endef
define Package/rawrec/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/src/{rawplay,rawrec} $(1)/usr/bin/
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/src \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)"
endef
$(eval $(call BuildPackage,rawrec))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment