From owner-freebsd-multimedia@FreeBSD.ORG Tue Apr 24 20:54:17 2007 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB26C16A401 for ; Tue, 24 Apr 2007 20:54:17 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.swip.net [212.247.154.1]) by mx1.freebsd.org (Postfix) with ESMTP id B153E13C46A for ; Tue, 24 Apr 2007 20:54:15 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [193.71.38.142] (account mc467741@c2i.net HELO [10.42.11.147]) by mailfe01.swip.net (CommuniGate Pro SMTP 5.1.7) with ESMTPA id 453435024; Tue, 24 Apr 2007 22:54:12 +0200 From: Hans Petter Selasky To: Rasmus Kaj Date: Tue, 24 Apr 2007 22:53:54 +0200 User-Agent: KMail/1.9.5 References: <200608271719.23435.hselasky@c2i.net> In-Reply-To: MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_i5mLGQNs3PTFM6p" Message-Id: <200704242253.54147.hselasky@c2i.net> X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-multimedia@freebsd.org Subject: Re: New USB MIDI driver for FreeBSD X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2007 20:54:17 -0000 --Boundary-00=_i5mLGQNs3PTFM6p Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tuesday 24 April 2007 22:15, Rasmus Kaj wrote: > >>>>> "HPS" == Hans Petter Selasky wrote on 2006-08-27: > > HPS> During the past week I have been working on USB MIDI support for > HPS> FreeBSD. I choose the simplest approach, and that was to create > HPS> a raw/direct MIDI device. > > Hi! Thanks for giving me some hope regarding MIDI on FreeBSD again! > > HPS> svn --username anonsvn --password anonsvn \ > HPS> checkout svn://svn.turbocat.net/i4b > > What version of FreeBSD was this supposed to work with? I was able to > run it with releng_6 as of about a week ago, but not talk to my midi > device [1], so I thought I'd try it with current. Unfortunatley, > there seems to have been some changes (in bus_setup_intr and > cam_sim_alloc, possibly more) in current that this code does not > reflect. Currently FreeBSD 6.x stable. You can get it working with FreeBSD 7.x also, but you need to work a little bit then. > > Is there a more up-to-date version somewhere else? Should I go back > to releng_6 and try to insert some "magic numbers" (device id) for my > device? Or is (relevant parts of) this included in current by now? > Maybe current just needs some device ids? No, the SVN version is the latest. > > By the way, what does the MIDI support have in common with the ISDN > support? Not much, except that there are USB ISDN adapters :-) By the way, when you go into the "FreeBSD.usb" folder you don't install any ISDN stuff. Also don't forget editing and running the "install_uaudio.sh". I'm just looking forward till all of my code gets committed to FreeBSD. Then you don't have to worry any more. > [1] I've got a "MIDI Mate", it is a simple gateway between a USB > connector in one end an a single pair (in / out) of midi connectors in > the other, that identifies as follows on FreeBSD current: Same here, but there are some notes. When I implemented the USB MIDI support there was no MIDI API in the kernel, so I created my own. That means you get some raw devices, /dev/umidiX.X, which I have created some utilities for in my SVN repo. So there might be some work to do, if you want to use your MIDI mate with ordinary MIDI applications. > > ugen0: 2> on uhub1 > Unknown USB device: vendor 0x0a92 product 0x1000 bus uhub1 Do a "svn update", make a new package, install it, and compile a new kernel. If you use FreeBSD 7.x, then: In /sys/dev/usb/usb_port.h, use the following: /* preliminary fix for a bug in msleep on FreeBSD, * which cannot sleep with Giant: */ #undef msleep #define msleep(i,m,p,w,t) _sleep(i,(((m) == &Giant) ? \ NULL : &(m)->mtx_object),p,w,t) After this patch you have to insert a NULL argument, to all bus_setup_intr() functions you find in the files /sys/dev/usb/*pci.c like shown below ? error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_TTY, - si_intr, sc, &ih); + NULL, si_intr, sc, &ih); Also please find attached the "/usr/src/sys/dev/sound/usb/uaudioxxx" and "/usr/src/sys/dev/sound/pcm/mixerxxx" files you need. --HPS --Boundary-00=_i5mLGQNs3PTFM6p--