ports/148411: New port: audio/madfufw M-Audio DFU Firmware for USB sound devices

Aragon Gouveia aragon at phat.za.net
Tue Jul 6 23:30:09 UTC 2010


>Number:         148411
>Category:       ports
>Synopsis:       New port: audio/madfufw M-Audio DFU Firmware for USB sound devices
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 06 23:30:02 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Aragon Gouveia
>Release:        FreeBSD 8.0-STABLE amd64
>Organization:
>Environment:
System: FreeBSD igor.geek.sh 8.0-STABLE FreeBSD 8.0-STABLE #0: Sun Jun 13 23:39:32 SAST 2010 toor at igor.geek.sh:/usr/obj/usr/src/sys/IGOR amd64


	
>Description:
	Userland scaffolding to load M-Audio firmware into supported
	sound devices upon attachment.  Supported devices:

	* Sonica
	* Ozone
	* MobilePre USB (some newer models don't need this port)
	* Transit 

	Based upon the madfuload package at http://usb-midi-fw.sourceforge.net/

	Unfortunately only M-Audio Transit tested.

	Many thanks to Stefan Ehmann <shoesoft at gmx.net> for your help.

>How-To-Repeat:
	
>Fix:

	

--- madfufw.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	madfufw
#	madfufw/files
#	madfufw/files/pkg-message.in
#	madfufw/files/maudio.in
#	madfufw/files/maudio-devd.conf.in
#	madfufw/Makefile
#	madfufw/pkg-descr
#	madfufw/distinfo
#
echo c - madfufw
mkdir -p madfufw > /dev/null 2>&1
echo c - madfufw/files
mkdir -p madfufw/files > /dev/null 2>&1
echo x - madfufw/files/pkg-message.in
sed 's/^X//' >madfufw/files/pkg-message.in << '1ec6cb4285e75d0b1c4c9cd99dcfc123'
XA devd(8) configuration has been installed at:
X%%PREFIX%%/etc/devd/maudio-devd.conf.
X
XYou must add 'maudio_enable="YES"' to rc.conf
Xand restart devd(8) for this port to work.
X
XSome devices (eg. Transit) may also require
Xsysctl modifications:
X
Xhw.usb.uaudio.default_bits=16
Xhw.usb.uaudio.default_rate=48000
1ec6cb4285e75d0b1c4c9cd99dcfc123
echo x - madfufw/files/maudio.in
sed 's/^X//' >madfufw/files/maudio.in << 'c4a79cc274f425a7b1b583f95e7ac47e'
X#!/bin/sh
X#
X# PROVIDE: maudio
X# REQUIRE: LOGIN
X# KEYWORD: nojail
X#
X# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
X# to enable this service:
X#
X# maudio_enable (bool):	Set to NO by default.
X#			Set it to YES to enable maudio.
X# Usage:
X#	maudio start [<device> <product id>]	# load firmware to device with specified product ID
X
X# disable at boot time and prevent simultaneous runs
Xif [ -n "${_boot}" -o -f /var/run/maudio.pid ]; then
X	exit 0
Xfi
Xtrap "rm -f /var/run/maudio.pid" 1 2 10 13 14 15 EXIT
Xecho $$ >/var/run/maudio.pid
X
X. /etc/rc.subr
X
Xname="maudio"
Xrcvar=`set_rcvar`
Xload_rc_config $name
X
X: ${maudio_enable="NO"}
X
Xcommand="%%PREFIX%%/bin/dfu-util"
Xstart_cmd="maudio_start"
Xfirmware_dir="%%PREFIX%%/share/maudio"
Xrequired_modules="uhub/uaudio"
Xrequired_dirs=$firmware_dir
Xrequired_files=$command
X
Xmaudio_start()
X{
X	local firmware dev idVendor idProduct
X
X	if [ -n "${1}" -a -n "${2}" ]; then
X		idProduct=${2}
X		dev=${1}
X	else
X		for dev in /dev/ugen*; do
X			dev=${dev#/dev/*}
X			eval $( /usr/sbin/usbconfig -d ${dev} dump_device_desc \
X				|grep -E "idVendor = 0x0763|idProduct = 0x280[34568]" |tr -d " " )
X			if [ -n "${idVendor}" -a -n "${idProduct}" ]; then
X				break;
X			fi
X			idVendor=""
X			idProduct=""
X		done
X	fi
X
X	case "${idProduct}" in
X	0x2803)
X		firmware=${firmware_dir}/ma003101.bin
X		;;
X	0x2804)
X		firmware=${firmware_dir}/ma004103.bin
X		;;
X	0x2805)
X		firmware=${firmware_dir}/ma005101.bin
X		;;
X	0x2806)
X		firmware=${firmware_dir}/ma006100.bin
X		;;
X	0x2808)
X		firmware=${firmware_dir}/ma008100.bin
X		;;
X	*)
X		err 1 "Unknown product ID" 1>&2
X		;;
X	esac
X
X	${command} -R -t 64 -d 0x0763:${idProduct} -D ${firmware} 2>/dev/null 1>&2
X	/usr/sbin/usbconfig -d ${dev} reset
X}
X
Xrun_rc_command $*
c4a79cc274f425a7b1b583f95e7ac47e
echo x - madfufw/files/maudio-devd.conf.in
sed 's/^X//' >madfufw/files/maudio-devd.conf.in << 'b93a2cc3dfbf4c4c3d5e953e09fb66d2'
Xattach 100 {
X	match "device-name" "ugen[0-9]+\.[0-9]+";
X	match "vendor" "0x0763";
X	match "product" "0x280[34568]";
X	action "%%PREFIX%%/etc/rc.d/maudio start $device-name $product";
X};
b93a2cc3dfbf4c4c3d5e953e09fb66d2
echo x - madfufw/Makefile
sed 's/^X//' >madfufw/Makefile << '9cbeff1bda800e52fb918411666c3b0b'
X# New ports collection makefile for:   alsa-lib
X# Date created:                July 6, 2010
X# Whom:                        Aragon Gouveia <aragon at phat.za.net>
X#
X# $FreeBSD: ports/audio/alsa-lib/Makefile,v 1.1 2010/06/05 12:43:24 fluffy Exp $
X#
X
XPORTNAME=	madfufw
XPORTVERSION=	1.0
XCATEGORIES=	audio
XMASTER_SITES=	SF/usb-midi-fw/madfu-firmware/1.2/
XDISTFILES=	madfuload-1.2.tar.gz
X
XMAINTAINER=	aragon at phat.za.net
XCOMMENT=	M-Audio DFU Firmware for Transit, Ozone, Sonica, MobilePre
X
XRUN_DEPENDS=	${LOCALBASE}/bin/dfu-util:${PORTSDIR}/comms/dfu-util
XWRKSRC=		${WRKDIR}/madfuload-1.2
XPLIST_FILES=	share/maudio/ma003101.bin \
X		share/maudio/ma004103.bin \
X		share/maudio/ma005101.bin \
X		share/maudio/ma006100.bin \
X		share/maudio/ma008100.bin \
X		etc/devd/maudio-devd.conf
XPLIST_DIRS=	share/maudio
XUSE_RC_SUBR=	maudio
XSUB_FILES=	maudio-devd.conf pkg-message
XNO_BUILD=	yes
X
Xdo-install:
X	@${MKDIR} ${LOCALBASE}/share/maudio && \
X	${INSTALL_DATA} ${WRKSRC}/ma003101.bin ${WRKSRC}/ma004103.bin \
X		${WRKSRC}/ma005101.bin ${WRKSRC}/ma006100.bin \
X		${WRKSRC}/ma008100.bin ${LOCALBASE}/share/maudio
X	@${INSTALL_SCRIPT} ${WRKDIR}/maudio-devd.conf ${LOCALBASE}/etc/devd
X
Xpost-install:
X	@${ECHO_MSG} ""
X	@${CAT} ${PKGMESSAGE}
X	@${ECHO_MSG} ""
X
X.include <bsd.port.mk>
9cbeff1bda800e52fb918411666c3b0b
echo x - madfufw/pkg-descr
sed 's/^X//' >madfufw/pkg-descr << '116dae28c2c55af3ccba893c83fb50a1'
XUserland scaffolding to load M-Audio firmware into supported
Xsound devices upon attachment.  Supported devices:
X
X* Sonica
X* Ozone
X* MobilePre USB (some newer models don't need this port)
X* Transit 
X
XBased upon the madfuload package.
X
XWWW: http://usb-midi-fw.sourceforge.net/
116dae28c2c55af3ccba893c83fb50a1
echo x - madfufw/distinfo
sed 's/^X//' >madfufw/distinfo << '38087a8ea0b3172d479b52592dd881e7'
XMD5 (madfuload-1.2.tar.gz) = 6a2c68021e2e05c4eb35e67158b9414e
XSHA256 (madfuload-1.2.tar.gz) = 324d0a55f73c82ad48635a94a8d72277a2280030df6d036eafe3498c933dee6d
XSIZE (madfuload-1.2.tar.gz) = 78506
38087a8ea0b3172d479b52592dd881e7
exit
--- madfufw.shar ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list