2
.\" Copyright (c) 2005, 4Front Technologies 2005\&.
3
.TH ossddk_adev_set_buflimits 9ossddk "12 Sep 2005" "SunOS 5.10" "OSS DDK Services"
5
ossddk_adev_set_buflimits \- Set fragment size constraints
9
#include <sys/soundcard.h>
11
#include <sys/ossddk/ossddk.h>
14
\fBvoid\fR ossddk_adev_set_buflimits(\fBint \fIdev\fP, \fBint \fImin_fragment\fP, \fBint \fImax_fragment\fP);
18
Open Sound System specific (OSS 4.0 DDK)\&.
28
OSS audio device number.
36
Minimum fragment size (in bytes) supported by the device. Value of 0 means no limit.
44
Maximum fragment size (in bytes) supported by the device. Value of 0 means no limit.
49
Fragment size of an audio stream is the number of bytes (not samples) to be played
50
or recorded between interrupts genererated by the device. In other words the device
51
will generate an interrupt exactly at the fragment boundaries. The audio core of OSS
52
will select the fragment size. However if the device has any size restrictions it can
53
inform the audio core about them. In most cases there are no restrictions and the driver
54
should not call this function at all.
55
The minimum fragment size must be smaller or equal to the maximum.
57
For example many devices can not support fragment sizes larger than one 4k page. In
58
this case the driver can call \fIossddk_adev_set_buflimits(device_num, 0, 4096)\fR.
60
This function can be called immediately after installing the audio device using
61
\fIossddk_install_audiodev(9ossddk)\fR. Alternatively it can be called in driver's open,
62
set_speed, set_channels and/or set_format entry points. If the latter method is used
63
then the open entry point must restore the default value.
65
Changing the fragment size limits when (or after) the prepare_for_output/prepare_for_input
66
entry point is called doesn't have any effect. If the fragment size depends on the
67
sampling rate or the other parameters then the set_speed, set_channels and set_format
68
driver entgry points must update the fragment size limits depending on the situation.
70
The limits should preferably be powers of 2 but this is not an absolute requirement.
71
Both limits can be the same if the device supports fixed fragment size.
75
\fIWriting Sound Device Drivers with OSS DDK\fR
76
\fIOpen Sound System Programmer's Guide\fR