Menu

#20 Hardware OPL2 output

open
nobody
None
5
2007-02-14
2007-02-14
Anonymous
No

According to the help of Adplay/UNIX, the only output it can give is the emulated output. I was wondering if it could be possible (just like the Winamp plugin) to write Adplay's output to a hardware OPL2 chip. Is this not implemented because there is no need, or does the Linux kernel not allow for the kind of operations, or is it a driver hassle?

I would like to experiment with different OPL2 chips, and UNIX/Linux would be my platform of choice.

Discussion

  • Simon Peter

    Simon Peter - 2007-02-14

    Logged In: YES
    user_id=31101
    Originator: NO

    It can be done. Linux on i386 has the outb family of functions, which can write directly to the hardware when the program runs as root. This could easily be added to the AdPlug core library, but has been left out due to security implications and the narrow platform constraints (works only on i386). But it would only require re-enabling it in the AdPlug core library and adding a call to the Realopl object to AdPlay/UNIX.

    ALSA has a special, but undocumented interface to access the OPL2/3 chips on any platform without the need for root capabilities (the HWDep interface, if i remember right). This is planned to be incorporated into AdPlay/UNIX as a special output method, but still hasn't yet because it is a hassle without documentation.

    The commercial release of OSS also provides a special interface, which is documented, but not supported by the ALSA OSS emulation layer and since it is only in the commercial version of OSS, this option is not considered for AdPlug.

     
  • Metalliferous

    Metalliferous - 2007-05-31

    Logged In: YES
    user_id=1670793
    Originator: NO

    There seems to be a driver for Adlib FM cards available in ALSA:

    See http://www.ussg.iu.edu/hypermail/linux/kernel/0603.3/0772.html
    and alsa-kernel/isa/adlib.c in ALSA source.

     
  • Zbigniew Luszpinski

    Logged In: YES
    user_id=660521
    Originator: NO

    /dev/sequencer na kartach z OPL pozwala na syntezę FM. Jest to specjalny tryb sequencera.

     
  • Zbigniew Luszpinski

    Logged In: YES
    user_id=660521
    Originator: NO

    Ooops I forgot to write in English. Here it is:
    On hardware OPL sound cards FM synthesis is available via /dev/sequencer
    Special option can be set for /dev/sequencer to enable direct FM OPL access.

     
  • Simon Peter

    Simon Peter - 2007-11-02

    Logged In: YES
    user_id=31101
    Originator: NO

    /dev/sequencer does allow the direct setting of FM OPL registers for MIDI instruments, however this is not enough for AdPlug. AdPlug requires the dynamic modification of OPL register settings, while instruments are playing. Also, it requires complete access to all non-instrument registers. All this is not possible with /dev/sequencer.

     
  • Metalliferous

    Metalliferous - 2007-11-02

    Logged In: YES
    user_id=1670793
    Originator: NO

    Do you mean these functions?
    http://www.alsa-project.org/alsa-doc/alsa-lib/fm_8c.html

     
  • Metalliferous

    Metalliferous - 2007-11-02

    Logged In: YES
    user_id=1670793
    Originator: NO

    Sorry for the doublepost but I also found this:
    'The FM OPL3 is still used on many chips (mainly for backward compatibility). ALSA has a nice OPL3 FM control layer, too. The OPL3 API is defined in <sound/opl3.h>.

    FM registers can be directly accessed through direct-FM API, defined in <sound/asound_fm.h>. In ALSA native mode, FM registers are accessed through Hardware-Dependant Device direct-FM extension API, whereas in OSS compatible mode, FM registers can be accessed with OSS direct-FM compatible API on /dev/dmfmX device.'

    http://www.alsa-project.org/~tiwai/writing-an-alsa-driver/c1294.htm

    It was mentioned earlier that the ALSA OPL interface was lacking documentation, but OSS documentation is available for OPL access. Is it possible to write code to access the OSS direct-fm /dev/dmfmx device through ALSA? This would make access to hardware OPL a lot easier in Linux.

     
  • Simon Peter

    Simon Peter - 2007-11-02

    Logged In: YES
    user_id=31101
    Originator: NO

    ALSA direct-fm API is still being worked on (due to lack of docs, as you mentioned). /dev/dmfmX is only available in the commercial version of OSS and has been omitted from ALSA.

     

Log in to post a comment.