Commit Graph

62 Commits

Author SHA1 Message Date
toshii 350768d9f8 Don't stuff extra data when we receive data less than expected.
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.
2002-12-02 02:36:14 +00:00
kristerw bc68323a39 Correct test for busy-ness when setting parameters. 2002-10-06 10:01:08 +00:00
kent 820aca767e USB_ATTACH: Initialize sc_plachan.altidx and sc_recchan.altidx with -1. 2002-05-18 15:14:39 +00:00
kent 4cbdc3964d uaudio_set_params():
Correct a parameter of uaudio_chan_init() for recording.
  This change fixes kern/16385.
2002-04-20 17:36:16 +00:00
kent e034d9364c Clear the busy flag of an alt when a channel is closed. 2002-04-20 17:04:32 +00:00
toshii df12f106c5 Make recording functional again. 2002-04-05 16:16:43 +00:00
kent a37082a494 whitespace and folding fix. 2002-03-23 17:17:10 +00:00
kent 541b66ade5 Decrease UAUDIO_NFRAMES: 20 -> 10
This change eliminates noise of 6ch audio.
2002-03-23 16:23:20 +00:00
kent a340d0e8ea Create new uaudio_chan_init() and move sample_size/bytes_per_frame
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.
2002-03-18 14:06:08 +00:00
kent fe274639f9 aurateconv.c:
- 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.
2002-03-17 16:14:21 +00:00
kent 3ca7d89bcf uaudio_set_params(): Set conversions:
- 8bit slinear/ulinear to 16bit slinear for playing
  - 16bit slinear to 8bit slinear/ulinear for recording
2002-03-15 17:20:14 +00:00
kent 33525eb269 Accept 24bit precision. 2002-03-12 15:12:03 +00:00
kent c329c38eef Sampling rate and mono-stereo conversion described in
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().
2002-03-07 14:37:02 +00:00
simonb 72359ec83c Fix indentation botch. 2002-02-19 14:07:26 +00:00
kent 46ffcfbf95 uaudio_set_params() for mulaw:
Give priority to 16bit again in the case the device has no hardware
support for mulaw.
2002-02-14 12:55:51 +00:00
jdolecek a2803fa798 split the channel stuff into record and play parts, so that this driver is
full duplex, independent
2002-02-12 19:52:43 +00:00
kent c1b55b61ac uaudio_chan_set_param:
Take care of param->factor.

uaudio_set_params:
  Fix a problem of precision matching for mulaw/alaw with 16bit.
2002-02-11 07:10:36 +00:00
kent 4653bffb03 uaudio_set_params:
Use slinear16_to_mulaw_le() if ULAW recording is requested and the device
supports neither signed 8bit nor unsigned 8bit and supports 16bit.
2002-02-10 06:37:45 +00:00
lukem 667807e40c add RCSIDs 2001-11-13 06:24:53 +00:00
augustss 1339e88a86 Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).
2001-10-03 00:04:47 +00:00
christos 6f62797262 Don't leak memory in case of a realloc failure.
Reported by: grendel@heorot.stanford.edu (Ted U)
2001-05-12 19:18:57 +00:00
augustss cbda952879 Make sure driver attach/detach events are generated in a consistent manner. 2001-01-23 14:04:13 +00:00
augustss 1aca8405a5 Cosmetic changes. 2001-01-21 00:07:13 +00:00
augustss f6f8ab2d11 Don't #define UAUDIO_DEBUG here. 2001-01-06 12:12:24 +00:00
mycroft f73703a4a6 Set the play and record parameters separately.
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.
2001-01-04 07:05:00 +00:00
mycroft c142ce184b Several things:
* 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.
2001-01-04 06:20:49 +00:00
mycroft 6ff81e44ec No really, this is half-duplex for now. Lame. 2001-01-04 05:25:24 +00:00
mycroft ab1d9b87b0 Make some vague attempt to handle devices that do both input and output. This
probably needs more work, but at least my Telex frob can play music now.
Also, AUDIO_DEBUG -> UAUDIO_DEBUG.
2001-01-04 03:53:09 +00:00
augustss 271adbd54e Try to get rounding right when setting mixer values. 2000-12-29 14:49:28 +00:00
augustss 560f4a2254 Set the mixer delta field. 2000-12-29 13:28:41 +00:00
augustss e9853f047a Update location of specs. 2000-12-29 01:14:15 +00:00
augustss 20d1ae1adb Add two more quirks:
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 :)
2000-12-28 11:56:22 +00:00
augustss 5236b76556 Make message about ignored endpoint a little clearer. 2000-12-28 01:01:42 +00:00
augustss 7ce859b8d0 Allow 16-bit only speakers to work. 2000-10-05 01:35:07 +00:00
augustss d08216d4e2 Add a quirk for audio devices that claim to have an extension unit, but it
can't be manipulated.
2000-08-24 14:11:09 +00:00
augustss 88e928528c Unswap functiona arguments that got swapped during ANSIfication. Now
mixer controls work again.
2000-06-19 11:43:48 +00:00
augustss ed9486e158 Bring the coding style into the 80s, i.e., get rid of __P and use
ANSI prototypes and declarations.
2000-06-01 14:28:57 +00:00
thorpej f636538446 NULL != 0 2000-05-19 04:34:39 +00:00
augustss 30c20f930f Change my email address. 2000-04-27 15:26:44 +00:00
augustss a25e27e1eb Some OpenBSD portability fixes. 2000-03-29 18:24:52 +00:00
augustss 9a386a047a Do not use all xfers at the same time, this can cause problems in the HC
drivers.
2000-03-29 01:47:25 +00:00
augustss fc72e72d7d Change (almost) all static to Static. The symbol `Static' can then be defined
to `' or `static' depending on if you want to debug or not.
2000-03-27 12:33:53 +00:00
augustss 2e85384321 Some more debug when selecting sample rate. 2000-03-24 13:02:00 +00:00
augustss 7d05674ba7 Distinguish between device and interface classes.
(I finally found a document that said that they were different.)
2000-02-29 21:37:00 +00:00
augustss e922214fb2 Use NULL instead of 0. 2000-02-08 18:45:27 +00:00
augustss 4b93911b25 Generate usb events on attach and detach. 2000-02-02 13:18:45 +00:00
augustss d50156f1bd Start of implementation of UpDown processing unit control. 2000-01-16 09:32:56 +00:00
augustss 81a78604bf Implement the ENABLE control for processig units. 2000-01-06 21:13:55 +00:00
augustss 8111aaeef9 Cosmetics and a couple of diagnostic messages. 1999-12-06 21:06:59 +00:00
augustss 240991073c Generate an error message when attachment fails. 1999-11-26 01:38:40 +00:00