* documentation on SNDCTL_DSP_SETFRAGMENT exist?
@ 2000-02-15 12:38 Britton Leo Kerin
2000-02-15 22:35 ` Eric Mitchell
2000-02-16 9:13 ` Jim Jackson
0 siblings, 2 replies; 3+ messages in thread
From: Britton Leo Kerin @ 2000-02-15 12:38 UTC (permalink / raw)
To: linux-sound
Does anyone know of any documentation of any kind (book, howto,
anything) out there which covers this feature?
Thanks,
Britton Kerin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: documentation on SNDCTL_DSP_SETFRAGMENT exist?
2000-02-15 12:38 documentation on SNDCTL_DSP_SETFRAGMENT exist? Britton Leo Kerin
@ 2000-02-15 22:35 ` Eric Mitchell
2000-02-16 9:13 ` Jim Jackson
1 sibling, 0 replies; 3+ messages in thread
From: Eric Mitchell @ 2000-02-15 22:35 UTC (permalink / raw)
To: linux-sound
http://www.4front-tech.com/pguide/audio2.html
see the section, "Selecting buffering parameters"
Britton Leo Kerin wrote:
>
> Does anyone know of any documentation of any kind (book, howto,
> anything) out there which covers this feature?
>
> Thanks,
> Britton Kerin
--
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
| Eric B. Mitchell mailto:ricdude@toad.net |
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: documentation on SNDCTL_DSP_SETFRAGMENT exist?
2000-02-15 12:38 documentation on SNDCTL_DSP_SETFRAGMENT exist? Britton Leo Kerin
2000-02-15 22:35 ` Eric Mitchell
@ 2000-02-16 9:13 ` Jim Jackson
1 sibling, 0 replies; 3+ messages in thread
From: Jim Jackson @ 2000-02-16 9:13 UTC (permalink / raw)
To: linux-sound
There's not much to cover. It is used to set the size of the buffer
fragments and how many of them you want. The only complication is
is that the fragment size is specified as the power of 2 of the size of
the fragment - e.g. for 1024byte frags the value 10 is used, 1024=2^10.
The number of buffers is held in the top 16bits of an int and the
power of 2 of the buffer fragment in the bottom 16 bits.
If /dev/dsp is open on fd, N is the number of fragments, and E is the
power of 2 of the fragment size....
int fr=(N<<16)+E;
if (ioctl(fd, SNDCTL_DSP_SETFRAGMENT , &fr) < 0) {
Error_Stuff;
}
Choosing a fragment size depends on the application. If you have somesort
of "interactive" app generating audio samples then you probably want
smallish fragments holding somewhere between 10 or 100 millisecs of
samples (depending on what you concept of interactive is :-) and as few as
possible so you don't have too much buffered ahead, yet have enough
samples buffered so you don't get breakup due to running out of samples.
If there is no "interactive" element, often a few large fragments will
suffice.
On Tue, 15 Feb 2000, Eric Mitchell wrote:
>
> http://www.4front-tech.com/pguide/audio2.html
>
> see the section, "Selecting buffering parameters"
>
> Britton Leo Kerin wrote:
> >
> > Does anyone know of any documentation of any kind (book, howto,
> > anything) out there which covers this feature?
> >
> > Thanks,
> > Britton Kerin
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-02-16 9:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-02-15 12:38 documentation on SNDCTL_DSP_SETFRAGMENT exist? Britton Leo Kerin
2000-02-15 22:35 ` Eric Mitchell
2000-02-16 9:13 ` Jim Jackson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox