Update of /cvsroot/alsa/alsa-tools/usx2yloader In directory sc8-pr-cvs1:/tmp/cvs-serv20613
Modified Files: Makefile.am configure.in usx2yloader.c Added Files: INSTALL README cvscompile tascam_fw tascam_fw.usermap Log Message: updated to version 0.3 by Karsten: - added INSTALL and README documents. - fixed compile warnings. - install hotplug scripts to /etc/hotplug/usb. - added phase1 firmware files. --- NEW FILE: INSTALL --- For Installing from CVS do: ./cvscompile make install --- NEW FILE: README --- USX2YLOADER - Second Phase Firmware loader for Tascam USX2Y USB soundcards 2003-09-15 Karsten Wiese <[EMAIL PROTECTED]> GENERAL ======= Usx2yloader is a helper program to load the 2nd Phase firmware binaries onto the Tascam USX2Y USB soundcards. It has proven to work so far only for the US428. US122 & US224 will hopefully follow. The snd-usb-us428 module requires this program. US428 initialisation outlined ============================= A. Phase 1 A.1. US428 is plugged to the PC and powered on. This makes the kernel see a new USB-device with the Vendor/Product ID 0x1604/0x8000. The kernel reacts by starting the usb-hotplug script. A.2. The usb-hotplug script starts the executable fxload, which transfers the EZUSB firmware to the US428. A.3. The US428 disconnects itself from the USB-Bus and ... (see Phase 2). B. Phase 2 B.1. The US428 reintroduces itself as USB-device with the Vendor/Product ID 0x1604/0x8001. The kernel reacts by loading the module snd-usb-us428, if it is not already loaded. B.2 The module snd-usb-us428 "takes" the US428 as its device and sets up a "hardware dependent interface". (The module doesn't create any pcm nor midi devices now.) B.3 Subsequently the kernel starts the usb-hotplug script, which launches usx2yloader. B.4 usx2yloader transfers the 2nd Phase firmware binary to the US428 by means of the "hardware dependent interface". When this transfer finishes, the snd-usb-us428 module creates the pcm- and midi-devices. Initialisation is complete. USAGE ===== When usx2yloader is invoked without options, it will probe all existing soundcards until a valid USX2Y-driver is found. If a valid USX2Y-driver is found, usx2yloader reads the board type from the driver. The corresponding firmware binaries are then read and transferred to the driver. Finally, usx2yloader initializes the PCM, MIDI and the mixer devices on the driver for making the soundcard full functional. Instead of auto-probing, you can specify the card number or the hwdep device name or the usb device name via -c, -D or -u options, respectively. % usx2yloader -c 1 % usx2yloader -D hw:0 % usx2yloader -u /proc/bus/usb/001/003 For loading everything automatically in response to a hotplug event there are the hotplug script files - tascam_fw.usermap - tascam_fw - tascam_fpga and the Firmwarefiles. You also need hotplug to be installed. FIRMWAREFILES ============= The firmware binaries are installed on /usr/share/alsa/firmware (or /usr/local/share/alsa/firmware, depending to the prefix option of configure). There will be *.conf files, which define the dsp image files for each different card type. COPYRIGHT ========= Copyright (c) 2003 Karsten Wiese <[EMAIL PROTECTED]> Distributalbe under GPL. The firmware files included in firmware sub-directory are copyright by Tascam / TEAC Corporation. --- NEW FILE: cvscompile --- #!/bin/bash aclocal $ACLOCAL_FLAGS automake --foreign --add-missing autoconf export CFLAGS='-O2 -Wall -pipe -g' echo "CFLAGS=$CFLAGS" echo "./configure $@" ./configure $@ unset CFLAGS make --- NEW FILE: tascam_fw --- #!/bin/sh # load the firmware into Tascam USB devices FIRMWARE= FIRMWAREDIR=/usr/local/share/alsa/firmware FLAGS= LOADER=/sbin/fxload LOADERFIRMWARE=$FIRMWAREDIR/tascam_loader.ihx case $PRODUCT in 1604/8000/*) FIRMWARE=$FIRMWAREDIR/us428fw.ihx ;; 1604/8004/*) FIRMWARE=$FIRMWAREDIR/us224fw.ihx ;; 1604/8006/*) FIRMWARE=$FIRMWAREDIR/us122fw.ihx ;; *) if [ -x /usr/bin/logger ]; then /usr/bin/logger -t $0 "unknown product $PRODUCT" fi exit 1 esac # missing loader firmware? if [ ! -r $LOADERFIRMWARE ]; then if [ -x /usr/bin/logger ]; then /usr/bin/logger -t $0 "missing $LOADERFIRMWARE ??" fi exit 1 fi # missing firmware? if [ ! -r $FIRMWARE ]; then if [ -x /usr/bin/logger ]; then /usr/bin/logger -t $0 "missing $FIRMWARE for $PRODUCT ??" fi exit 1 fi # missing loader? if [ ! -x $LOADER ]; then if [ -x /usr/bin/logger ]; then /usr/bin/logger -t $0 "missing $LOADER ??" fi exit 1 fi if [ -x /usr/bin/logger ]; then /usr/bin/logger -t $0 "load $FIRMWARE for $PRODUCT to $DEVICE" fi $LOADER $FLAGS -s $LOADERFIRMWARE -I $FIRMWARE --- NEW FILE: tascam_fw.usermap --- tascam_fw 0x0003 0x1604 0x8000 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 tascam_fw 0x0003 0x1604 0x8004 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 tascam_fw 0x0003 0x1604 0x8006 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 tascam_fpga 0x0003 0x1604 0x8001 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 tascam_fpga 0x0003 0x1604 0x8005 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 tascam_fpga 0x0003 0x1604 0x8007 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 Index: Makefile.am =================================================================== RCS file: /cvsroot/alsa/alsa-tools/usx2yloader/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Makefile.am 8 Sep 2003 11:12:31 -0000 1.1 +++ Makefile.am 23 Sep 2003 14:16:23 -0000 1.2 @@ -11,6 +11,11 @@ EXTRA_DIST = depcomp +hotplug_files = tascam_fw.usermap tascam_fw tascam_fpga +hotplugdir = /etc/hotplug/usb +hotplug_SCRIPTS = $(hotplug_files) + + alsa-dist: distdir @rm -rf ../distdir/usx2yloader @mkdir -p ../distdir/usx2yloader Index: configure.in =================================================================== RCS file: /cvsroot/alsa/alsa-tools/usx2yloader/configure.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- configure.in 8 Sep 2003 11:12:31 -0000 1.1 +++ configure.in 23 Sep 2003 14:16:23 -0000 1.2 @@ -1,5 +1,5 @@ AC_INIT(usx2yloader.c) -AM_INIT_AUTOMAKE(usx2yloader, 0.2) +AM_INIT_AUTOMAKE(usx2yloader, 0.3) AC_PROG_CC AC_PROG_INSTALL AC_HEADER_STDC Index: usx2yloader.c =================================================================== RCS file: /cvsroot/alsa/alsa-tools/usx2yloader/usx2yloader.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- usx2yloader.c 8 Sep 2003 11:12:31 -0000 1.1 +++ usx2yloader.c 23 Sep 2003 14:16:23 -0000 1.2 @@ -63,15 +63,17 @@ /* - * read a xilinx bitstream file + * read a xilinx bitstream file. + * NOTE: This interprets somehow differently from the vxloaders read_xilinx_image()! + * I took this from rbtload.c of the project usb-midi-fw.sf.net. */ static int read_xilinx_image(snd_hwdep_dsp_image_t *img, const char *fname) { FILE *fp; char buf[256]; - int data, c, idx, length; + int data = 0, c = 0, idx = 0, length = 0; char *p; - char *imgbuf; + char *imgbuf = 0; if ((fp = fopen(fname, "r")) == NULL) { fprintf(stderr, PROGNAME ": cannot open %s\n", fname); @@ -79,10 +81,6 @@ } snd_hwdep_dsp_image_set_name(img, fname); - c = 0; - data = 0; - idx = 0; - length = 0; while (fgets(buf, sizeof(buf), fp)) { if (strncmp(buf, "Bits:", 5) == 0) { for (p = buf + 5; *p && isspace(*p); p++); @@ -140,15 +138,13 @@ } } } - if (c) - imgbuf[idx++] = data; - if (idx != length) { - fprintf(stderr, - PROGNAME ": length doesn't match: %d != %d\n", idx, - length); + if (idx != length || 0 == imgbuf) { + fprintf(stderr, PROGNAME ": length doesn't match: %d != %d\n", idx, length); fclose(fp); return -EINVAL; } + if (c) + imgbuf[idx++] = data; snd_hwdep_dsp_image_set_length(img, length); snd_hwdep_dsp_image_set_image(img, imgbuf); fclose(fp); @@ -223,7 +219,6 @@ len = strlen(temp); while (fgets(buf, sizeof(buf), fp)) { - int prepad; if (strncmp(buf, temp, len)) continue; @@ -303,7 +298,7 @@ { snd_hwdep_t *hw; const char *id; - int err, is_pcmcia; + int err; unsigned int idx, dsps, loaded; snd_hwdep_dsp_status_t *stat; ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog