Google
 

Open Sound System
The Hitchhiker's Guide to OSS 4.1 Internals

Do you have problems with sound/audio application development? Don't panic! Click here for help!

adrv_sync_control

Audio driver method for handling synchronisation groups

Usage

int (*adrv_sync_control) (int dev, int event, int mode);

Description

The first paramater (dev) is anways the audio engine number which is an index to the audio_engines table. The driver can use the audio_engines entry to find out some of the current parameters. In particular the devc, portc, portc_play and portc_record fields can be used to locate the driver defined structures for the audio engine.

This audio driver method is used for the synchronisation group feature of the OSS API (SNDCTL_DSP_SYNCGROUP and SNDCTL_DSP_SYNCSTART). It will get called three times when the device is to be started. This functionality is similar to the adrv_trigger entry point routine.

parameters

StepDescription
event Step number of the operation (SYNC_PREPARE or SYNC_TRIGGER.
mode This parameter is a direction mask for the operation. The PCM_ENABLE_OUTPUT and PCM_ENABLE_INPUT bits are used.

This method will be called three times with different event values. The first call (SYNC_ATTACH) will be made when the device is joined to a sync group. This may happen hours before the the sync group gets actually started. No audio data has been written by the application yet (in case of output). Second invocation (SYNC_PREPARE is used to tell the driver to do any time consuming preparations. The third invovcation (!code SYNC_TRIGGER

is used when the requested operations should be started.}

The idea is that all time consuming preparations are performed during the first invocation. The second invocation should just start all the devices that have been prepared during the first step. This should be performed as quickly as possible. The second call will be made for all sub-devices managed by this driver but the first call should activate all of them (if possible). The subsequent calls with event==SYNC_TRIGGER should be ignored by the driver.

Return value

Audio driver entry point should return 0 if the call was successful. Negative return value (-errno) means that an error has occurred. However some of the functions have void type and they don't return any value.

Referenced by

audio/oss_audio_core.cAudio core functionality of OSS
include/ossddk.hSource file oss-current/kernel/framework/include/ossddk/ossddk.h
oss_envy24ht/oss_envy24ht.cVIA ENVY24HT chipset driver.
oss_madi/oss_madi.cDriver for RME MADI and AES32 audio interfaces
oss_envy24/oss_envy24.cDriver for IC Ensemble ENVY24 based audio cards.


Copyright (C) 4Front Technologies, 2007. All rights reserved.
Back to index OSS web site