This situation is normal for asynchronous sources, and the byte stuffing
algorithm used generates unpleasant noise.
Also take care of scattered data buffer and do memcpy correctly.
This should fix PR kern/16385.
initialization to it from uaudio_chan_set_param(). uaudio_set_params()
calls uaudio_chan_init().
These are required because bytes_per_frame is used in
uaudio_round_blocksize(), which is called before uaudio_set_params().
Noise of 4ch playing disappears by this change. 6ch playing still has
cyclic noise.
- Simplify the source
- Accept any convresions such that sample_rate < hw_sample_rate
uaudio.c:
- Request the above conversion. This is needed for 4ch-only devices to
play monaural/stereo data.
http://mail-index.netbsd.org/tech-kern/2002/03/04/0005.html
auconv.c: Add conversion functions
audio.c: Sample alignment, calling conversion functions, etc.
audio_if.h: Add four hw_* members to "struct audio_params"
audiovar.h: Add conversion buffers, etc.
auich and uaudio: Add conversion request code to *_set_params().
If the device is unidirectional, just ignore parameters in the other direction.
(XXX We need a better way of dealing with this.)
Only set curaltidx if we're setting usemode.
This makes both the Altec Lansing speaker set and the Telex bidirectional frob
work again.
* Only match an alternate which is in the same direction.
* Use 16-bit ulaw and alaw conversions for output, if possible.
* Store the interface handle in the `alternate' table, so we use the right
interface when creating pipes for devices with both play and record.
Record doesn't seem to actually return any data from the Telex frob, but at
least it doesn't crash or return EIO now.
XXXXXXXX
This is a big f*cking hack. Play and record need to be separated completely
if this code is ever going to even pretend to support full duplex.
UQ_AU_NO_FRAC for audio devices that cannot handle adjustment for fractional
sample size.
UQ_AU_INP_ASYNC for input devices that claim to be adaptive, but are in fact
asynchronous (an easy mistake to make unless you read the specs carefully :)