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_get_buffer_pointer

Audio driver method for getting the current DMA pointer

Usage

int (*adrv_get_buffer_pointer) (int dev, dmap_t * dmap, int direction);

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.

the adev_get_buffer_pointer method is optional and it should be implemented only by the drivers for devices that can return reliable DMA pointer.

The purpose of this method is to return the current DMA pointer (in bytes) as precisely as possible. It will get called by the audio core when the audio_inputintr or audio_outputintr functions are called by (the interrupt handler of) the driver. In addition it will get called when the application makes some ioctl calls such as SNDCTL_DSP_GETOPTR or SNDCTL_DSP_GETIPTR.

Some devices don't have reliable DMA pointer registers. Such drivers must not implement this method because erratic return values will break integrity of the audio signal. Driver developers must verify that calls of this method made during interrupt return the sample position that matches the current fragment boundary (or is at most few samples after it). The returned value must be less than the bytes_in_use firld of the dmap paremater.

Parameters

ParameterDescription
dmap Pointer to the dmap_t structure for this drection.
direction Direction of the DMA transfer OPEN_READ for recording or OPEN_WRITE for playback.

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