VoxWare Midi Driver for a Serial Port and Newmidi Midi Sequencer/Intreface Drivers on FreeBSD

Seigo Tanimura and Tsuyoshi Iguchi

English|Japanese

sbc bridge driver is now mandatory for SB cards. (3rd Jan 2000)

Both PnP and non-PnP cards are now driven by sbc bridge driver.

The bridge drivers have been merged into -current. (22nd Nov 1999)

The bridge drivers for Sound Blaster, GUS and CS461x/428x are now in -current.

TOC

  1. Introduction: What does this drive?
  2. Required Hardwares
  3. Installing Driver
  4. Framework Document
  5. Miscellaneous Notes
  6. Requests & Comments

  1. Introduction: What does this drive?
  2. This is the VoxWare midi driver for serial ports and Newmidi midi driver suite. The one for VoxWare is ported from Linux to FreeBSD. Tsuyoshi Iguchi-san has made a great effort for the initial port against 3.1-STABLE VoxWare, and I(Seigo Tanimura) have ported it to 4.0-CURRENT VoxWare, continuing further work on Newmidi.

    With this driver, you plug your midi module with a computer port into the serial port to use playmidi, rosegarden and other popular midi players and tools for VoxWare. I tried playing a midi sequence with heavy exclusives using playmidi to get NO latency on the tempo at all like sbmidi. Also, you get to have your favorite tune with Luigi's new audio driver.

    Tsuyoshi-san and I are working to merge his driver into CURRENT. We would like anyone interested to have a review on our work. Thanks in advance, and have a nice tune!

    Back to the top

  3. Required Hardwares
    1. PC powered by FreeBSD 3.x-{RELEASE, STABLE} or 4.0-CURRENT (preferably)
    2. You should have already got one, I hope.

    3. Sound card and/or midi interface card
    4. Supported Cards:

    5. Midi module and/or instrument
    6. Midi modules and instruments can be connected to your PC via an MPU401 midi interface. Most modern midi modules including Roland SC-{55,88} series have a {computer, host, etc} port. You can connect them to a serial port. A {computer, host, etc} port looks quite different from an ordinary common midi port, rather like a serial port on a Mac(on Roland's modules). The {computer, host, etc} port shoule be capable to receive at a bitrate of 38.4kbps.

    7. Midi cable
    8. If you are using a midi interface other than 16550.

    9. Cable for serial port
    10. If you would like to use a serial port, you need a cable to connect your midi module to your PC. For further information, please contact the manufacturer of your midi module.

    Back to the top

  4. Installing Driver
    1. Fetch the patch.
    2. We have the patches against 3.1-STABLE and 4.0-CURRENT at this moment.

    3. For 3.1-STABLE(and 3.x, hopefully):
    4. http://www.eie.yz.yamagata-u.ac.jp/~a95516/zinnia/hack/rsmidi/uart16550patch.tar.gz http://www.naklab.dnj.ynu.ac.jp/~tanimura/freebsd-serialmidi/patches/uart16550-31stable-19990511.diff.gz(MFC up to uart16550-19990509.diff.gz, reported to reboot sometimes)
      http://www.sfy.gr.jp/~zinnia/archives/uart16550-stable.19990609.patch.gz(MFC up to uart16550-19990605.diff.gz)

    5. For 4.0-CURRENT(pre-new-bus):
    6. http://www.eie.yz.yamagata-u.ac.jp/~a95516/zinnia/hack/rsmidi/uart16550.egcsfixed.diff.gz

    7. For 4.0-CURRENT(post-new-bus):
    8. Old ones for 4.0-CURRENT(post-new-bus):
    9. http://www.eie.yz.yamagata-u.ac.jp/~a95516/zinnia/hack/rsmidi/uart16550-19990420.diff.gz(on new-bus merge)
      http://www.naklab.dnj.ynu.ac.jp/~tanimura/freebsd-serialmidi/patches/uart16550-19990424.diff.gz(sioreg.h has moved to sys/isa)
      http://www.naklab.dnj.ynu.ac.jp/~tanimura/freebsd-serialmidi/patches/uart16550-19990501.diff.gz(forgot to have the desert, i386/isa/sound/{midi_synth, midibuf}.c, submitted by: Juergen Lock <nox@jelal.kn-bremen.de>)
      http://www.naklab.dnj.ynu.ac.jp/~tanimura/freebsd-serialmidi/patches/uart16550-19990509.diff.gz(LGSND now has a tune! Hooray!)
      http://www.naklab.dnj.ynu.ac.jp/~tanimura/freebsd-serialmidi/patches/uart16550-19990517.diff.gz(OPL3 synthesizer now works under LGSND)
      http://www.naklab.dnj.ynu.ac.jp/~tanimura/freebsd-serialmidi/patches/uart16550-19990523.diff.gz(Implemented the missing ioctls and the callbacks, more use of flags)
      http://www.naklab.dnj.ynu.ac.jp/~tanimura/freebsd-serialmidi/patches/uart16550-19990605.diff.gz(OPL now uses pnp probe/attach, writeraw and readraw have moved to synthdev_info)
      http://www.naklab.dnj.ynu.ac.jp/~tanimura/freebsd-serialmidi/patches/uart16550-19990619.diff.gz(HEADS UP: PnP for OPL3 will not work until newbusification completes! midi(4) and seq(4) have mostly moved to their own source files, preparing to newbusify)
      http://www.naklab.dnj.ynu.ac.jp/~tanimura/freebsd-serialmidi/patches/newmidi-19990627.diff.gz(HEADS UP: the major number for midi(4) and seq(4) has changed! We now use newbus, and will no longer depend on pcm(4).)
      http://www.naklab.dnj.ynu.ac.jp/~tanimura/freebsd-serialmidi/patches/newmidi-19990706.diff.gz(MPU401 now works. A fine timer at a period of 156us is introduced. New ioctl(2)s MIO{S,G}PASSTHRU joined, to allow passing midi messages through the driver when not busy.)

    10. Manuals:
    11. http://www.naklab.dnj.ynu.ac.jp/~tanimura/freebsd-serialmidi/midimanual.tar.gz(nroff man pages for midi(4) and seq(4))

    12. Patch your kernel source.
    13. Enable/disable the workaround for EMU8000 on SB AWE series. (from uart16550-19990517.diff.gz up to uart16550-19990619.diff.gz on 4.0-CURRENT only)
    14. On an SB AWE card, the OPL3 will not sound if the EMU8000 chip is left alone. I have a quick hack to enable and initialize the EMU8000 so that the OPL3 will be audible. For newmidi-19990627.diff.gz and later, all you have to do is to configure a midi device for an EMU8000.

      In sys/i386/isa/snd/opl.c, you have something like this:

      #define EMU8K_HACK_PORT 0x620

      If you have an EMU8000 at the port of 0x620, leave the line unchanged. If you do not have an EMU8000 (SB16, etc), comment out the line. If the EMU8000 is at the port other than 0x620, change the value appropriately.

    15. Modify your kernel config.
      1. If you use a serial port to output midi signal, comment out the sio device to use for midi output, eg:
      2. #device sio0 at isa? port "IO_COM1" flags 0x10 tty irq 4

        Or disable the sio device, eg:

        device sio0 at isa? disable port "IO_COM1" flags 0x10 tty irq 4

      3. Add the devices to use. The device name is 'uartsio' for a VoxWare serial port and 'midi' for all of the Newmidi midi drivers.
      4. # Would you like VoxWare?
        controller snd0 # Do not forget this!
        device uartsio0 at isa? port 0x3f8 irq 4

        # Or Newmidi?
        controller pnp0 # PnP support for ISA

        # Non-PnP
        device midi0 at isa? port 0x3f8 irq 4 # Serial port.
        device midi1 at isa? port 0x388 # OPL3 synthesizer.
        device midi2 at isa? port 0x620 # EMU8000 wavetable synth, only to make OPL sound.
        device midi3 at isa? port 0x330 # MPU401, irq is autodetected.

        # PnP
        device midi0 # This is enough.

        # Bridge drivers for ISA PnP/PCI cards.
        # Do not forget pcm and midi as well.
        device sbc0 # Creative SoundBlaster ISA PnP/non-PnP
        device gusc0 # Gravis UltraSound ISA PnP
        # Configure THIS if your are using a GUS non-PnP!
        device csa0 # Crystal Semiconductor CS461x/428x PCI

        pseudo-device seq 1 # This is the sequencer.

        The port and the irq for {uartsio0, midi*} may vary, of course.

      5. If you are using a pnp card on a pre-newbus box, configure your device in /kernel.config. eg:
      6. pnp 1 0 os enable irq0 5 drq0 1 drq1 5 port0 0x220 port1 0x330 port2 0x388

        Under newbus, this is done automatically by the pnp driver.

    16. Make your new kernel, install it and reboot your box as usual.
    17. Remake the device nodes for the midi driver. (For newmidi-19990627.diff.gz up to newmidi-19991023.diff.gz)
    18. In order to allow configuring pcm(4) and midi(4)/seq(4) independently, midi(4) and seq(4) have grabbed the new major number. It is 200 at this moment, going to change once more when I get to grab the official one. You need to remake the device nodes for them, eg:

      # cd /dev
      # rm midi* sequencer*
      # mknod midi0 c 200 2 ; chmod 666 midi0
      # mknod midi1 c 200 18 ; chmod 666 midi1
      # ln -s midi0 midi
      # mknod sequencer0 c 200 1 ; chmod 666 sequencer0
      # ln -s sequencer0 sequencer
      # mknod midistat c 200 6 ; chmod 666 midistat

    19. cat(1) /dev/midistat for newmidi-19990627.diff.gz and later, or /dev/sndstat otherwize. You should have something like this with VoxWare:
    20. Card config:
      (snip)
      16550 UART Midi at 0x3f8 irq 4

      Midi devices:
      0: SoundBlaster 16 Midi
      1: uart16550A MIDI

      Or the following thing with Newmidi:

      FreeBSD Midi Driver (newmidi) Oct 24 1999 16:15:05
      Installed devices:
      midi0: <16550 uart midi> at 0x3f8 irq 4
      midi1: <CS461x Midi Interface> at irq 19
      midi2: <SB Midi Interface> at 0x330 irq 5
      midi3: <SB OPL FM Synthesizer> at 0x388
      midi4: <Creative SB32 (CTL0042) PnP Wavetable Synthesizer> at 0x620, 0xa20, 0xe20
      seq: 1 unit(s) configured.

      FreeBSD Audio Driver (newpcm) Oct 24 1999 16:15:23
      Installed devices:
      pcm0: <CS461x PCM Audio> at irq 19 (1/1 channels duplex)
      pcm1: <SoundBlaster 16 4.13> at io 0x220 irq 5 drq 1:5 (1/1 channels duplex)

      Check the messages in italic.

    21. That's it!

    Back to the top

  5. Framework Document
  6. See this page. The document is under construction.

    Back to the top

  7. Miscellaneous Notes
  8. The architecture of sound card bridge drivers(part of a mail to Doug Rabson) Note: sbcard is the former name of sbc.

  9. Requests & Comments
  10. You can either e-mail directly to Tsuyoshi-san or me, or have a discussion on freebsd-hackers/ freebsd-multimedia.

    Back to the top

Back to my page

$Id: index.html,v 1.34 2000/01/03 12:00:01 tanimura Exp $