audio/alsa-tools: Added (tools and firmware for various soundcards)

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
This commit is contained in:
B. Watson 2012-05-13 11:07:00 -05:00 committed by Erik Hanson
parent c8230eb1f5
commit c7c23a0899
7 changed files with 553 additions and 0 deletions

View File

@ -0,0 +1,40 @@
# udev rules for hotplugging Tascam USB audio devices.
# This file is part of the slackbuilds.org alsa-tools build, released
# under the WTFPL. See http://sam.zoy.org/wtfpl/ for details.
# The vendor/product IDs were taken from /usr/share/usb.ids. The rules
# were adapted from http://www.astro.caltech.edu/~mcs/tascam_us122/
# (no idea who the author is, no name given on the page).
# Tascam's USB Vendor ID is 1604.
# Each device has two product IDs: first the initial product ID when it's
# plugged in. Then after the 1st stage firmware is loaded with fxload,
# the device re-identifies itself with a second product ID... when udev
# sees this, we want it to load the 2nd stage firmware with usx2yloader.
# Device Inititial ID 2nd-stage ID
# Tascam US-122 8006 8007
# Tascam US-224 8004 8005
# Tascam US-428 8000 8001
# Note that I haven't tested the 224 or 428 rules, because I don't own
# either of these devices. If you end up having to modify the rules to
# make them work, please send me your modified version of this file
# so I can include it in a future version of my SlackBuild. Of course,
# you don't *have* to do this (the WTFPL doesn't require it), I'm just
# asking you nicely :)
# US-122:
BUS=="usb", ACTION=="add", ATTRS{idProduct}=="8006", ATTRS{idVendor}=="1604", RUN+="/bin/sh -c '/sbin/fxload -D %N -s /usr/share/alsa/firmware/usx2yloader/tascam_loader.ihx -I /usr/share/alsa/firmware/usx2yloader/us122fw.ihx'"
BUS=="usb", ACTION=="add", ATTRS{idProduct}=="8007", ATTRS{idVendor}=="1604", RUN+="/bin/sh -c '/usr/bin/usx2yloader'"
# US-224:
BUS=="usb", ACTION=="add", ATTRS{idProduct}=="8004", ATTRS{idVendor}=="1604", RUN+="/bin/sh -c '/sbin/fxload -D %N -s /usr/share/alsa/firmware/usx2yloader/tascam_loader.ihx -I /usr/share/alsa/firmware/usx2yloader/us224fw.ihx'"
BUS=="usb", ACTION=="add", ATTRS{idProduct}=="8005", ATTRS{idVendor}=="1604", RUN+="/bin/sh -c '/usr/bin/usx2yloader'"
# US-428. Note that we aren't starting the us428control daemon, so
# the control surfaces won't work as MIDI controls.
BUS=="usb", ACTION=="add", ATTRS{idProduct}=="8000", ATTRS{idVendor}=="1604", RUN+="/bin/sh -c '/sbin/fxload -D %N -s /usr/share/alsa/firmware/usx2yloader/tascam_loader.ihx -I /usr/share/alsa/firmware/usx2yloader/us428fw.ihx'"
BUS=="usb", ACTION=="add", ATTRS{idProduct}=="8001", ATTRS{idVendor}=="1604", RUN+="/bin/sh -c '/usr/bin/usx2yloader'"

42
audio/alsa-tools/README Normal file
View File

