# The soundcard and sequencer interface

With AgsSoundcard and AgsSequencer interface you can obtain information about output or input devices. Getting the next buffer for playback something can be achieved, too. As well reading MIDI data from current buffer is supported. Note these operations are performed all delayed in order to avoid concurrent memory access.

Latency is at most one buffer time. Operations on buffers might be performed non-blocking so the thread returns earlier than expected. This has the advantage of controlling timings and let the thread continue to do more synchronization runs. Real-time behaviour is indicated as all pending sync operations were fulfilled as the next buffer is needed.

The Advanced Gtk+ Sequencer framework implements following soundcard objects. Note to register soundcards by a sound server make use of AgsSoundServer interface. This applies to JACK, Pulseaudio and CoreAudio backend.

- AgsDevout ALSA and OSSv4 soundcard output.

- AgsDevin ALSA and OSSv4 soundcard input.

- AgsPulseDevout Pulseaudio output.

- AgsJackDevout JACK Audio Connection Kit output.

- AgsJackDevin JACK Audio Connection Kit input.

- AgsWasapiDevout Windows soundcard output.

- AgsWasapiDevin Windows soundcard input.

- AgsCoreAudioDevout macos soundcard output.

- AgsCoreAudioDevin macos soundcard input.

The Advanced Gtk+ Sequencer framework implements following sequencer objects.

- AgsMidiin ALSA and OSSv4 MIDI input.

- AgsJackMidiin JACK Audio Connection Kit MIDI input.

- AgsCoreAudioMidiin macos MIDI input.

## Gathering PCM information of soundcard

In this short example we just get some information out of AgsSoundcard by using `void ags_soundcard_pcm_info(AgsSoundcard*, gchar*, guint*, guint*, guint*, guint*, guint*, guint*, GError*)`. It tells us the card identifier, minimum and maximum supported audio channels, samplerate and buffer size.

### PCM information from AgsSoundcard

## Obtain audio buffer

Here we get audio buffer from AgsSoundcard and write some sine synth tone at 440 Hz. First we get presets from soundcard, then we fill the AgsSynthUtil struct and finally compute the sine sound using utility function.

### Get AgsSoundcard buffer

## Read from MIDI device

### Get AgsSequencer buffer