[DOSEMU Logo]
DOSEMU.org

| Home | | Developer Releases | | Stable Releases | | Documentation |

Home
README
Technical README
HOWTO
DANG  - 0.99
EMUfailure
Misc
Next Previous Contents

13. The Sound group of Modules

The sound code provides emulation of the SB. The actual emulation provided depends upon the support available from the kernel sound driver. Because this is very OS dependant the driver code itself is kept in architecture specifc files under src/arch/osname/dosext/sound/. Communication is via a set of interface functions and the device independant structures.

13.1 dosext/sound/sound.c Information

Maintainers:

Alistair MacDonald <alistair@slitesys.demon.co.uk>
David Brauman <crisk@netvision.net.il>
Rutger Nijlunsing <rutger@null.net>
Michael Karcher <Michael.Karcher@writeme.com>

13.2 Functions in dosext/sound/sound.c

These are the functions defined in dosext/sound/sound.c.

sb_io_read

Arguments are:

  • port - The I/O port being read from.
This handles all of the reads for the SB emulation. The value read is returned. The value of 0xFF indicates an invalid read. (assumes the ports float high when not pulled low by the hardware.)

adlib_io_read

Arguments are:

  • port - The I/O port being read from.
This handles all of the reads for the adlib (FM) emulation. The value read is returned. The value of 0xFF indicates an invalid read. (assumes the ports float high when not pulled low by the hardware.) The FM emulation is not written yet. The current plan is to use the midi emulation where available as this is the most common use for the FM sound.

mpu401_io_read

Arguments are:

  • port - The I/O port being read from.
The MPU-401 functionality is primarily provided by 'midid' - a standalone program. This makes most of the MPU-401 code simply a pass-through driver.

sb_io_write

Arguments are:

  • port - The I/O port being written to.
  • value - The value being output.
This handles the writes for the SB emulation. Very little of the processing is performed in this function as it basically consists of a very large switch() statement. The processing here is limited to trivial (1 line) items and distinguishing between the different actions and responses that the different revisions of the SB series give.

sb_dsp_write

Arguments are:

  • value - The value being written to the DSP.
The SB DSP is a complete I/O system in itself controlled via a number of data bytes. The number of bytes depends upon the function. The function to be executed is determined by the first byte. If there is no existing command then the command is stored. This then used in the switch to identify the action to be taken. When the command has supplied all of its arguments, or failed, then the command storage is cleared. Each DSP function is responsible for clearing this itself. Again, this function relies on other functions to do the real work, and apart from storing details of the command and parameters is basically a large switch statement.

13.3 Remarks in dosext/sound/sound.c

Write silence could probably be implemented by setting up a "DMA" transfer from /dev/null - AM

13.4 Items for Fixing in dosext/sound/sound.c

The file header needs tidying up a _LOT_ ! */

-----

Adlib status reads are unimplemented */

-----

Advanced adlib reads are unimplemented */

-----

CMS Writes are unimplemented.

-----

DSP Status is unimplemented

-----

Adlib Waveform tests are unimplemented */

-----

Advanced Adlib register writes are unimplemented */

-----

Advanced Adlib data writes are unimplemented */

-----

SB Midi is Unimplemented

-----

Sine Generation is unimplemented

-----

AUX Status is Unimplemented

-----

Stero Input is no implemented

-----

ADC is Unimplemented

-----

Stopping Auto-Init DMA is not implemented

13.5 arch/linux/dosext/sound/linux_sound.c Information

Maintainers:

Alistair MacDonald <alistair@slitesys.demon.co.uk>
David Brauman <crisk@netvision.net.il>
Michael Karcher <Michael.Karcher@writeme.com>

13.6 base/dev/dma/dma.c Information

Maintainers:

Alistair MacDonald <alistair@slitesys.demon.co.uk>
David Brauman <crisk@netvision.net.il>

13.7 Remarks in base/dev/dma/dma.c

**** WARNING **** This Code _HAS_ changed.

-----

The Emulated DMA channels are provided by using files and writes. This means that they are easy to track. It might cause problems when attempting to interface to the REAL DMA controller. (Necessary to talk to hardware which uses DMA.)

Note that DMA controller 2 uses word granular addressing and controller 1 uses byte granular address ... this simplifies the code !

-----

I think that DREQ should only be set on auto-init if we are the reading portion.

13.8 Items for Fixing in base/dev/dma/dma.c

: Pipe Creation failed. Lets hope that it times out !

-----

: Cascade Mode Reads are not supported

-----

: The Verify Mode is not supported

-----

: The Invalid Mode is not supported (!)


Next Previous Contents
 
The DOSEMU team