@ -0,0 +1,42 @@
alsa-tools includes card-specific tools for various soundcards,
including firmware loaders for pcmcia and USB devices.
This package includes the firmware as well as the loaders (so there's
no need for a separate alsa-firmware package like Debian has).
This build includes udev rules for the Tascam US-122, US-224, and US-428
USB audio interfaces (which replace the old hotplug scripts shipped
with the alsa-tools source). Also included is the SlackBuild author's
"tascam-us122-HOWTO" document (see /usr/doc/alsa-tools-$VERSION).
Included tools:
ac3dec - simple AC3 stream decoder
as10k1 - assembler for the emu10k1 DSP chip present in Creative soundcards
cspctl - Sound Blaster 16 ASP/CSP control program
dl10k1 - loads dumps previously created with lo10k1 & ld10k1
echomixer - Linux equivalent of the Echoaudio console application
envy24control - Control tool for Envy24 (ice1712) based soundcards
extract_ac3 - extract AC3 streams from VOB files
hdspconf - GUI to control the Hammerfall HDSP Alsa Settings
hdsploader - firmware loader for the RME Hammerfall DSP cards
hdspmixer - Linux equivalent of the Totalmix application from RME
hwmixvolume - hardware mixer control for cards using hardware mixing
init_audigy, init_audigy_eq10, init_live - initialize Creative cards
ld10k1 - dump patches stored in an EMU10K1/EMU10K2 card
ld10k1d - daemon for lo10k1
lo10k1 - EMU10K1 (EMU10K2) patch loader for ALSA
mixartloader - Firmware loader for Digigram miXart soundcards
pcxhrloader - Firmware loader for Digigram pcxhr compatible soundcards
qlo10k1 - GUI for loading patches on EMU10K1/EMU10K2 cards
rmedigicontrol - control tool for RME Digi32 and RME Digi96 soundcards
sbiload - OPL2/3 FM instrument loader for ALSA hwdep
sscape_ctl - ALSA SoundScape control utility
us428control - Tascam US-428 control surface daemon
usx2yloader - 2nd Phase Firmware loader for Tascam USX2Y USB soundcards
vxloader - Firmware loader for Digigram VX soundcards
One of the tools (qlo10k1) uses Qt3. If you need this tool, install qt3,
and pass QT3=yes in the environment for alsa-tools.SlackBuild.
This requires fltk.

View File

@ -0,0 +1,156 @@
#!/bin/bash
# Slackware build script for alsa-tools
# Written by B. Watson (yalhcru@gmail.com)
# Licensed under the WTFPL. See http://sam.zoy.org/wtfpl/ for details.
# I am *not* going to create separate packages for each of the individual
# tools, as some distros do. They're small enough that it's worth the
# tiny bit of extra disk space for unused tools, to avoid the annoyances
# of having to write and test 10 or 12 packages. For the same reason,
# the firmware is being included in the package as well.
# *** I agree. --rworkman :-)
PRGNAM=alsa-tools
VERSION=${VERSION:-1.0.25}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
FIRMWARE=alsa-firmware
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
# first, alsa-tools itself... which is really a bunch of separate packages
# that happen to be tarred up together.
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
# qlo10k1 depends on Qt3, which no longer ships with Slackware.
# This supports the SBo qt3 build. It's not enough to source qt.sh,
# the qt3 bin directories need to come first in $PATH too.
# If you got your Qt3 from some other source, you may have to
# fiddle with QTDIR and PATH yourself.
if [ "${QT3:-no}" = "yes" ]; then
source /etc/profile.d/qt.sh
export PATH=/opt/kde3/lib/qt3/bin:/opt/kde3/bin:$PATH
else
rm -rf qlo10k1
fi
# one loop to build them all
for subdir in $( find . -name configure | sed -e 's,^\./,,' -e 's,/configure,,' ); do
cd $subdir
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux
make
make install-strip DESTDIR=$PKG
for doc in README AUTHORS COPYING ChangeLog NEWS TODO COPYING.LIB; do
[ -s "$doc" ] && cat "$doc" > $PKG/usr/doc/$PRGNAM-$VERSION/$doc.$( basename $subdir ).txt
done
cd -
done
# second, build the firmware
rm -rf $FIRMWARE-$VERSION
tar xvf $CWD/$FIRMWARE-$VERSION.tar.bz2
cd $FIRMWARE-$VERSION
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--with-hotplug-dir=/lib/firmware \
--build=$ARCH-slackware-linux
make
make install-strip DESTDIR=$PKG
# remove the hotplug scripts, since Slackware 13.37 doesn't use hotplug.
# Instead, they've been converted to udev rules.
rm -rf $PKG/etc/hotplug
mkdir -p $PKG/lib/udev/rules.d
cat $CWD/99-tascam.rules > $PKG/lib/udev/rules.d/99-tascam.rules
cat COPYING > $PKG/usr/doc/$PRGNAM-$VERSION/COPYING.firmware.txt
cat README > $PKG/usr/doc/$PRGNAM-$VERSION/README.firmware.txt
# I wrote this doc when I got my US-122, might as well include it in
# case it helps anyone.
cat $CWD/tascam-us122-HOWTO > $PKG/usr/doc/$PRGNAM-$VERSION/tascam-us122-HOWTO
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

