freesci-develop
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [freesci-develop] Questions about the sound system


From: Christoph Reichenbach
Subject: Re: [freesci-develop] Questions about the sound system
Date: Thu, 10 Jan 2008 12:04:35 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

Jordi,

On Thu, Jan 10, 2008 at 05:10:18PM +0100, Jordi Vilalta wrote:
> I'm trying to get the big picture of how the FreeSCI sound system
> works, and I have several questions. I've just done a high level look
> at this and it looks like there are two separate paths:
> 
> For native sequencers:
>   realtime_player -> seq -> device

  (note that this is a push model)

> And for emulated sequencers:
>   polled_player -> soft_seq -> mixer -> pcm_device

  (note that this is a pull model)

> Is this right?

  As far as music is concerned, the above is correct.

> What I may be missing here is how sound effects are played when using
> a native sequencer. Is it sent by the realtime_player to the mixer? Is
> it a completely different path?

  All sound effects are sent to the mixer (which resamples them and
mixes them).  The mixer supports arbitrarily many ``feeds''.  One of
these is the soft_seq (unless you're using native sequencers), but any
sound effect temporarily adds another feed.

> Then, for each part:
> - the iterator is the one who decides what has to be played and sends
>   it to the corresponding player.

  Yes.

> - the player gets the result from the sequencer and sends it to the device

  No.  The player provides the API for playing (stopping, pausing)
song iterators.  It grabs data from the _song iterators_.  Note that
sound effects are usually embedded into songs; consequently, part of
the duties of a player is to call the main sfx API to play sound
effects if it encounters an SI_PCM event.

  It does send the data to some device, though.

> - the sequencer prepares the device midi commands

  Sometimes.  The sequencer accepts MIDI commands and translates them
into appropriate data for the respective device.  (For the MT-32, it
leaves the events untranslated.  For the adlib emulator, it modifies
some state.)

> - the device just plays the midi commands

  Yes.

> - the soft_seq outputs the pcm stream corresponding to the emulated
>   sound
  Yes.

> - the mixer just mixes pcm streams and sends the output to the pcm_device

  Yes.

> - the pcm_device just plays a pcm stream

  Yes.

> Am I missing something, or did I get it totally wrong? Any comment
> will be welcome.

  It's been a while, but I think that you have a pretty good idea of
how it works.  I hope that I've filled in the biggest gaps above!  I
do apologise for never properly documenting the sound subsystem-- this
was on my to-do list, but I never got around to it.


-- Christoph




reply via email to

[Prev in Thread] Current Thread [Next in Thread]