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_open

Audio driver method for opening the device

Usage

int *adrv_open (int dev, int mode, int open_flags);

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 driver method is called by the audio core when the audio engine is being opened. The purpose of this callback is to make sure that the audio engine and the device resources required by it are free for use. The driver should mark all the required resources as busy. The audio core has no global knowledge about engine availability because the engine may share resources with some other audio engines that belong the same devices. In addition some external modules (cuckoo) may have opened the same engine bypassing the audio core.

When the audio engine is no longer required by the audio core the adrv_close entry point will be called.

Parameters

ParameterDescription
mode Open mode. Bit mask of OPEN_READ and OPEN_WRITE.
open_flags See the description of the open_flags in the documentation for adev_t.

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


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