View File

@ -0,0 +1,12 @@
PRGNAM="alsa-tools"
VERSION="1.0.25"
HOMEPAGE="http://www.alsa-project.org/"
DOWNLOAD="ftp://ftp.alsa-project.org/pub/tools/alsa-tools-1.0.25.tar.bz2 \
ftp://ftp.alsa-project.org/pub/firmware/alsa-firmware-1.0.25.tar.bz2"
MD5SUM="57bfec98a814d12e0f7ab379aaeccd87 \
f1939da45b162c83a726c54a470ef139"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
MAINTAINER="B. Watson"
EMAIL="yalhcru@gmail.com"
APPROVED="rworkman"

View File

@ -0,0 +1,14 @@
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
fi
fi
if [ -x /sbin/udevadm ]; then
/sbin/udevadm control --reload-rules
fi

View File

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
alsa-tools: alsa-tools (tools and firmware for various soundcards)
alsa-tools:
alsa-tools: alsa-tools includes card-specific tools for various soundcards,
alsa-tools: including firmware loaders for pcmcia and USB devices.
alsa-tools:
alsa-tools: This package includes the firmware as well as the loaders (on most
alsa-tools: other Linux distributions, the firmware is in a separate alsa-firmware
alsa-tools: package).
alsa-tools:
alsa-tools:
alsa-tools:

View File

@ -0,0 +1,270 @@
How to get a Tascam US-122 working with Slackware 13.37.
The Tascam US-122 is a bus-powered USB 1.1 audio interface, with 2
channels of input (either 1/4" unbalanced or XLR balanced) and adjustable
direct monitoring. See Tascam's product page for more information (Links
section, below).
These directions might also be useful for the US-224 and US-428. There are
also US-122MkII and US-144MkII units which are cosmetically different,
but might be the same thing internally (or might not; I don't have one
for testing).
Before you start: the US-122 is bus-powered, and draws quite a bit more
power than your average USB device (though not more than the 500mA that
the USB specification says USB ports/hubs should support). It probably
won't work with cheap powered USB hubs (it may be detected & show up
in alsamixer, but fail to actually play any audio). It will of course
never work with an unpowered hub. It's also possible (but unlikely) that
it could fry a cheap motherboard, if plugged in without a hub. If you're
even slightly worried about this, I'd recommend getting a decent powered
hub (one that says it supports "high power" or "hi-power" USB devices).
You should read the owner's manual (see Links, below). Obviously you
can skip the parts about installing/using the Windows/Mac drivers and
software (which is most of the manual actually), but the product specs
in the back are informative.
Unlike some other "USB mixer" devices, the Tascam isn't just plug and
play on Slackware Linux systems. Although it appears as a standard
class-compliant USB audio interface (and also as a MIDI interface),
it requires its firmware to be sent over the USB cable each time it's
plugged in. Presumably, this is to save on cost (no ROM or flash is
required inside the unit), and to allow for easy firmware upgrades.
To get the device to work, you'll need the firmware itself, the firmware
loader utility, and some udev rules that cause the firmware loader to
be run when the device it plugged in. Read on for the gory details...
To start with, leave the device unplugged.
The commands below assume you have root access (either logged in as root,
or via "su -". Don't use "su" without the hyphen though).
Steps
-----
1. To get the US-122 working without audio glitches:
# echo 'options snd_usb_usx2y nrpacks=1' > /etc/modprobe.d/tascam.conf
What this does is reduce the number of audio packets sent in each USB
packet. Without this, the Tascam worked, but every few seconds its
audio would get "scratchy" sounding (due to dropped samples). When this
happened, I was using jack, and it didn't report any x-runs. I don't
really understand why nrpacks works, I found it by googling (see the
links section, below).
2. Install fxload and alsa-tools from slackbuilds.org.
# sbopkg -i fxload alsa-tools
If you prefer, you can download the SlackBuild tarballs and build them
manually, instead of using sbopkg.
If you're not actually using Slackware, or if you decide to compile
alsa-tools without using the slackbuilds.org package, see the "Udev Rules"
section of this document.
3. Plug in the device.
After a couple of seconds, the green USB light on the Tascam should light
up. The snd_usb_usx2y should be auto-loaded by udev (check the output of
"lsmod").
4. Testing
Have a look at the output of "aplay -l", and/or run alsamixer and press
F6. The card should show up as "USX2Y [TASCAM US-X2Y]". It will probably
be device #1 (the numbering starts at zero, and your internal/onboard
audio normally shows up as device #0).
Example:
# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC269 Analog [ALC269 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: USX2Y [TASCAM US-X2Y], device 0: US-X2Y Audio [US-X2Y Audio #0]
Subdevices: 1/1
Subdevice #0: subdevice #0
Since it's card #1, we should be able to use it to play an mp3 or ogg file
with mplayer, like so:
# mplayer -ao alsa:device=hw=1 somesong.mp3
You can use some other audio player, if you don't have mplayer installed.
Whatever you use, set its audio device to "hw:1" (no, the "device=hw=1"
above isn't a typo, it's how you tell mplayer to use "hw:1". Really.)
Obviously you need speakers or headphones plugged into the Tascam, to
actually hear anything. Also, the headphone and main volumes have to be
turned up. There's no software volume control (you can't use alsamixer
or KDE's volume control), you'll have to actually turn the knobs :)
Troubleshooting
---------------
If you don't hear any audio, and/or mplayer (or whatever audio playing
app) gives error messages and/or freezes up, the Tascam might not be
getting enough power. Run "dmesg|tail" and look for messages like:
[623530.547384] Sequence Error!(hcd_frame=226 ep=10out;wait=226,frame=223).
[623530.547386] Most propably some urb of usb-frame 226 is still missing.
[623530.547387] Cause could be too long delays in usb-hcd interrupt handling.
Try a different powered USB hub, or try it in a USB port on the PC itself.
Once you get everything working, you should be able to use the US-122
with jack (with or without qjackctl). Make sure to enable the MIDI ports
(-Xseq on the jackd command line) if you plan to use them.
(Apparently, the US-428 requires a daemon called us428control to be
running, to get the MIDI controls to work. I haven't got a US-428 so I
don't know anything about this)
JACK Latency
------------
As a USB 1.x device, the Tascam's audio latency is going to be pretty
awful. To measure it, you loop the output back into the input, and run
jack_delay (I used a 1/4" guitar cable, connected from the headphone
output to the left line input jack). Make sure the "Direct Monitoring"
switch is off, or else it will feed back and jack_delay won't be able
to measure anything.
I've measured my Tascam with jack_delay. Results:
# jack_delay -I system:capture_1 -O system:playback_1 -E
210.625 frames 4.388 ms
To get jack-using applications to compensate for latency, use the -I and
-O options. jack_delay's README says:
To determine the correct values for jack's -I and -O, set both
of them to zero ('default' in qjackctl) and measure the latency
using the -E option. Then set each of the -I and -O options to
half the value displayed.
The options can't be fractional, so I use "-I 105 -O 105", which seems
to work OK. My complete jackd command line looks like:
/usr/bin/jackd -Z -R -P65 -dalsa -dhw:1 -r48000 -p256 -n3 -Xseq -I105 -O105
With these settings, I'm able to use fluidsynth, beatrix, bristol,
and other audio synths. I use a USB MIDI keyboard, but you could
use the Tascam's MIDI in jack with a standard MIDI keyboard as well.
ardour and ecasound also work for recording audio, though I haven't
tested them thoroughly.
I haven't experimented with the -p and -n options. Lower values would
mean less latency, at the expense of more CPU and I/O overhead. I'm using
the Tascam with an eeePC (relatively slow single core Intel Atom CPU),
you might do better on faster hardware... but don't expect miracles:
USB 1.1 just plain doesn't move data fast enough to get truly low latency
audio. You'd need USB 2.0 (expensive, proprietary) or better yet, Firewire
(also expensive) for that.
If you can't seem to get rid of audio problems any other way, try
(in order):
- make sure jackd and your audio applications have the appropriate
POSIX capabilities (e.g. setcap cap_ipc_lock,cap_sys_nice=ep
/usr/bin/jackd)
- add append="threadirqs" in lilo.conf (re-run lilo, reboot)
- use the rtirq script from http://www.rncbc.org/jack/
- recompile the kernel with CONFIG_PREEMPT=y
- Use a realtime-patched kernel
from http://www.kernel.org/pub/linux/kernel/projects/rt/
There is a lot of info out there on the 'net about reducing latency
and/or x-runs in jack. You'll get it working if you're persistent.
Miscellaneous
-------------
This isn't Slackware- or Linux-specific information, but it's not covered
real well in the owner's manual either.
Unlike some other "USB mixer" devices, the Tascam won't work as a
standalone mixer. It's USB-powered, and needs its firmware loaded.
The Direct switch sends whatever's coming in on the inputs, directly to
the output, with no latency. In ardour, select "Options > Hardware does
monitoring" to use this. If you want to use the Tascam + your computer
as a live guitar effects rig (maybe using rakarrack, jack-rack, and/or
sooperlooper), this needs to be disabled.
The inputs are labelled L and R (left and right). When the Mono switch
is in the On position, both channels are mixed together and appear on
the left and right outputs (and on both system:capture_* ports in jack).
The device still appears to be stereo from jack and alsa's point of view
(just with identical audio on both channels).
The insert jacks are described as "TRS jacks" in the manual. This means
tip-ring-sleeve. Probably you'll need a stereo 1/4" Y-cable (with two
mono 1/4" plugs or jacks on the other end) to make any use of the inserts.
I haven't tried them yet. See http://en.wikipedia.org/wiki/TRS_connector
There are no software-controllable mixer controls. You can only adjust
the volume with the hardware knobs (separate ones for headphone and
line outputs).
You can't use the US-122's controls as a MIDI control surface. From what
I've read, the US-428 is capable of this.
Links
-----
Tascam US-122 product page: http://tascam.com/product/us-122/
The owner's manual is in the "Downloads" section.
These instructions were adapted from the Fedora Core 5 instructions here:
http://www.astro.caltech.edu/~mcs/tascam_us122/
Ubuntu forum topic about Tascam devices (there's a lot of noise, but some
useful info too):
http://ubuntuforums.org/showthread.php?t=30891
The US-122L, US-122MkII, and US-144 are apparently completely different
beasts. Here are a couple of pages discussing them (which may contain
outdated information, YMMV):
http://www.premiumorange.com/la-page-web-of-phil/index.php?page=P030001
http://mailman.alsa-project.org/pipermail/alsa-devel/2011-November/045912.html
Udev Rules
----------
If you used the slackbuilds.org package of alsa-tools, you don't need
this (it already includes a suitable set of udev rules for the US-122,
US-224, and US-428).
# cat > /lib/udev/rules.d/99-tascam.rules <<EOF
BUS=="usb", ACTION=="add", SYSFS{idProduct}=="8006", SYSFS{idVendor}=="1604", RUN+="/bin/sh -c '/sbin/fxload -D %N -s /usr/share/alsa/firmware/usx2yloader/tascam_loader.ihx -I /usr/share/alsa/firmware/usx2yloader/us122fw.ihx'"
BUS=="usb", ACTION=="add", SYSFS{idProduct}=="8007", SYSFS{idVendor}=="1604", RUN+="/bin/sh -c '/usr/bin/usx2yloader'"
EOF
(the above is two long lines beginning with "BUS==". There shouldn't be any
other line breaks)
For the US-224, change the "us122fw.ihx" above to "us224fw.ihx", and
change the SYSFS{idProduct} numbers to 8004 and 8005. For the US-428,
the firmware is "us428fw.ihx" and the product IDs are 8000 and 8001.
After creating the udev rules file, tell udevd to load it:
# udevadm control --reload-rules
Author
------
B. Watson (yalhcru at gmail dot com)
If you find anything confusing or inaccurate in this guide, or have more
information (particularly about the other Tascam US-series interfaces),
let me know and I'll update the guide at some point.