Commit Graph

680 Commits

Author SHA1 Message Date
Ariff Abdullah
42018dcf7b Fix no sound issues for ASUS W6F (ALC861) laptops (buggy BIOS config that
deserves its own internet memes). The trick is to force all available,
unused pins (that being advertised as "speaker") to behave as microphone
pins instead.

Reported / Tested by:	Dmitry Kutsenko <kutsenko.truebsd.org>
MFC after:		3 days
2008-04-19 22:32:23 +00:00
Ariff Abdullah
3cc4ca2ab8 - Add codec id for Sigmatel STAC9205
- Fix speaker issues with Dell Vostro 1500 (GPIO0)

Tested by:	John Wright <jwright.gmail.com>

- Apply ridiculous quirk on Asus A8X series (A8JC, A8M, A8xx, etc). These
  different laptop series share simmilar pci id, hardware codecs, etc.
  but works differently. A slight difference in connection type for
  widget #26 is used to differentiate it.

Tested by:	eric baumbach <embaumbach.gmail.com>

- Apply GPIO0 quirk for ASUS G2K laptop
- Sort ASUS ids accordingly.

Submitted by:	jkim

MFC after:	3 days
2008-04-12 15:07:32 +00:00
Ariff Abdullah
667aaea554 Limit total hardware playback channels to just 1. The reliability of
it's multi DAC / playback channels is not that good. Enabling vchans
make the bug more visible since playback allocation will look for
possible free hardware channels first (i.e: the next DAC, the very first
has been consumed by vchan mixer) which in this case has been proven faulty.

Tested by:	Dominic Fandrey <LoN_Kamikaze at gmx dot de>
URL:		http://lists.freebsd.org/pipermail/freebsd-stable/2007-December/039022.html
2007-12-14 02:16:26 +00:00
Ariff Abdullah
d155e640d8 Add speaker/headphone controls for HP Compaq DC7700 Small Form Factor PC
@ ALC262.

Submitted by:	Carlos A. M. dos Santos <unixmania at gmail dot com>
2007-12-13 15:48:45 +00:00
Ariff Abdullah
c8d361d42d nid 28 for Acer @ ALC268 should be identified as analog CD input pin,
though it doesn't provides proper (sane, valid, usable, etc) analog CD
playback due to its stripped down nature.
2007-12-13 15:44:53 +00:00
Ariff Abdullah
909f7f7f4e Disable AC97 microphone channel. Due to the channel allocation priority
that favours true hardware channel, the first instance of recording
request will grab this channel (the first channel is being used as
vchan master). In many cases, it is not really work as intended and give
false impression of broken recording.

PR:		kern/118546
MFC after:	3 days
2007-12-12 18:21:05 +00:00
Ariff Abdullah
229acba1d0 Headphone / speakers automute fixup for Acer Aspire 4710 @ ALC268 laptop.
Tested by:	Liyu, She
2007-12-02 16:38:28 +00:00
Ariff Abdullah
1cb55600a0 - Add Analog Devices AD1984 codec id.
- Enable pcbeep control for Acer + ALC268 (nid 29). Give enough (fake)
  hints so the parser will grab it and allocate "speaker" control.
- Fix regression while preparing DAC and ADC for multichannel
  format. Since playback policy is to output to every possible path,
  ensure that each DAC is started.

Reported / Tested by:	Guy Brand
2007-11-28 15:27:22 +00:00
Ariff Abdullah
fcdde99a89 Add missing MCP65 id which was accidentally removed in previous commit. 2007-11-28 02:13:20 +00:00
Ariff Abdullah
46e5fdd5af * Fix support for followings:
o Acer Aspire 4520 laptop
    - jack sensing / automute
  o Toshiba Satellite A135-S4527 laptop
    - jack sensing / automute
      Tested by: lioux
  o Apple Macbook 3 (is it?)
    - require gpio0 (for speakers) and ovref50 (for headphone)
      to make it works
    - jack sensing / automute
      Tested by: Ed Schouten
* Add Nvidia MCP67 controller ids.
* Be sensible about simmilar controller with multiple pci ids.
* Connect unused DAC/ADC to stream#0 rather than forcing each of them
  managing their own stream.

MFC after:	3 days
2007-11-21 11:39:27 +00:00
Ariff Abdullah
8b18769048 Limit total playback channels to just 1, for ALi M5451.
The reliability of it's multi DAC / playback channels is
not that good. Enabling vchans make the bug more visible
since playback allocation will look for possible free
hardware channels first (i.e: the next DAC, the very first
has been consumed by vchan mixer) which in this case has
been proven faulty.

Reported / Tested by:	Sascha Klauder
MFC after:		3 days
2007-11-10 04:32:50 +00:00
Ariff Abdullah
ee2b7497ea Add support for trimmed down version of ATI SB600 AC97 audio
controller.

URL:		http://www.ipc2u.de/catalog/P/PE/36486.html
PR:		kern/117813
Submitted by:	Klaus Mayr
MFC after:	1 day
2007-11-04 16:03:10 +00:00
Ariff Abdullah
fd0a47907c - Gigabyte G33-S2H fixup, due to the present of multiple competing
codecs. Codec at address 0 seems purely digital, or perhaps an HDMI
  interface. Let the driver skip it and continue scanning the codecs
  starting with address 2 (Realtek ALC885).
  * Due to possibilities of future similar cases, put enough logic
    in hdac_scan_codecs() to force codec scanning starting from
    XX address via tunable "hint.pcm.%d.codec_index".

  Reported / Tested by:	Toomas Pelberg <toomasp@gmx.net>

- Trivial headphone / speaker automute fixup for Fujitsu-Siemens
  AMILO Si 1848 laptop.

  Reported / Tested by:	Ed <ed@bsd.it>

- Trivial headphone / speaker automute fixup for Fujitsu-Siemens
  Lifebook S7020D laptop.

  Reported / Tested by: Jaromir Dvoracek <jarek@ataxo.com>

- Some smart vendor trying to create interplanetary wormhole by
  screwing pci config space during their BIOS update. The side effects
  of their failure attempt includes mutilated hardware id, broken
  speaker automuting and loosing the entire analog CD connectivity,
  thus causing enough collateral damages to collapse the entire
  universe.  Move along with it.

  Please exercise extra cautious when applying BIOS updates.

  Reported / Tested by:	Pietro Cerutti <gahr@gahr.ch>
                       	- assembled laptop, based on the MSI-1034
                          (662) which is now becoming MSI-034A.

- Fix no sound issues (on headphones) for Lenovo ThinkCentre A55 due
  to global automute table entry which is not applicable for
  non-laptops.

  Reported / Tested by:	Piotr Smyrak <piotr.smyrak@heron.pl>

- Speaker mute control for HP DC7700 since the front headphone jack
  does not generate any interesting unsolicited signal/response.

  Reported / Tested by:	tyop @ irc.freenode.net

Approved by:	re (kensmith)
MFC after:	3 days
2007-10-19 15:49:39 +00:00
Kevin Lo
976b010645 Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
Ariff Abdullah
b28624fde6 Update snd_emu10kx driver with recent perforce changes (and few
other changes too).

(without any real order)

1. Use device_get_nameunit for mutex naming
2. Add timer for low-latency playback
3. Move most mixer controls from sysctls to mixer(8) controls.
   This is a largest part of this patch.
4. Add analog/digital switch (as a temporary sysctl)
5. Get back support for low-bitrate playback (with help of (2))
6. Change locking for exclusive I/O. Writing to non-PTR register
   is almost safe and does not need to be ordered with PTR operations.
7. Disable MIDI until we get it to detach properly and fix memory
   managment problems.
8. Enable multichannel playback by default. It is as stable as
   single-channel mode. Multichannel recording is still an
   experimental feature.
9. Multichannel options can be changed by loader tunables.
10. Add a way to disable card from a loader tunable.
11. Add new PCI IDs.
12. Debugger settings are loader tunables now.
14. Remove some unused variables.
15. Mark pcm sub-devices MPSAFE.
16. Partially revert (bus_setup_intr -> snd_setup_intr) since it need
    to be done independently

Submitted by:	Yuriy Tsibizov (driver maintainer)
Approved by:	re (bmah)
2007-09-12 07:43:43 +00:00
Ariff Abdullah
05cba74005 Protect against divide by zero while calculating bus speed due to
possible broken kernel timecounter.

Reported/Tested by:	silby
Approved by:		re (hrs)
MFC after:		1 day
2007-07-11 14:27:45 +00:00
Ariff Abdullah
0937dd1ec0 - Add codec id for Realtek ALC268.
- Add controller id for Intel 82801I (ICH9).
  PR:			kern/114399
  Submitted by:		Michael Fuckner <michael@fuckner.net>

- MSI support. Disable by default due to various issues with too many
  broken hardwares. MSI can be enabled through device.hints(5) or
  kenv(8) by setting "hint.pcm.%d.msi=1".
  Partially submitted by:	kevlo
                         	YAMAMOTO Taku <taku@tackymt.homeip.net>
  Tested by:			joel, kevlo, YAMAMOTO Taku

Approved by:	re (hrs)
MFC after:	3 days
2007-07-09 20:42:11 +00:00
Ariff Abdullah
8a7c4d36cb Fix stream suspend/resume activity due to its states being
clobbered by pcm channel start/stop trigger operation.

Approved by:	re (hrs)
2007-07-09 20:41:23 +00:00
Ariff Abdullah
36bc8661bf Properly unlock mutex before returning. There was a slight mishap
during last major locking cleanup.

Reported by:	Thierry Herbelot <thierry@herbelot.com>
Approved by:	re (mux)
2007-07-05 10:22:37 +00:00
Ariff Abdullah
e5ad83a7e3 - Fix input/microphone support for ASUS A8N-VMCSM series.
Submitted by:	Simon Schubert <corecode@fs.ei.tum.de>

- Defer flushing unsolicited response into taskqueue thread rather
  than handle it directly in interrupt handler, since few of its
  operations (like measuring/calibrating jack impedance) are quite
  expensive.
- Misc. debugging cleanups.

Tested by:	joel
Approved by:	re (hrs)
MFC after:	3 days
2007-07-01 17:31:20 +00:00
Ariff Abdullah
715ed548ab Fix headphone jack sensing support for Olivetti Olibook 610-430 XPSE.
Tested by:	Gonzalo Lionel Rodriguez
2007-06-18 22:39:27 +00:00
Ariff Abdullah
082f63835c Flush remaining malloc() cleanups (M_NOWAIT -> M_WAITOK). 2007-06-17 06:10:43 +00:00
Ariff Abdullah
e4e61333ff Last (again ?!?) major commit for RELENG_7, featuring total Giant
eradication in/from userland path, countless locking fixes, etc.

- General sleep call through msleep(9) has been converted to condvar(9)
  with better consistencies.
- Heavily guard every possible "slow path" entries (open(), close(),
  few ioctl()s, sysctls), but once it entering "fast path" (io, interrupt
  started), they are free to fly on their own.
- Rearrange locking sequences, resulting better concurrency and
  serialization. Large part doesn't even need locking at all, and will be
  removed in future. Less clutter, except in few places due to lock
  ordering.
- Anonymous mixer object creation/deletion to simplify mixer handling
  beyond typical mixer ioctls.
  Submitted by:		chibis (with modifications)
- Add few mix_[get|set|..] functions to avoid calling mixer_ioctl()
  directly using cryptic arguments.
- Locking fixes to avoid possible deadlock with (still under Giant) USB.
- Better simplex/duplex device handling.
- Recover mmap() functionality for recording, which has been lost
  since 2.2.x - 3.x (the introduction of newpcm). Full-duplex mmap still
  doesn't work (due to VM/page design), but people still can mmap
  both by opening each direction separately. mmaped playback is guarantee
  to work either way.
- New sysctl: "hw.snd.compat_linux_mmap" to allow PROT_EXEC page
  mapping, due to recent changes in linux compatibility layer which
  require it. All linux applications that using sound + mmap() (mostly games)
  require this to be enabled. Disabled by default.
- Other goodies.. too many, that will increase releng7 shareholder value
  and make users of releng6 (and below) cry ;)

* This commit should be atomic. If anything goes wrong (not counting problem
  originated from elsewhere), I will not hesitate to revert everything back
  within 12 hours. This substantial changes itself not a rocket science
  and the process has begun for almost 2 years, and lots of incremental
  changes are already in place during that period of time.
* Some issues does occur in snd_emu10kx (note the 'x') due to various
  internal locking issues and it is currently being worked on by chibis.

Tested by:	chibis (Yuriy Tsibizov), joel, Alexandre Vieira,
          	many innocent souls...
2007-06-16 03:37:28 +00:00
Ariff Abdullah
5d75db4f00 Drain all callout handlers during driver detach appropriately. 2007-06-14 11:13:38 +00:00
Ariff Abdullah
79b783c721 Don't push too hard waiting/looping for codec detection interrupt.
Let the interrupt do the job waking us up.
2007-06-14 11:11:06 +00:00
Ariff Abdullah
bdfbdcec6a Filter/compress the amount of channel trigger. This should reduce
much of lock/unlock contentions within the interrupt handler. Most
of these drivers only need PCMTRIG_START or STOP (ABORT).

Discussed with:		scottl
2007-06-11 00:49:46 +00:00
Ariff Abdullah
f6cdab92db - Add codec id for ALC660 [1]
- Add codec id for AD1988B, along with fixing its line-in and other
  issues (with proper quirks). [2]

Submitted by:	[1] barbara.xxx1975@libero.it
             	[2] Oliver Brandmueller ob@e-Gitt.NET
MFC after:	3 days
2007-06-10 23:01:40 +00:00
David Malone
041b706b2f Despite several examples in the kernel, the third argument of
sysctl_handle_int is not sizeof the int type you want to export.
The type must always be an int or an unsigned int.

Remove the instances where a sizeof(variable) is passed to stop
people accidently cut and pasting these examples.

In a few places this was sysctl_handle_int was being used on 64 bit
types, which would truncate the value to be exported.  In these
cases use sysctl_handle_quad to export them and change the format
to Q so that sysctl(1) can still print them.
2007-06-04 18:25:08 +00:00
Ariff Abdullah
e510f52136 Use standard pcm_get/setflags() rather than dereferencing softc while
enabling SD_F_SOFTPCMVOL or any flags.
2007-06-02 17:28:26 +00:00
Ariff Abdullah
4257f25c06 Don't rely on pcm_channel index numbering while doing sequential channel
allocation.
2007-05-30 16:15:01 +00:00
Ariff Abdullah
2ba5e1edcc - Enable soft pcm volume flag early to ensure it not being clobbered
by the subsequent mix_setdevs() and friends.
- Minor style(9) declaration arrangement nit.

Requested by:	joeld
Submitted by:	pluknet <pluknet@gmail.com>
2007-05-28 16:22:07 +00:00
Ariff Abdullah
79462204f1 Fix broken binary issues with latest gcc 4.x due to bitfield signess
mishaps for emu10k1 [1] and few other places.

Reported/Submitted/Tested by:	Ed Schouten <ed@fxq.nl> [1]
2007-05-27 20:12:51 +00:00
Joel Dahl
ccb43d8d2c Bring in a bunch of bug fixes and some code to support more chipsets.
Neither me nor Ariff have access to any of this hardware, so all tests
have been made by Konstantin and Artem.  Commit message mostly written
by Konstantin.

envy24:
- Add test code to support rear line-in input on 'Terratec DMX 6fire'
  audio card.  This code is also intended to be used in the future for
  support of cards, that have I2C-to-GPIO expanders wired between the
  control line of the audio codec and the Envy24, however such cards
  are too complex and i can't add that support without hardware sample
  of such board, i've already tried and failed.

envy24ht:
- Add support for 'AudioTrak Prodigy HD2'.
- Add support for 'AudioTrak Prodigy 7.1 XT'.
- Add support for 'ESI Juli@' (Works ok, DAC volume is hard-coded for
  the time being, so 'mixer vol ...' doesn't work, only 'mixer pcm
  ...' works). [1]
- Fix bug in the init data for M-Audio Revolution 5.1, that
  results in distorted sound.
- Add software volume control (now 'mixer pcm' works, thanks to Ariff).
- Add support for more samples rates - 176.4kHz and 192kHz.
- Fix problem with the 192kHz samples rate playback when 24.576MHz
  crystal is used on the board instead of 49.152MHz crystal.

spicds:
- Add support for Asahi Kasei flagship DAC - AK4396 (used in AudioTrak
  Prodigy HD2).

Submitted by:	Konstantin Dimitrov <kosio.dimitrov@gmail.com>
Tested by:	Artem Antonov [1]
Reviewed by:	ariff
2007-05-27 19:58:39 +00:00
Joel Dahl
ea18b1d925 Fix randomly broken playback with Fortemedia FM801 XWave PCI soundcard.
PR:		kern/98898
Submitted by:	Johannes Weiner <hnazfoo@googlemail.com>
Approved by:	ariff
2007-05-19 13:19:32 +00:00
Joel Dahl
03756ceff7 Turn off the AK452X De-emphasis filter for 44.1KHz. This should fix some
sound quality problems.

PR:		kern/112688
Submitted by:	Stefan Ehmann <shoesoft@gmx.net>
Reviewed by:	Konstantin Dimitrov <kosio.dimitrov@gmail.com>
Approved by:	ariff
2007-05-19 11:06:43 +00:00
Ariff Abdullah
a6f9c6fb5f Don't hold mutex while releasing bus resources. 2007-05-10 01:46:51 +00:00
Ariff Abdullah
3419bf5a7d Fix (or rather workaround) Intel 440MX Errata #36
- http://www.intel.com/design/chipsets/specupdt/245051.htm

AC97 Soft Audio and Soft Modem Master Abort Errata

Issue:
  Use of either soft audio or soft modem on an Intel® 82443MX PCISet
  based platform running a 100 MHz Processor System Bus and an AC97 codec
  may result in failures. The system continues to function normally while
  the AC97 hardware may not resume and may require a cold-boot to
  recover. As a result of the failure, the Master Abort Status bit will
  be set in the audio or modem function PCI header space.

Workaround:
  Force uncacheable DMA on both BDL and pcm buffers.

Tested by:	Emil Holmstr|m <emil@linux.se>
2007-05-05 09:18:05 +00:00
Ariff Abdullah
71e3af015d Miscellaneous changes and fix:
- Remove explicit call to pmap_change_attr(), since we now have proper
  and functional definition of BUS_DMA_NOCACHE.
- Enable PCI(e) bus snooping for non i386/amd64 as an alternative for
  uncacheable DMA.
- Codecs changes:
  * Analag Device -> Analog Devices, AD1988.
  * New codec: VIA VT1708 and VT1709, Realtek ALC262, ALC861-VD and
    ALC885.
  * Various fixups for Conexant Waikiki, fix recording (read: microphone)
    on various Analog Devices codecs due to vendor BIOS mess, various
    quirks for several ASUS laptops/boards.
- Fix connection list handling, closely following the specification to
  handle range of nids.
- Basic Jack sense polling infrastructure for possible hardwares with
  broken unsolicited response interrupt.

Ideas/Submitted/Tested by:	Andriy Gapon <avg@icyb.net.ua>,
                          	#freebsd-azalia, many.
2007-05-05 09:17:36 +00:00
Ariff Abdullah
53bc1d83c0 Fix use-after-free for DMA tag. Destroy DMA tag later.
Submitted by:	Yuriy Tsibizov
2007-05-04 12:38:46 +00:00
Ariff Abdullah
9d2d90cb79 Unbreak module / driver attach breakage. Both snd_envy24 and snd_envy24ht
mistakenly rely on wrong snd_spicds version.
2007-04-20 01:28:51 +00:00
Ariff Abdullah
2e334adf6a sndbuf_alloc() now accept dmaflags argument which will be forwarded to
internal bus_dmammem_alloc() for greater flexibility on setting up DMA /
page attributes.
2007-04-18 18:26:41 +00:00
Ariff Abdullah
319276aac0 Disable cmi_midiattach(). The implementation is incomplete, and causing
various interesting memory leak issues.
2007-04-08 07:52:27 +00:00
Ariff Abdullah
703c934a48 Memory leak killing spree, mostly bus_dma(9) related. 2007-03-21 18:17:03 +00:00
Ariff Abdullah
94d36aa276 Put a temporary bandaid to set/reset uncacheable DMA region (affected
on amd64 and i386) until we gain proper BUS_DMA_NOCACHE support.
(in progress).

Tested by:	rafan, infofarmer, Nguyen Tam Chinh <unixvn@gmail.com>
Tested on:	amd64, i386
2007-03-20 11:24:29 +00:00
Ariff Abdullah
19f018fb83 Destroy channel DMA tag during resource cleanup. 2007-03-19 16:06:26 +00:00
Ariff Abdullah
d2ea76fe8f Fix (another, more to come) ivar memory leak during driver detach. 2007-03-17 19:37:09 +00:00
Ariff Abdullah
1042342ad8 [stage: 8/9]
Implement CHANNEL_SETFRAGMENTS() for snd_atiixp, snd_es137x, snd_hda
and snd_via8233. CHANNEL_SETBLOCKSIZE() will basically call
CHANNEL_SETFRAGMENTS() internally using conservative blocksize /
blockcount hints. Other drivers will be converted later.
2007-03-16 17:18:17 +00:00
Ariff Abdullah
d90a1cd318 Fix support for ASUS A7T ALC882 laptop (gpio0 quirk).
Reported/Tested by:	cognet
2007-03-16 01:44:21 +00:00
Ariff Abdullah
12828031ac - Put some sanity break statement in few missing places.
- Remove NULL checking on snd_mtxcreate() (M_WAITOK) .
2007-03-15 17:35:04 +00:00
Ariff Abdullah
82199c9255 NOOP (for now) for hdac_dma_nocache(). It is a wrong way to enforce
cache coherency, besides of causing train wreck in other places
(especially on amd64, possibly on i386).

Discussed with:	kib@, rafan@
Tested by:	rafan@
2007-03-15 17:23:38 +00:00
Ariff Abdullah
4582b3a100 Fix severe out-of-bound mtx "type" pointer, causing WITNESS refcount
confusions and panic provided that the following conditions are met:

  1) WITNESS is enabled (watch/trace).
  2) Using modules, instead of statically linked (Not a strict
     requirement, but easier to reproduce this way).
  3) 2 or more modules share the same mtx type ("sound softc").
     - They might share the same name (strcmp() == 0), but it always
       point to different address.
  4) Repetitive kldunload/load on any module that shares the same mtx
     type (Not a strict requirement, but easier to reproduce this way).

     Consider module A and module B:
     - From enroll() - subr_witness.c:
       * Load module A. Everything seems fine right now.
         wA-w_refcount == 1 ; wA-w_name = "sound softc"
       * Load module B.
       * w->w_name == description will always fail.
         ("sound softc" from A and B point to different address).
       * wA->w_refcount > 0 && strcmp(description, wA->w_name) == 0
       * enroll() will return wA instead of returning (possibly unique)
         wB.
         wA->w_refcount++ , == 2.
       * Unload module A, mtx_destroy(), wA->w_name become invalid,
         but wA->w_refcount-- become 1 instead of 0. wA will not be
         removed from witness list.
       * Some other places call mtx_init(), iterating witness list,
         found wA, failed on wA->w_name == description
       * wA->w_refcount > 0 && strcmp(description, wA->w_name)
       * Panic on strcmp() since wA->w_name no longer point to valid
         address.

Note that this could happened in other places as well, not just sound
(eg. consider lots of drivers that share simmilar MTX_NETWORK_LOCK).

Solutions (for sound case):
  1) Provide unique mtx type string for each mutex creation (chosen)
  or
  2) Put "sound softc" global variable somewhere and use it.
2007-03-15 16:41:27 +00:00
Ariff Abdullah
0585c315b7 Add AC97 inverted external amplifier quirk for ASUS A6R laptop.
PR:		kern/110244
MFC after:	3 days
2007-03-13 15:20:33 +00:00
Ariff Abdullah
c0dc2ab241 Fix analog CD connectivity. HP decided to screw pinconfig settings in
their latest Compaq V3000 BIOS (revision F.22). As a result, analog CD
connectivity is gone to the oblivion. Even if they decide to fix it in
future revisions, the damage has been done.
2007-03-11 15:26:49 +00:00
Ariff Abdullah
018b991e1d Fix long standing multi playback/recording issues, caused by
excessive interrupt clock timer reset, screwing interrupt generation
for already active channels. Track moving DMA pointer and call buffer
interrupt on each blocksize boundary.

PR:		kern/109791
MFC after:	3 days
2007-03-09 05:35:20 +00:00
Kevin Lo
32d6c6993c Use M_NOWAIT instead of M_WAITOK to cause malloc() to return NULL. 2007-03-07 05:28:42 +00:00
Ariff Abdullah
9622f4d439 Quick bandaid for possible broken multiple playback channels implementation.
Reported/Tested by:	Oliver Iberien <odilist@sonic.net>
2007-03-05 07:45:38 +00:00
Ariff Abdullah
b88d63a8ea Fix ALC883 microphone / recording issues. Setting high(er) VRef on
(external) microphone pin tend to screw it. Internal microphone (found
on several laptops) still need high VRef.

Tested by:	Pietro Cerutti <pietro.cerutti@gmail.com>
          	lenix <irc.freenode.net>
2007-02-25 06:17:56 +00:00
Ariff Abdullah
5583760956 - Revert arguments for several functions to pre bus_get_dma_tag()
changes. Each softc contains information about their own device_t,
  use that instead.
- bus_setup_intr() -> snd_setup_intr().
2007-02-23 19:41:16 +00:00
Ariff Abdullah
2cc08b748c - Compile time compatibility for pre/post newbus API (intr filter)
changes. This should ease the job of maintaining codebase since much
  of the regression tests are done across os versions.
- bus_setup_intr() -> snd_setup_intr().
2007-02-23 19:40:13 +00:00
Ariff Abdullah
78bb065b84 Use snd_setup_intr() instead of bus_setup_intr() , like other drivers. 2007-02-23 19:39:06 +00:00
Alexander Leidinger
0b989078d7 MFp4 (114068):
Use bus_get_dma_tag() to obtain the parent DMA tag to make the drivers
        a little bit more non-ia32/amd64 friendly.

        There is no man page for bus_get_dma_tag, so this is modelled after
        rev. 1.62 of src/sys/dev/sound/pci/es137x.c by marius.

        Inspired by:	commit by marius
2007-02-23 13:47:34 +00:00
Paolo Pisati
ef544f6312 o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@
2007-02-23 12:19:07 +00:00
Ariff Abdullah
885d6cfbc1 Add codec id for Sigmatel STAC9271D.
Submitted by:	Michael Fuckner <michael@fuckner.net>
2007-02-16 17:43:29 +00:00
Ariff Abdullah
d82080b4cd Fix compilation for statically linked snd_envy24{ht}/spicds. Use explicit
struct mtx rather than void pointer.

PR:	kern/109147
2007-02-14 15:23:44 +00:00
Ariff Abdullah
5430d30e44 Add speaker control for HP xw4300. This hardware doesn't respond to
unsolicited pin sense event and need manual control to turn off speaker
volume while attaching headphone.

Tested by:		Ingeborg Hellemo <Ingeborg.Hellemo@cc.uit.no>

Disable global Acer + ALC883 headphone automute settings since there are
few models that does not respect this and causing broken behaviour.

Reported/Tested by:	Pavel Argentov <argentoff@rtelekom.ru>
2007-01-28 03:16:54 +00:00
Ariff Abdullah
b9ba7b9e78 Massive inlining cleanups/removal to make it survive on WARNS=2. 2007-01-27 13:30:19 +00:00
Ariff Abdullah
a12b5a0728 Reduce maximum DMA segments from 128 to 64. We don't need more than that. 2007-01-27 07:35:05 +00:00
Ariff Abdullah
f39ee7ef2e Total DMA segments should include total number of record channel(s). 2007-01-26 23:53:56 +00:00
Marius Strobl
c2175ff5ca Change the remainder of the drivers for DMA'ing devices enabled in the
sparc64 GENERIC and the sound device drivers known working on sparc64
to use bus_get_dma_tag() to obtain the parent DMA tag so we can get rid
of the sparc64_root_dma_tag kludge eventually. Except for ath(4), sk(4),
stge(4) and ti(4) these changes are runtime tested (unless I booted up
the wrong kernels again...).
2007-01-21 19:32:51 +00:00
Joel Dahl
5c92405025 Fix typo in a comment. 2007-01-16 12:27:13 +00:00
Ariff Abdullah
95af1064dc Fix headphone/speaker automute for [1] Acer Aspire 5050 and [2] MSI MS-1034
laptops.

Tested by:	[1] Lion G. <liontanker@hotmail.com>
          	[2] Pietro Cerutti <pietro.cerutti@gmail.com>

Specialized mixer initialization for STAC9221, much like STAC9220.

Tested by:	Devon H. O'Dell
2007-01-13 00:24:44 +00:00
Alexander Leidinger
f856af0466 Extend the emu10kx driver. With the words of the author:
---snip---
New features:
1.	Optional multichannel recording (32 channels on Live!, 64 channels
 	on Audigy).

 	All channels are 16bit/48000Hz/mono, format is fixed.
 	Half of them are copied from sound output, another half can be
 	used to record any data from DSP. What should be recorded is
 	hardcoded in DSP code. In this version it records dummy data, but
 	can be used to record all DSP inputs, for example..

 	Because there are no support of more-than-stereo sound streams
 	multichannell stream is presented as one 32(64)*48000 Hz 16bit mono
 	stream.

 	Channel map:

 	SB Live! (4.0/5.1)
 	offset (words)	substream
 	0x00		Front L
 	0x01		Front R
 	0x02		Digital Front L
 	0x03		Digital Front R
 	0x04		Digital Center
 	0x05		Digital Sub
 	0x06		Headphones L
 	0x07		Headphones R
 	0x08		Rear L
 	0x09		Rear R
 	0x0A		ADC (multi-rate recording) L
 	0x0B		ADC (multi-rate recording) R
 	0x0C		unused
 	0x0D		unused
 	0x0E		unused
 	0x0F		unused
 	0x10		Analog Center (Live! 5.1) / dummy (Live! 4.0)
 	0x11		Analog Sub (Live! 5.1) / dummy (Live! 4.0)
 	0x12..-0x1F	dummy

 	Audigy / Audigy 2 / Audigy 2 Value / Audigy 4
 	offset (words)	substream
 	0x00		Digital Front L
 	0x01		Digital Front R
 	0x02		Digital Center
 	0x03		Digital Sub
 	0x04		Digital Side L (7.1 cards) / Headphones L (5.1 cards)
 	0x05		Digital Side R (7.1 cards) / Headphones R (5.1 cards)
 	0x06		Digital Rear L
 	0x07		Digital Rear R
 	0x08		Front L
 	0x09		Front R
 	0x0A		Center
 	0x0B		Sub
 	0x0C		Side L
 	0x0D		Side R
 	0x0E		Rear L
 	0x0F		Rear R
 	0x10		output to AC97 input L (muted)
 	0x11		output to AC97 input R (muted)
 	0x12		unused
 	0x13		unused
 	0x14		unused
 	0x15		unused
 	0x16		ADC (multi-rate recording) L
 	0x17		ADC (multi-rate recording) R
 	0x18		unused
 	0x19		unused
 	0x1A		unused
 	0x1B		unused
 	0x1C		unused
 	0x1D		unused
 	0x1E		unused
 	0x1F		unused
 	0x20..0x3F	dummy

Fixes:
1.	Do not assign negative values to variables used to index emu_cards
 	array. This array was never accessed when index is negative, but
 	Alexander (netchild@) told me that Coverity does not like it.
 	After this change emu_cards[0] should never be used to identify
 	valid sound card.
2.	Fix off-by-one errors in interrupt manager. Add more checks there.
3.	Fixes to sound buffering code now allows driver to use large playback
 	buffers.
4.	Fix memory allocation bug when multichannel recording is not
 	enabled.
5.	Fix interrupt timeout when recording with low bitrate (8kHz).

Hardware:
1.	Add one more known Audigy ZS card to list. Add two cards with
 	PCI IDs betwen old known cards and new one.

Other changes:
1.	Do not use ALL CAPS in messages.

Incomplete code:
1.	Automute S/PDIF when S/PDIF signal is lost.

Tested on i386 only, gcc 3.4.6 & gcc41/gcc42 (syntax only).
---snip---

This commits enables a little bit of debugging output when the driver is
loaded as a module. I did a cross-build test for amd64.

The code has some style issues, this will be addressed later.

The multichannel recording part is some work in progress to allow playing
around with it until the generic sound code is better able to handle
multichannel streams.

This is supposed to fix
CID:		171187
Found by:	Coverity Prevent

Submitted by:	Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
2007-01-06 18:59:35 +00:00
Ariff Abdullah
048b52987d Fix headphone/speaker automute for Toshiba Satellite Pro U200.
Reported/Tested by:	keramida
2007-01-04 18:13:04 +00:00
Ariff Abdullah
65de329ee2 Fix distorted sound on Intel Desktop Board D101GGC (ATI SB450/ALC861).
Turn on ALC861 quirk as default since it seems affecting all hardwares
with the same codec.

Reported/Tested by:	Darryl Yeoh <drl@MyBSD.org.my>
2006-12-22 11:55:59 +00:00
Ariff Abdullah
303f62b8a2 Fix distorted sound on Fujitsu Siemens AMILO Pa 1510.
Reported/Tested by:	infofarmer
2006-12-19 16:52:09 +00:00
Ariff Abdullah
378e0c5c89 Latest updates for Envy24/24HT. Fix various issues with LOR and panic
during verbose booting.

Submitted by:	Konstantin Dimitrov <kosio.dimitrov@gmail.com>
2006-12-17 16:06:45 +00:00
Ariff Abdullah
5c46f47bd3 Add codec id for [1] Realtek ALC888 and [2] Sigmatel STAC9227
Found/Tested by:	[1] luigi
                	[2] Jean-Baptiste Quenot <jbq@caraldi.com>
2006-12-17 15:19:33 +00:00
Ariff Abdullah
dc9e52cfda Add support for Nvidia Nforce MCP04 AC97 controller.
PR:		kern/106829
Submitted by:	Frédéric Petit <fredantispam@free.fr>
2006-12-17 13:23:00 +00:00
Ariff Abdullah
210bece19a Miscellaneous fixups and quirks for ASUS A7M, LG LW20 and
HP NX6325 laptops.
2006-12-16 09:14:58 +00:00
Ariff Abdullah
7c302801bd Fix compilation using gcc 4.1.
Submitted by:	dougb
2006-12-15 05:15:17 +00:00
Ariff Abdullah
4ed06071e6 Fix distorted sound on ASUS P1-AH2 caused by accumulated input / output.
Reported/Tested by:	Hiroharu Tamaru <tamaru@myn.rcast.u-tokyo.ac.jp>
2006-12-11 18:45:11 +00:00
Ariff Abdullah
e150f641d0 Fix AD1986A (and possibily other codecs too) microphone issues.
Tested by:	xride (using skype, xanalyser, etc. ; play/record)
2006-12-10 06:13:41 +00:00
Ariff Abdullah
1b5c0d50f6 - Fix headphone/speakers automute on Lenovo 3000 N100.
Tested by:	xride

- GPIO commit cleanups and fixes for possible breakage during
  previous commit.
2006-12-09 17:52:54 +00:00
Ariff Abdullah
2229d0cfa2 Add support for Apple Intel/Mac.
- Playback and headphone/speaker automute works.
 - Recording untested due to me being deaf doing back-and-forth
   remote debugging.

Free Macbook donation is highly appreciated :)

Tested by:	Dennis Pielken <mips128@gmx.net>
2006-12-02 17:12:24 +00:00
Ariff Abdullah
fbf953b58e Add inverted amplifier sense quirk for HP Compaq nx4300.
PR:		kern/106104
Submitted by:	Shun-ichi Kobayashi <koba@mbox.kudpc.kyoto-u.ac.jp>
MFC after:	3 days
2006-12-01 06:53:13 +00:00
Ariff Abdullah
57d90e7fbe Fix support for Medion MD MD95257 (GPIO2 quirk).
Reported by:	Chris Tophe <cohika@gmail.com>
2006-11-29 15:15:30 +00:00
Ariff Abdullah
a799d1cd22 - LNV -> LENOVO
- Fix support for Samsung Q1 UltraMobile PC (inverted EAPD).

Reported by:	benno
2006-11-27 06:16:36 +00:00
Ariff Abdullah
a580b31a54 Welcome to Once-a-year Sound Mega-Commit. Enjoy numerous updates and fixes
in every sense.

General
-------

- Multichannel safe, endian safe, format safe
   * Large part of critical pcm filters such as vchan.c, feeder_rate.c,
     feeder_volume.c, feeder_fmt.c and feeder.c has been rewritten so that
     using them does not cause the pcm data to be converted to 16bit little
     endian.
   * Macrosses for accessing pcm data safely are defined within sound.h in
     the form of PCM_READ_* / PCM_WRITE_*
   * Currently, most of them are probably limited for mono/stereo handling,
     but the future addition of true multichannel will be much easier.

- Low latency operation
  * Well, this require lot more works to do not just within sound driver,
    but we're heading towards right direction. Buffer/block sizing within
    channel.c is rewritten to calculate precise allocation for various
    combination of sample/data/rate size. As a result, applying correct
    SNDCTL_DSP_POLICY value will achive expected latency behaviour simmilar
    to what commercial 4front driver do.
  * Signal handling fix. ctrl+c of "cat /dev/zero > /dev/dsp" does not
    result long delay.
  * Eliminate sound truncation if the sound data is too small.
    DIY:
      1) Download / extract
         http://people.freebsd.org/~ariff/lowlatency/shortfiles.tar.gz
      2) Do a comparison between "cat state*.au > /dev/dsp" and
         "for x in state*.au ; do cat $x > /dev/dsp ; done"
         - there should be no "perceivable" differences.
    Double close for PR kern/31445.

  CAVEAT: Low latency come with (unbearable) price especially for poorly
          written applications. Applications that trying to act smarter
	  by requesting (wrong) blocksize/blockcount will suffer the most.
	  Fixup samples/patches can be found at:
	  http://people.freebsd.org/~ariff/ports/

- Switch minimum/maximum sampling rate limit to "1" and "2016000" (48k * 42)
  due to closer compatibility with 4front driver.
  Discussed with: marcus@ (long time ago?)

- All driver specific sysctls in the form of "hw.snd.pcm%d.*" have been
  moved to their own dev sysctl nodes, notably:
  hw.snd.pcm%d.vchans -> dev.pcm.%d.vchans
  Bump __FreeBSD_version.

Driver specific
---------------

- Ditto for sysctls.

- snd_atiixp, snd_es137x, snd_via8233, snd_hda
  * Numerous cleanups and fixes.
  * _EXPERIMENTAL_ polling mode support using simple callout_* mechanisme.
   This was intended for pure debugging and latency measurement, but proven
   good enough in few unexpected and rare cases (such as problematic shared
   IRQ with GIANT devices - USB). Polling can be enabled/disabled through
   dev.pcm.0.polling. Disabled by default.

- snd_ich
  * Fix possible overflow during speed calibration. Delay final
    initialization (pcm_setstatus) after calibration finished.
    PR: kern/100169
    Tested by: Kevin Overman <oberman@es.net>
  * Inverted EAPD for few Nec VersaPro.
    PR: kern/104715
    Submitted by: KAWATA Masahiko <kawata@mta.biglobe.ne.jp>

Thanks to various people, notably Joel Dahl, Yuriy Tsibizov, Kevin Oberman,
those at #freebsd-azalia @ freenode and others for testing.

Joel Dahl will do the manpage update.
2006-11-26 12:24:06 +00:00
Ariff Abdullah
55be51bf55 - Inverted EAPD quirk for ASUS A8Jc.
- Take the literal meaning of eapdbtl, but do the inversion during
  write.

Tested by:	Chung-liang Wei <idreamer@gmail.com>
2006-10-16 14:43:22 +00:00
Ariff Abdullah
1409858b3b - Fix support for ASUS U5F laptop. This laptop (and possibly others)
need a special inverted EAPD quirk.
- Add "eapdinv" config for future testing purposes.

Tested by:	Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
          	#freebsd-azalia @ irc.freenode.net
2006-10-12 15:37:43 +00:00
Ariff Abdullah
0b414ccace Fix support for IBM/Lenovo Thinkcentre M52 series. Its vendorid / 0x1014
accidentally match with HP vendorid / 0x103c.

Reported by:	Robert Noland <rnoland@2hip.net>
2006-10-12 04:19:37 +00:00
Ariff Abdullah
bfb06714ec Added few more pci ids for Intel, ATI, NVidia, VIA and SiS. 2006-10-08 18:51:58 +00:00
Ariff Abdullah
8d999aa8a1 - Fix wrong id for ALC882, add ALC883 id.
- Add support for the Conexant Waikiki/CX20551-22, found
  in most Toshiba P100 series laptops. Despite of growing
  urban legend of "unsupported Conexant", this codec is fully
  supported in this driver.
  Note: Toshiba P100 has broken (acpi) BIOS, thus rendering
        its soundchip useless. Please disable ACPI, or get
        BIOS updates (if any).

  Found/tested by: Vulpes Velox <v.velox@vvelox.net>
  URL: http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-September/004896.html

- Parser cleanups to handle possible oss/mixer collision. Found
  after parsing Conexant Waikiki nodes.

- Increase resilient against resource failure during attach/detach.

- Implement simple config through hint.pcm.<unit>.config. Supported
  options:
    gpio0 (default on Acer), gpio1, gpio2, softpcmvol,
    fixedrate (default), forcestereo (default)
  * Option prefixed with "no" (such as "nofixedrate") will do
    the opposite.
  * Options can be separated using space " " or comma ",".
  * The "no" option will take precedence over anything else.
  Example:
    hint.pcm.0.config="gpio2,nofixedrate,noforcestereo,nogpio0,softpcmvol"
    hint.pcm.0.config="softpcmvol noforcestereo"
2006-10-06 18:59:27 +00:00
Ariff Abdullah
0f219a5803 - Streamline quirks management for a better future.
- Fix support for ASUS M5200ae (buggy BIOS)
- Fix few problems, reported by Coverity Prevent (TM).

CID:		246991, 246676, 246675, 246674, 246477
Found by:	Coverity Prevent (TM)
2006-10-02 16:30:04 +00:00
Ariff Abdullah
aab23ae39a Make this buildable on IA64.
Reported by:	phk
2006-10-02 15:26:37 +00:00
Ariff Abdullah
9f52a325cd Various cleanups. Revert DMA alignmnet back to 2 since the original
cause of DMA pointer train wreck has been solved.

Reminded by:	silby
MFC after:	1 month
2006-10-01 13:30:30 +00:00
Ariff Abdullah
1f0387f732 Add support for Intel High Definition Audio Controller.
This driver make a special guarantee that "playback" works
on majority hardwares with minimal or without specific vendor
quirk.

This driver is a product of collaborative effort made by:

  Stephane E. Potvin <sepotvin@videotron.ca>
       Andrea Bittau <a.bittau@cs.ucl.ac.uk>
       Wesley Morgan <morganw@chemikals.org>
      Daniel Eischen <deischen@FreeBSD.org>
     Maxime Guillaud <bsd-ports@mguillaud.net>
      Ariff Abdullah <ariff@FreeBSD.org>

....and various people from freebsd-multimedia@FreeBSD.org

Refer to snd_hda(4) for features and issues.

Welcome To HDA.

Sponsored by:	Defenxis Sdn. Bhd.
2006-10-01 11:13:00 +00:00
Alexander Leidinger
0971278e54 Driver for Envy24HT (ICE1724 or VT1724)-based cards like
Terratec Aureon 7.1 Space:	tested
  Terratec Aureon 5.1 Sky:	tested
  Terratec PHASE 28:		tested
  Terratec Aureon 7.1 Universe:	tested
  Audiotrak Prodigy 7.1:	tested
  Audiotrak Prodigy 7.1 LT:	not tested
  Terratec PHASE 22:		not tested
  M-Audio Revolution 7.1:	not tested
  M-Audio Revolution 5.1:	not tested
  M-Audio Audiophile 192:	tested

Submitted by:	"Konstantin Dimitrov" <kosio.dimitrov@gmail.com>
2006-09-30 17:52:28 +00:00
Alexander Leidinger
b7bfe2fc89 Remove the ak452x code, superseeded by spicds. 2006-09-30 17:14:14 +00:00
Alexander Leidinger
f0b43758d7 - fix memory leak, when "number of adcs" != "number of dacs"
- fix multiple initialization of the first codec (support for more than
  one codec should be added in the future)
- use spicds instead of ak452x module

Submitted by:	"Konstantin Dimitrov" <kosio.dimitrov@gmail.com>
2006-09-30 17:08:51 +00:00
Alexander Leidinger
f198ead2a5 After repo copy from ak452x.[ch]: SPIcds is the I2S SPI audio codec code
used by the Envy* drivers.

Submitted by:	"Konstantin Dimitrov" <kosio.dimitrov@gmail.com>
2006-09-30 16:53:40 +00:00
Pyun YongHyeon
03923cd3d2 Add inverted amplifier sense quirks for Compaq Presario B3800
Reported by:	Nick Withers < nick AT nickwithers DOT com >
Tested by:	Nick Withers < nick AT nickwithers DOT com >
No objection from:	ariff
MFC after:	1 week
2006-08-15 07:37:41 +00:00
Alexander Leidinger
04d895e8a4 Use a low probe-priority to ensure that the emu10kx driver has a higher
priority than this one when both are available.
2006-08-07 23:00:36 +00:00
Alexander Leidinger
507ec6d5c5 "Fix typos in volume control DSP code."
Submitted by:	Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
2006-08-07 22:56:41 +00:00
Alexander Leidinger
0c115520f1 "Fixe playback of mono files on stereo outputs. In previous version
mono files are played only on left channel."

Submitted by:	Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
2006-08-07 22:55:21 +00:00
Alexander Leidinger
feaa7fe133 "Change type for flags bitmap to let use 1 as flag value without
overflow (to -1)."

Submitted by:	Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
2006-08-07 22:50:26 +00:00
Alexander Leidinger
e4c87b14fd "Workaround for sound lag in current snd_emu10kx driver. Real problem
is interaction between in-kernel sound buffer handling and hardware.
 With small buffer, there are times when both harwdare reads and
 kernel writes to the same buffer (it is only visible on slow machines, i
 think). I'm digging in channel.c and buffer.c to find a solution that
 allow use of large hardware buffers without sound lags - hardware can
 handle buffers up to 32Mb."

Submitted by:	Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
2006-08-07 22:44:01 +00:00
Alexander Leidinger
347edd7ee6 - fix memory leak after "kldunload snd_ak452x.ko"
- fix "No sound in KDE":
  The problem is related to the implementation of Envy24(1712) hardware
  mixer support in the driver. Envy24(1712) has very precise 36bit wide
  hardware mixer, which is superior that vchans (software sound mixer in
  the kernel). The driver supports Envy24(1712) hardware mixer, so up to
  10 channels (5 stereo pairs) can be playback simultaneously.
  However, there are problems with the implementation of Envy24(1712)
  hardware mixer support in the driver, one of them is the problem with
  "no sound in KDE":
      When playing back several channels simultaneously and
      stoping one of the channels, sound starts to stutter and
      plays at very low speed.
  Another problem is:
      Playing back simultaneously more than one 24bit/32bit
      sound file or 16bit sound file and 24bit/32bit sound
      file doesn't work as expected.

Submitted by:	"Konstantin Dimitrov" <kosio.dimitrov@gmail.com>
2006-07-28 18:06:39 +00:00
Alexander Leidinger
4002c39216 Prepend temporary sysctls with an underscore.
Submitted by:	Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
2006-07-17 17:28:44 +00:00
Alexander Leidinger
ca23ff1987 Fix a compile time problem on amd64. I'm not sure if the fix is correct
from a semantic point of view, but I notified the author of the driver
for confirmation. So far it at least fixes the build and should only
lead to not identifying or wrongly identifying a soundcard in the worst
case.
2006-07-16 20:10:08 +00:00
Alexander Leidinger
75d7240e18 Make the MIDI kobj class static. This brings it inline with the channel or
ac97 classes.

This allows to link emu10k1 and emu10kx into the same kernel (LINT).
2006-07-15 20:08:32 +00:00
Alexander Leidinger
d056fa046c Add snd_emu10kx driver for Creative SoundBlaster Live! and Audigy series
sound cards with optional pseudo-multichannel playback.

It's based on snd_emu10k1 sound driver. Single channel version is available
from audio/emu10kx port since some time.

The two new ALSA header files (GPLed), which contain Audigy 2 ("p16v") and
Audigy 2 Value ("p17v") specific interfaces, are latest versions from ALSA
Mercurial repository.

This is not connected to the build yet.

Submitted by:	Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
2006-07-15 19:36:28 +00:00
Alexander Leidinger
53f4fb1109 - Update ALSA emu10k1.h (it was imported as emu10k1-alsa.h) header file to
latest version from Mercurial repository. It brings definition of some
  additional Audigy 2 / Audigy 2 Value registers.
- Use new #defines from ALSA emu10k1.h
- Remove unused include files:
  + emu10k1-ac97.h was imported from ALSA and never used,
  + emu10k1.h was imported from Creative Linux emu10k1 driver, but only
    AUDIGY_CODEBASE was used from it.

Submitted by:	Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
2006-07-15 19:19:54 +00:00
Pyun YongHyeon
8d934d5005 Fix a missing unlock operation in interrupt handler.
PR:		kern/99205
Submitted by:	Alexey Illarionov <littlesavage AT rambler DOT ru>
MFC after:	1 week
2006-07-06 10:39:58 +00:00
Alexander Leidinger
851a904af5 - Rename hw.snd.unit to hw.snd.default_unit to make the purpose more obvious.
- Enable 4 automatic vchan's by default.
- Add some comments which provide ides/questions for improvement.
- Prefix some temporary sysctl's with an underscore to denote that it is not
  an official API but a workaround until the real solution is implemented.
2006-06-18 14:14:41 +00:00
Alexander Leidinger
ce356b7017 - fix compatibility with newer versions of FreeBSD
- fix all warnings during compilation
- fix obvious bugs
- add support for more cards

Now supported:
 - M-Audio Delta Dio 2496
 - M-Audio Audiophile 2496
 - Terratec DMX 6fire

Known bugs (detected by Nokolas and Stefan):
 - $ kldunload snd_ak452x.ko
   Warning: memory type ak452x leaked memory on destroy (1 allocations,
   64 bytes leaked).
 - No sound in KDE: Everything works fine at the console but when I load KDE
   (3.5.3) the sound stutters and plays at less then 1/2 speed.
 - 'mixer: WRITE_MIXER: Device not configured' The message repeats x
   times at system startup, x = whatever hw.snd.maxautovchans is set to.
   (this is because only vol, pcm and line are supported, but the driver
   shows more than those mixer devices and setting those additional mixers
   results in this error message)
 - vchans don't work
 - 24 bit playback not supported (only 16/32 bit)
 - after kld(un)loading some times, the card fails to be probed until reboot

Datasheets are available from:
	http://www.nbritton.org/uploads/envy24/
	http://www.asahi-kasei.co.jp/akm/en/product/ak4528/ak4528_f01e.pdf
	http://www.asahi-kasei.co.jp/akm/en/product/ak4528/ekd4528-01.pdf
	http://www.asahi-kasei.co.jp/akm/en/product/ak4524/ak4524_f03e.pdf
	http://www.asahi-kasei.co.jp/akm/en/product/ak4524/ekd4524.pdf
	http://www.wolfson.co.uk/uploads/documents/en/WM8728.pdf
	http://www.richtech.co.kr/down/richtek/RT9131.pdf
	http://xkodi.svobodno.com/xkodi/space71.html
	http://people.freebsd.org/~lofi/envy24.pdf
	http://people.freebsd.org/~lofi/4524.pdf

Submitted by:	Konstantin Dimitrov <kosio.dimitrov@gmail.com>
Tested by:	Nikolas Britton <nikolas.britton@gmail.com>
		Stefan Ehmann <shoesoft@gmx.net>
2006-06-17 15:11:36 +00:00
Alexander Leidinger
12ab72d345 dd the envy24 driver as is to the tree. It's not connected to the build
yet. More commits to follow.

I got no response from the author, but since the driver is BSD licensed
I don't think he will complain. :-)

I got it from http://people.freebsd.org/~lofi/envy24.tar.gz

Written by:	Katsurajima Naoto <raven@katsurajima.seya.yokohama.jp>
2006-06-17 14:36:44 +00:00
Alexander Leidinger
f510d240d3 Commit the new (old) midi framework. It's based in parts on the NetBSD code,
but large parts are rewritten by matk and tanimura.

This is old code, it's not maintained since 2003. We also don't have a
maintainer for this! Yuriy Tsibizov took it and uses it in his emu10kx
driver. Since the emu10kx driver will enter the tree "soon" (some bugs
have to be fixed after Yuriy return from his holidays), I add it here
already.

This also contains some changes to emu10k1 and cmi, so if you're lucky,
you can now make some kind of use of midi with those soundcards.

To all those poor souls which don't have such a card: feel free to send
patches, we don't have a maintainer for this.

To those which miss a specific feature in the midi code: feel free to
submit patches, we don't have a maintainer for this.

Oh, did I already told that it would be nice if someone would take care
of it? Maintainer with midi equipment wanted! :-)

If you get LOR's, submit a PR and notify multimedia@ please. If you get
panics, submit a PR with a backtrace (compile the sound system into your
kernel instead of using modules in this case) and notify multimedia@
please.

Written by:	matk, tanimura
Submitted by:	"Yuriy Tsibizov" <Yuriy.Tsibizov@gfk.ru>
Based upon:	code from NetBSD
2006-05-27 16:51:37 +00:00
Ariff Abdullah
14055d2a09 Add inverted amplifier sense quirks for Sony VAIO VGN B1VP/B1XP.
Reported by:	Stan Behrens <s.behrens at kon.de>
2006-05-01 09:28:28 +00:00
Ariff Abdullah
ee8e8d867e Add support for (latest) VIA VT8251 (rev. 0x07) audio controller.
A slight difference of this chip from its previous siblings is that
it need a gentle "wake up" on every (full) DMA buffer completion to
avoid stalled interrupt handler.

Thanks to George Hartzell for permission on doing remote debugging.

Prime MFC candidate for 6.1-RELEASE. Please reply to this commit if
there are any objections  (so I won't bug re@),  since the  changes
are too small and only specific to VT8251.

PR:		i386/95949
Tested by:	[1] George Hartzel
          	myself (remotely)
MFC after:	3 days

[1] http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-April/004003.html
2006-04-22 09:44:00 +00:00
Ariff Abdullah
facebb04a5 Add device ID for nForce 410 MCP audio controller.
PR:		kern/95257
Submitted by:	cenix <cenixxx at gmail dot com>
MFC after:	3 days
2006-04-03 17:37:27 +00:00
Ariff Abdullah
6d52c3bf33 Don't set primary resume interrupt flag during channel initialization
since it can cause high interrupt rate (storm) and slowdown the entire
system.

Note: Please report back to me if this commit cause any abnormal
      behaviour, especially during suspend / resume.

Reported/Submitted by:	[1] Daan Vreeken [PA4DAN] <Danovitsch_at_vitsch dot net>
Reported/Confirmed by:	[2] Angka H. K. <harikurniawan at gmail dot com>

MFC after:		5 days

[1] http://lists.freebsd.org/mailman/htdig/freebsd-hackers/2004-December/009335.html
[2] http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-March/003830.html
2006-03-22 22:24:23 +00:00
Ariff Abdullah
f2a1d71aaa Misc. fixups:
- [1] Make the driver friendly towards kernel without PREEMPTION.
  Use msleep(9) instead of simple unlock-check_variable-lock mechanisme
  since the later not really effective in non-preemptible kernel
  (especially during codec detection routine).
- Free most driver resources in a sane manner to avoid possible
  double free and panics especially during device detach and codec
  detection failure.

MFC after:	3 days

[1] http://lists.freebsd.org/pipermail/freebsd-questions/2006-March/116515.html
2006-03-22 21:29:47 +00:00
Ariff Abdullah
ead3cc4315 Add another inverted amplifier sense quirk for Kvazar-Micro Senator 3592XT.
Submitted by:	[1] Alexandr Krivulya <admin at marcom-group.com>
MFC after:	3 days

[1] http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-March/003773.html
2006-03-07 05:48:14 +00:00
Ariff Abdullah
428feeb3b9 Add another inverted amplifier sense quirk for Sony VAIO Type T.
PR:		kern/94056
Submitted by:	Yoshihiko Sarumaru <mistral at imasy.or.jp>
MFC after:	3 days
2006-03-05 02:26:51 +00:00
Ariff Abdullah
df010ca869 Trim unnecessary pointer alignment. 2006-02-24 09:29:32 +00:00
Ariff Abdullah
050519958c - Fix severe crackling after long running and abusive module load / unload by
forcing DMA alignment to default buffer size.
- Make sure DMA pointer properly aligned to avoid being truncated by caller
  which causing severe underruns and random popping (especially in 32bit
  playback / recording).
- Add AC97 inverted external amplifier quirk for Maxselect x710s
  - http://maxselect.ru/

MFC after:	1 week
2006-02-18 10:24:48 +00:00
Ariff Abdullah
fba6b23875 Fix random popping while playing in 32bit by increasing default buffer size
from 4096 to 8192.

MFC after:	1 week
2006-02-18 10:23:37 +00:00
Ariff Abdullah
34733eb529 Fix possible DMA leak and locking violation especially
during suspend <-> resume and module load <-> unload.

PR:		kern/92764
MFC after:	3 days
2006-02-12 10:42:47 +00:00
Alexander Leidinger
cd9de7ee61 A pointer was checked for NULL after dereferencing it. The check is not
needed here, except there's a bug which results in detaching the device
twice.

Move the NULL pointer check to the beginning of the function and convert
it into a KASSERT.

CID:		420
Found with:	Coverity Prevent(tm)
Discussed with:	ariff
MFC after:	5 days
2006-02-05 17:33:18 +00:00
Ariff Abdullah
86b391b2e1 Enable full duplex operation since it works and to solve panic issue.
PR:		kern/91992
MFC after:	2 days
2006-01-27 02:01:27 +00:00
Alexander Leidinger
5f35685cc2 Backput the "Dell ID" part of the last commit, it was already tried in
the past but didn't worked.

Noticed by:	Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
2006-01-21 16:21:06 +00:00
Alexander Leidinger
30baa78df4 Merge rev. 1.5 and 1.6 from DFly:
- Add PCI identifier to match against a Dell OEM version of the SB Live!
 - Fix spurious warning about ANSI trigraphs

Obtained from:	DragonFlyBSD
2006-01-21 15:23:15 +00:00
Alexander Leidinger
a7571c3f6b Prevent dereferencing a NULL pointer if the malloc() fails.
CID:		219
Found with:	Coverity Prevent(tm)
2006-01-21 11:50:56 +00:00
Joel Dahl
16451fc93a Remove unused pointer.
Approved by:	ariff
2006-01-21 09:05:13 +00:00
Ariff Abdullah
8815a86933 Turn on native 32bit recording (at 48000hz).
It works perfectly on my Compaq Presario M2000Z, but my last attempt
on Acer Ferrari 4000 only produce garbled sound.

MFC after:	3 days
2006-01-20 19:35:44 +00:00
Ariff Abdullah
4aee05133b Remove Giant / busdma_lock_mutex from busdma_tag_create(). 2006-01-18 01:01:37 +00:00
Ariff Abdullah
f432c562bf Add another inverted EAPD quirk for Gateway 7326GZ.
Tested by:	Jeff Cross <jeff.cross at averageadmins.com>
MFC after:	3 days
2006-01-14 23:37:08 +00:00
Ariff Abdullah
8c437e077b Joyport blacklist. Either we're facing with broken hardware
or because this hardware need special (unknown) initialization
procedures.

Reported by:	[1] Rob Clark <vx2 at tds.net>
MFC after:	3 days

[1] http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-January/003535.html
2006-01-13 04:54:34 +00:00
Ariff Abdullah
1738f66243 Fix broken playback capabilities to prevent impending disaster.
The minimum / maximum speed was way too low / high!

minspeed =   2000 - is this for real ?
maxspeed = 767999 - is this for real ?????

Wrap everything into 8000 - 48000 boundary, just to be safe.

MFC after:	3 days
2006-01-11 23:22:57 +00:00
Ariff Abdullah
40c012dd6d - Locking fixes. Release lock while chn_intr().
- Mark MPSAFE since most of the locking procedures already implemented.
- Turn on inverted external amplifier sense flag for selected boards.

Tested by:	bland
MFC after:	1 week
2006-01-11 08:02:15 +00:00
Ariff Abdullah
c02b454deb More thorough fixes to enable inverted external amplifier sense flag.
Instead of dragging the entire ICH4/82801DB into this mess, select
only few boards based on pci subdevice / subvendor.

Tested by:	Daisuke Orikasa <luxury-acura-3.5rl at nifty.com>
MFC after:	3 days
2006-01-10 06:52:59 +00:00
Ariff Abdullah
be0fee94a7 Turn on inverted external amplifier sense flags for ICH4/82801DB.
PR:		kern/66422, kern/75687, kern/84471
MFC after:	2 days
2006-01-09 11:20:37 +00:00
Ariff Abdullah
7659fda352 Fix obvious capabilities (rate) violation. Should be 5500, not 4000.
MFC after:	1 day
2006-01-09 06:05:25 +00:00
Ariff Abdullah
1332ddcb64 Fix locking violation, causing frantic diagnostic messages during boot.
Reported by:	[1] julian
MFC after:	3 days

[1] http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-January/003408.html
2006-01-06 10:36:55 +00:00
Ariff Abdullah
8b6d3fe1b6 Another major fixes and enhancements:
- MPSAFE
    - Fix / reorganize attach routine. Device specific initialization must
      be done after generic bus / DMA setup. At last, Virtual Channels
      (vchan) works as expected.

Note: Recent commit / fix against this driver proves that major enhancements
      on the generic sound layer does indeed help to expose flaw within
      device specific code. There are probably other drivers that need to
      be addressed as well.

Tested by:	barner
MFC after:	1 week
2006-01-06 05:04:18 +00:00
Ariff Abdullah
1333b4a431 Fix broken capabilities, causing failure during channel reset.
Its min/max speed were off by -/+ 1000.

Reported by:	[1] Ion-Mihai Tetcu <itetcu@people.tecnik93.com>
            	[2] barner
MFC after:	1 day

[1] http://lists.freebsd.org/mailman/htdig/freebsd-multimedia/2005-December/003189.html
[2] http://lists.freebsd.org/mailman/htdig/freebsd-multimedia/2006-January/003422.html
2006-01-04 15:35:55 +00:00
Alexander Leidinger
9190333ce7 Fix the order of the stereo channels (left <-> right).
From the PR:
---snip---
 I think I have found the change which reversed the channels.
 Revision 1.44 of emu10k1.c, which added Audigy support, has the line

 emu_wrptr(sc, v->vnum, FXRT, 0xd01c0000);

 replaced with the following lines:

 if (sc->audigy) {
         emu_wrptr(sc, v->vnum, A_FXRT1, v->fxrt1);
         emu_wrptr(sc, v->vnum, A_FXRT2, v->fxrt2);
         emu_wrptr(sc, v->vnum, A_SENDAMOUNTS, 0);
 }
 else
         emu_wrptr(sc, v->vnum, FXRT, v->fxrt1 << 16);

 where v->fxrt1 << 16 == 0xd10c0000

 I don't have Audigy, so I'm not sure if the problem affects Audigy cards
 too. The order of the channels can't be tested by just altering mixer
 settings. Here's a small program to test if the channels are reversed on
 your sound card:

 #include <sys/soundcard.h>
 #include <fcntl.h>
 #include <unistd.h>

 int main(int argc, char **argv)
 {
 	int fd = open("/dev/dsp", O_WRONLY), format = AFMT_S16_LE;
   int channels = 2, rate = 22050, i;

   /* 450 Hz sine wave on left channel, right channel silent */
   unsigned char samples[] = {0, 0, 0, 0, 94, 16, 0, 0, 120, 32, 0, 0,
     9, 48, 0, 0, 208, 62, 0, 0, 143, 76, 0, 0, 12, 89, 0, 0, 19, 100,
     0, 0, 117, 109, 0, 0, 11, 117, 0, 0, 182, 122, 0, 0, 92, 126, 0,
     0, 239, 127, 0, 0, 105, 127, 0, 0, 202, 124, 0, 0, 32, 120, 0, 0,
     124, 113, 0, 0, 251, 104, 0, 0, 193, 94, 0, 0, 249, 82, 0, 0,
     212, 69, 0, 0, 138, 55, 0, 0, 85, 40, 0, 0, 120, 24, 0, 0, 51, 8,
     0, 0, 205, 247, 0, 0, 136, 231, 0, 0, 171, 215, 0, 0, 118, 200,
     0, 0, 44, 186, 0, 0, 7, 173, 0, 0, 63, 161, 0, 0, 5, 151, 0, 0,
     132, 142, 0, 0, 224, 135, 0, 0, 54, 131, 0, 0, 151, 128, 0, 0,
     17, 128, 0, 0, 164, 129, 0, 0, 74, 133, 0, 0, 245, 138, 0, 0,
     139, 146, 0, 0, 237, 155, 0, 0, 244, 166, 0, 0, 113, 179, 0, 0,
     48, 193, 0, 0, 247, 207, 0, 0, 136, 223, 0, 0, 162, 239, 0, 0};

   ioctl(fd, SNDCTL_DSP_SETFMT,&format);
   ioctl(fd, SNDCTL_DSP_CHANNELS,&channels);
   ioctl(fd, SNDCTL_DSP_SPEED,&rate);

   for(i=0;i<500;i++)
     write(fd, &samples, sizeof(samples));
   write(fd, &samples, 2); /* swap channels */
   for(i=0;i<500;i++)
     write(fd, &samples, sizeof(samples));

   return 0;
 }

 You should hear a sound on the left channel followed by a sound on the
 right channel. If you hear a sound on the right channel first, the
 channels are reversed.
---snip---

Owners of an audigy card should verify if it DTRT and report back.

Noticed by:	Matthias Buelow <mkb@mukappabeta.de>
Submitted by:	Juha-Matti Tilli <juhis@nallukka.net>
PR:		72221
2005-12-28 17:57:36 +00:00
Ariff Abdullah
88a50509af Add suspend and resume support. 2005-12-25 00:43:03 +00:00
Ruslan Ermilov
3238c6bd33 Fix -Wundef from compiling the amd64 LINT. 2005-12-04 10:06:06 +00:00
Ariff Abdullah
d5688b6a5b Support for ATI IXP 200 / 300 / 400 series audio controllers. 2005-11-27 03:29:59 +00:00
Pyun YongHyeon
d0ddbe88db Add a hack to ignore PCR bit for 6300ESB, 82801[D-G]B chips. It seems
that enabling busmastering would result in PCR bit ON after codec
reset.
While I'm here add DELAY(1) to codec access routine to give reasonable
time to codec operation. Without the delay, it would cause problems on
super-fast machines(> 2GHz). Also enable legacy audio for all 6300ESB,
82801[D-G]B chips. Previously, it enabled legacy audio for 82801DB(ICH4)
chip only.

Reported by:    Maxim Maximov mcsi AT mcsi DOT pp DOT ru
		Andrew Bliznak andriko.b AT gmail DOT com
Tested by:	brueffer, Maxim Maximov, Andrew Bliznak
2005-11-21 03:37:43 +00:00
Ariff Abdullah
7810d8e256 Fix a long standing unhandled interrupt bug which can cause
erratic system slowdown (beaten to a pulp) and possible panic. This
issue has bugged me for as long as I could remember, until I
realized that it is possible for register base offset to hold zero
value which is definitely a "FALSE".

Approved by:	netchild (mentor)
2005-11-14 18:18:52 +00:00
Ariff Abdullah
6a728ce536 - Added few more Intel HDA ids (ICH 6/7) which does have backward
compatible AC97 codec.
- As the driver supports so many variants, create a table ids for
  ease of probing and maintenance.
  Submitted by:		yongari
  Reviewed/Tested by:	multimedia@
- From luigi:
	The code to compute fragment sizes in the ich driver almost
	invariably ends up using the full buffer available, no matter
	how the user specifies fragment size and number.
	With audio telephony (8khz, 16bit-stereo) and the 16k buffer
	size this results in an unbearable 500ms delay.
	This patch makes sure that we never use more than 4 fragments,
	(i don't think we need more unless there are huge interrupt
	servicing latencies), and obey to the requested fragment size,
	so that latency is acceptable.
  Based on this (and after much regression tests), I can conclude
  that this driver works best with 2 fragments, thus solving various
  long standing issues of ICH driver not capable to flush or play
  short files perfectly.
  Suggested by:		luigi (the idea of smaller fragments)
- MPSAFE conversion.

Approved by:	netchild (mentor)
2005-11-14 18:18:12 +00:00
Ariff Abdullah
0ae68fd446 Use both (enabled by default) DAC1 and DAC2 to provide 2
distinct hardware playback channels. DAC configuration can be
accessed through kernel hint - hint.pcm.<unit>.dac="val" with
following possible values:

   0 = Enable both DACs (default)
   1 = Enable single DAC (DAC1)
   2 = Enable single DAC (DAC2)
   3 = Enable both DACs, swap position (DAC2 comes first instead
       of DAC1)

Special case for ES1370:
   Unlike ES1371,2,3/CT5880, volume for each DAC 1 and 2 can be
   controlled indepedently (synth for DAC1, pcm for DAC2). It is
   possible that user will confuse by this behaviour, since both
   DACs are enabled by default. Thus, provide a knob through sysctl
   hw.snd.pcm<unit>.single_pcm_mixer:
     0 = each DACs will be controlled separately (synth/pcm).
     1 = combine both DACs volume mixer controller into a single
         "pcm" (default)
   As a side note, fixed rate operation (provided by previous
   commit) is not a mandatory if the configuration space does not
   involve DAC2 (perhaps disabled by user through the above kernel
   hint). Unlike DAC2, DAC1 has its own register / control space,
   not affected by the speed settings of ADC.

Tested by:	multimedia@
Approved by:	netchild (mentor)
2005-11-14 18:17:31 +00:00
Ariff Abdullah
beb1654e70 Fix recording device selection based on ALS4000 datasheet.
- http://www.alsa-project.org/alsa/ftp/manuals/avance_logic/ALS4000a.PDF

Submitted by:	Watanabe Kazuhiro <CQG00620@nifty.ne.jp>
2005-11-07 09:26:17 +00:00
Alexander Leidinger
e7d2d131f1 - Locking improvements.
- Don't keep the SPDIF state in the driver private struct since it
  can be overriden by hand with pciconf(8), query it when needed instead.

Regarding the locking I let Ariff explain it himself:
---snip---
About the locking, that is what I'm intended to do since the beginning.
The reason I'm not putting that along since my first patchset was
because several people especially from amd46 camp reported that it cause
lots of LORs, which is weird considering that I've never encounter such
in a pretty much strict locking environment (i386). However, since our
previous discussion with Pyun YongHyeon about strict locking, I've
decided to bring it back for all the affected drivers, not just for
es137x. It turns out that the root of the problem was within dsp.c
during device open, which has been fixed since dsp.c revision 1.84.
---snip---

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
2005-10-05 20:05:52 +00:00
Alexander Leidinger
dcbde45390 Add a comment regarding problems with NForce 2 mainboards and add disabled
code which may help.

People with a ich compatible soundcard which want to help out should
change the "#if 1" to a "#if 0" and try if the soundcard still works.
Reports about working or not-working soundcards with this change to
multimedia@ please.

PR:		73987
2005-10-05 20:00:12 +00:00
Alexander Leidinger
34ac5f0f5f * Fixed rate operation for es1370 chip to solve conflicting
sampling rate between playback and recording. This can be
  disabled / enabled via kernel hints
  (hint.pcm.<unit>.fixed_rate=0/4000-48000) or sysctl
  hw.snd.pcm<unit>.fixed_rate=0/4000-48000). Default to 48khz
  fixed rate. [1]
* Basic cleanup. *_es1371x_* -> *_es137x_*.
* Some locking fixes. [2]

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Discussed with:	yongari [2]
See also:	http://lists.freebsd.org/pipermail/freebsd-multimedia/2005-September/002758.html [1]
Reported by:	Jos Backus <jos at catnook.com> [1]
2005-10-02 15:56:36 +00:00
Pyun YongHyeon
7535accf91 Unlock driver lock before calling resource_int_value(9).
This should fix LOR(in fact it's not LOR) in device attach.
2005-09-13 10:12:28 +00:00
Alexander Leidinger
df54be7080 Fix hang at init for MagicMedia 256A[VX] chips. [1]
In case this causes trouble for some other chipsets add a comment how to
proceed. If we don't get bugreports, this should be removed after a while
(some releases?).

PR:		56617 [1], 29465, 39260, 40574,	68225
Submitted by:	Matthew E. Gove <mgove@comcast.net> [1]
2005-09-11 17:30:27 +00:00
Alexander Leidinger
5ad14b759d Power up the external amplifiers additionally to powering up the DAC and ADC.
PR:		47029
Submitted by:	Anish Mistry <mistry.7@osu.edu>
Tested by:	David Murphy <dm@dmz.ie>
2005-09-11 14:15:05 +00:00
Alexander Leidinger
01bec79c11 * Add locking / MPSAFE
* Add kernel hint option to disable DXS channels entirely. Report
  from several skype users / Pav Lucistnik indicate that disabling
  DXS may fix lots of pop / crackling noise. To disable DXS add
  hint.pcm.<unit>.via_dxs_disabled="1" to /boot/device.hints.
  Further investigation of the issues regarding DXS showed, that
  the problem is in another (more generic) place, but until the
  right fix is tested/reviewed this may help a little bit.

Added sysctl's to aid testing/debugging:
hint.pcm.<unit>.via_dxs_disabled=X - Disable / Enable DXS channels entirely
hint.pcm.<unit>.via_dxs_channels=X - Limit DXS channels up to X
hint.pcm.<unit>.via_sgd_channels=X - Limit SGD channels up to X
hint.pcm.<unit>.via_dxs_src=X      - Enable / Disable DXS sample rate
                                     converter.

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Tested by:	multimedia@
2005-07-31 13:43:42 +00:00
Alexander Leidinger
cc730bdd4a Fix a LOR introduced with the last commit (some hours ago), I had the
wrong version of the patch.

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Pointy hat to:	netchild
2005-07-31 13:24:47 +00:00
Alexander Leidinger
69e10e5a1b Fix a LOR introduced in the last commit (some hours ago), I had the wrong
version of the patch...

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Pointy hat to:	netchild
2005-07-31 13:22:48 +00:00
Alexander Leidinger
ae93e580dd * Register programming error during device initialization
especially for CT4730 / EV1938 chip, causing misconfigured mixer
  (David Xu), crippled after power cycle (Kevin Oberman). Fixed.
* Incorporate locking/spdif patches from Jon Noack / matk. Not all
  es137x can really do spdif, clean it up a bit to only let few capable
  chip. This adds a "hw.snd.pcm<unit>.spdif_enabled" sysctl until
  a more generic way of handling this from userland (by an ordinary
  user) is designed/implemented.
* Convert all bus_space_(read|write) to use es_rd/es_wr, simmilar
  with other drivers.
* Add tunable hw.snd.pcm<unit>.latency_timer sysctl to toggle pci
  latency timer value on the fly. Much noise / pop / crackling
  issues can be solved by increasing its value. Other people have
  pointed out to use pciconf instead, but this is just an added
  value specific for CT4730/EV1938.
* Remove es137x specific debug sysctl/code.

Several PRs can now be closed.

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Submitted by:	Jon Noack <noackjr@alumni.rice.edu> (implicit)
Submitted by:	matk (implicit)
PR:		59349, 68594, 73498
Tested by:	multimedia@
2005-07-31 13:19:38 +00:00
Alexander Leidinger
f769fa83d5 This driver is already MPSAFE, remove busdma_lock_mutex and Giant from
bus_dma_tag_create.

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
2005-07-31 12:38:22 +00:00
Alexander Leidinger
2b379e8d35 * Add locking / MPSAFE.
Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Tested by:	netchild
2005-07-31 11:04:36 +00:00
Alexander Leidinger
1adf8286e7 * als4000 can't do 48k properly (perhaps it really can't at all!).
Set maxspeed to 44.1k instead.
* Add locking / MPSAFE
* Fix recording

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
2005-07-31 11:01:13 +00:00
Gleb Smirnoff
961478afd1 Implement suspend/resume operation for snd_csa(4)
PR:		kern/82243
Submitted by:	Serge Semenenko
Approved by:	re (scottl)
MFC after:	1 month
2005-06-27 07:43:57 +00:00
Seigo Tanimura
7b7c2c20d4 s/-1000/BUS_PROBE_LOW_PRIORITY/
Pointed out by:	nyan
2005-05-29 23:22:23 +00:00
Seigo Tanimura
db051dad5f Add 6300ESB, which should be treated as ICH4.
PR:		kern/81573
Submitted by:	OOTOMO Hiroyuki <ootomo@za.wakwak.com>
MFC after:	1 week
2005-05-28 09:32:43 +00:00
Pyun YongHyeon
c21880a7df Make snd_maestro3(4) mpsafe
- Let m3_pchan_trigger()/m3_rchan_trigger() acquire lock and call
   m3_pchan_trigger_locked()/m3_rchan_trigger_locked() respectivly.
 - Mark interrupt handler INTR_MPSAFE.
 - Add locks in sound/channel interface.

Tested by:	nork
2005-05-23 06:27:07 +00:00
Matthew N. Dodd
8f6a80b791 Make it clear that the statement following the conditional is a NOP. 2005-04-13 06:42:43 +00:00
Murray Stokely
ddc5ac8b73 Return BUS_PROBE_DEFAULT in preference to 0.
Pointed out by:	Nate Lawson <nate@root.org>
2005-03-20 20:13:21 +00:00
Murray Stokely
a52010a036 Add device id for nForce 4 audio controller.
PR:		kern/78482
Submitted by:	Markus Niemistö <markus.niemisto@iki.fi>
MFC after:	1 week
2005-03-19 01:39:13 +00:00
Warner Losh
d2b677bb1a Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in
preference to some random negative number to allow other drivers a
bite at the apple.
2005-03-01 08:58:06 +00:00
Warner Losh
7c61c21042 BUS_SPACE_UNRESTRICTED shouldn't be used with the bus_alloc_resource
interface.  Instead, move to the convenience _any interface.
2005-02-01 07:43:34 +00:00
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Ruslan Ermilov
cf7190f2ea Fix build.
Submitted by:	Taku YAMAMOTO
2004-11-11 13:01:13 +00:00
Julian Elischer
15b0a9c8f7 Add record capability.
Submitted by:	Taku Yamamoto  (original author)
2004-11-10 04:29:09 +00:00
Pyun YongHyeon
a2f4d2f5b0 Limit DMA address space to 1GB since the trident audio cards can't
handle DMA addresses located above 1GB. The LBA(loop begin address)
register which holds DMA base address is 32bits register. But the
MSB 2bits are used for other purposes. This effectivly limits the
DMA address space up to 1GB.

Approved by:	jake (mentor)
Reviewed by:	truckman, matk
2004-10-13 06:04:01 +00:00
Pyun YongHyeon
eba1cb6e3e Audio drivers failed to detect failure condition and attempted to
assign DMA address to the wrong address. It can cause system lockup
or other mysterious errors. Since most sound cards requires low DMA
address(BUS_SPACE_MAXADDR_24BIT) sndbuf_alloc() would fail when the
audio driver is loaded after long running of operations.

Approved by:	jake (mentor)
Reviewed by:	truckman, matk
2004-10-13 05:45:16 +00:00
Paul Saab
c6eadeaa66 Add ICH6 support. 2004-09-28 01:32:58 +00:00
Dag-Erling Smørgrav
c70315d4a8 Correct the capitalization of "nVidia". 2004-09-21 13:17:55 +00:00
MIHIRA Sanpei Yoshiro
82ad8eff9e Add support Nvidia nForce2(audio)
PR:		kern/71317
Submitted by:	Mezz <mezz@freebsd.org>
MFC after:	1 week
2004-09-20 07:19:49 +00:00
MIHIRA Sanpei Yoshiro
e99e85532a Add support nForce3 250 audio
PR:		kern/71726
Submitted by:	FUJIMOTO Kou <fujimoto@j.dendai.ac.jp>
MFC after:	1 week
2004-09-20 05:59:17 +00:00
Maxim Sobolev
a02bcc107c Backout the code which tries to use undocumented way to determine if
fm801 has sound capabilities or not. Unfortunately this code doesn't
work as expected.

Submitted by:	many
MFC after:	3 days
2004-09-15 23:47:17 +00:00
Brian Feldman
bf5ab950e3 The new contigmalloc code is exposing a lot of misuses of busdma memory
allocation. Notably, in this case, the driver tries to allocate several
pieces of memory and then fails if the pieces allocated after the first
do not come after it physically, and within a specific range (8MB I
believe).  Of course, this could just as easily fail for any number of
reasons, but it almost always fails now that contiguous allocations start
at the end of possible specified memory locations rather than the beginning.

Allocate all the possibly-needed memory up front, even though it's a waste,
to get around this.  The least bogus solution would be to take the physical
address from the first allocation and create a new tag that specified that
further allocations must follow it within that 8MB window, then use that
when allocating new channels, but that's left for anyone else that really
feels like doing it.

Tested by:	Erwin Lansing <erwin@lansing.dk>
2004-08-22 18:57:40 +00:00
David E. O'Brien
6fbf600e5b Remove rev 1.50. 2004-07-24 15:30:23 +00:00
Seigo Tanimura
0739ea1de2 Rename the sound device drivers:
- `sound'
  The generic sound driver, always required.

- `snd_*'
  Device-dependent drivers, named after the sound module names.
  Configure accordingly to your hardware.

In addition, rename the `snd_pcm' module to `sound' in order to sync
with the driver names.

Suggested by:	cg
2004-07-16 04:00:08 +00:00
Bruce M Simpson
588f096065 Check the return value of bus_dmamem_alloc() correctly.
Submitted by:	Darron Broad (with cleanups)
2004-07-04 18:40:36 +00:00
David E. O'Brien
07f5454078 Add PCI identifier for Dell modified SBLive! card
Submitted by:	Joseph Dunn <joseph@magnesium.net>
2004-06-13 22:12:02 +00:00
Maxime Henrion
0547806326 Make the emu10k1 pcm driver INTR_MPSAFE. The locking is modeled
exactly as done in the cmi driver.  I am quite confident this is
safe since I'm runing this for more than two weeks now, on an SMP
box.  A few people tested this patch for me successfully as well.
2004-06-04 16:42:33 +00:00
Seigo Tanimura
a5dc42def9 Axe the old midi drivers and framework. matk has developed a new
module-friendly midi subsystem to be merged soon.
2004-06-01 06:22:59 +00:00
Mathew Kanner
3858fd7a0c Add PCI ID for via 8237.
Submitted by:	Josh Elsasser <jre@vineyard.net>
Approved by:	tanimura (mentor)
PR:		kern/61730
2004-05-26 22:05:50 +00:00
Brian Feldman
a7d7f349bd This driver certainly works fine turning INTR_MPSAFE back on. For those
of you with other cards, please do review and test the drivers for
MP-safety and disable Giant in the interrupt routines when you are
sure of proper functionality.
2004-04-21 04:23:51 +00:00
Brian Feldman
8fb9a995cf The newpcm headers currently #define away INTR_MPSAFE and INTR_TYPE_AV
because they bogusly check for defined(INTR_MPSAFE) -- something which
never was a #define.  Correct the definitions.

This make INTR_TYPE_AV finally get used instead of the lower-priority
INTR_TYPE_TTY, so it's quite possible some improvement will be had
on sound driver performance.  It would also make all the drivers
marked INTR_MPSAFE actually run without Giant (which does seem to
work for me), but:
	INTR_MPSAFE HAS BEEN REMOVED FROM EVERY SOUND DRIVER!
It needs to be re-added on a case-by-case basis since there is no one
who will vouch for which sound drivers, if any, willy actually operate
correctly without Giant, since there hasn't been testing because of
this bug disabling INTR_MPSAFE.

Found by:	"Yuriy Tsibizov" <Yuriy.Tsibizov@gfk.ru>
2004-04-14 14:57:49 +00:00
Mathew Kanner
236efae6a9 By default, ich4 has NAMBAR and NABMBAR i/o spaces as
read-only.  Need to enable "legacy support", by poking
into pci config space.  (comment from the patch)

Submited by:	Autrijus Tang <autrijus@autrijus.org>
Approved by:	tanimura (mentor)
2004-03-31 00:11:24 +00:00
Marcel Moolenaar
056dc22c4f Actually program the list of recording devices in sv_mix_setrecsrc().
This change has not been tested.

This change was triggered by a gcc(1) warning on ia64 at -O2.  The
variable v was not used after being computed, which resulted in enough
dead code elimination (DCE) to confuse the compiler and emit a bogus
warning about the use of the variable i without prior definition. The
variable i is the loop variable.

Submitted by: des
Responsibility: marcel
2004-03-20 04:38:21 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Mathew Kanner
0d8ed52ea5 Augment /dev/sndstat with the module names, if applicable.
Approved by:	  tanimura (mentor)
2004-03-06 15:52:42 +00:00
Poul-Henning Kamp
4555065861 As previously announced: discontinue use of makedev() call in soundcode.
This takes us a lot closer to refcounting dev_t.

This patch originally by cg@ with a few minor changes by me.

It is largely untested, but has been HEADSUP'ed twice, so presumably
people have not found any issues with it.

Submitted by:	cg@
2004-01-17 10:37:11 +00:00
David E. O'Brien
b64a0ad5c1 Specify the right location of the generated header. 2004-01-12 00:06:30 +00:00
David E. O'Brien
21f1e37cbd Add Audigy support.
I started with a year-old patch by Orlando Bassotto
<orlando.bassotto@ieo-research.it>, and ported it to 5.2-CURRENT along with
fixing the problems working with pre-Audigy cards.
2004-01-11 10:30:56 +00:00
David E. O'Brien
c1d6534deb Remove EMUDEBUG [un]def. This should be done in the Makefile. 2004-01-11 01:34:41 +00:00
David E. O'Brien
2511c244ad Sync with Creative's 8010.h rev 1.51. 2004-01-09 06:38:11 +00:00
Scott Long
42c3555cff Fix sound LOR problems:
dsp_open: rearrange to only hold one lock at a time

dsp_close: ditto

mixer_hwvol_init: delete locking, the only consumer seems to
be the ess driver and it only call it a creation time, I
think the device will be stable across the sleepable malloc.

cmi interrupt routine: Release locks while caller chn_intr,
either this or do what emu10k1 does which is have no locks
at in the interrupt handler.

Submitted by:	mat@cnd.mcgill.ca
2003-11-11 05:38:28 +00:00
Dag-Erling Smørgrav
7847079929 A couple of months' worth of back-burner hacking: restructure to better
handle the minor (but significant) differences between the various
Vortex chips; add (incomplete) support for playback.
2003-10-12 11:33:39 +00:00
Nate Lawson
feec6a7a90 Correctly reset ich[3-5] sound cards on resume. This fixes audio playback
after suspend/resume for me.

PR:
Submitted by:	iwasaki
Reviewed by:	orion
Approved by:	cg
Obtained from:
MFC after:
2003-09-15 21:16:47 +00:00
Cameron Grant
3f22597838 update my email address. 2003-09-07 16:28:03 +00:00
David E. O'Brien
bbee264035 Recognize the sound chip on the Opteron-based nForce3 motherboards
(such as the Asus SK8N).
2003-09-03 07:38:21 +00:00
John Baldwin
e27951b29c Use PCIR_BAR(x) instead of PCIR_MAPS.
Glanced over by:	imp, gibbs
Tested by:		i386 LINT
2003-09-02 17:30:40 +00:00
Orion Hodson
99e082c84d Add Creative SB AudioPCI CT4730 rev A.
Submitted by:	David Xu <davidxu@FreeBSD.org>
PR:		kern/54810
2003-08-29 03:27:26 +00:00
David E. O'Brien
d4aeb0ed01 Add sound support for the AMD64 8111 chip.
PR:		kern/55932
Submitted by:	Mark Kettenis <kettenis@chello.nl>
2003-08-28 19:21:21 +00:00
Ian Dowse
3944d0ff35 When calculating the block size to use for a particular sample rate,
round the result up to a multiple of 4 bytes so that it will always
be a multiple of the sample size. Also use the actual buffer size
from sc->bufsz instead of the default DS1_BUFFSIZE.

This fixes panics and bad distortion I have seen on Yamaha DS-1
hardware, mainly when playing certain Real Audio media.

Reviewed by:	orion (an earlier version of the patch)
2003-08-23 13:00:48 +00:00
Warner Losh
90cf0136c4 Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 07:08:17 +00:00
Cameron Grant
8e01d384af disable resume code implementing panic().
this needs to be reimplemented properly.
2003-08-14 22:09:10 +00:00
Orion Hodson
4cca7f0aed Switch from legacy to native mode for ICH4 and ICH5.
Submitted by: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
Test by: Markko Merzin <markko@short.cut.ee>
PR: kern/53242
MFC after: 5 days
2003-08-10 14:57:47 +00:00
Cameron Grant
e2df178350 * support ich5
PR:		kern/53242
Submitted by:	Shin-ichi Yoshimoto <yosimoto@waishi.jp>  (partly)
Tested by:	Dominic Marks <dom@cus.org.uk> (version in PR)
MFC after:	1 week
2003-07-06 23:54:00 +00:00
Cameron Grant
b6eb8f8a31 * add support for amd-768 audio, as used on many dual athlon boards. only
tested for playback.

* modify device name strings for ich chips to better conform with their
common names.

* remove superflous 'AC97 controller' from nforce device names.

MFC after: 1 week
2003-07-06 03:11:06 +00:00
Scott Long
f6b1c44d1f Mega busdma API commit.
Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma.  At the moment, this is used for the
asynchronous busdma_swi and callback mechanism.  Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg.  dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create().  The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms.  The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by:	tmm, gibbs
2003-07-01 15:52:06 +00:00
Dag-Erling Smørgrav
f834a1168c Add (but do not connect) a half-finished driver for Aureal Vortex cards.
The mixer works, pcm support is half done.
2003-06-01 11:58:46 +00:00
David E. O'Brien
82d4d32d65 more style(9) changes. 2003-04-20 09:07:14 +00:00
David E. O'Brien
e3da61d733 more style(9) changes. 2003-04-20 08:37:29 +00:00
David E. O'Brien
ee1ca8b7f5 A few style(9) fixes. 2003-04-20 07:43:09 +00:00
David E. O'Brien
aca6bb0d8c Sync with Creative's 8010.h rev 1.39. 2003-04-18 04:13:38 +00:00
Orion Hodson
5a289baba9 Perform warm or cold reset AC97 per the spec depending on state of the
codec during initialization.  This code mirrors the reset code used on
the VIA82c686 and fixes a codec initialization failure (SoundMAX
AD1885) reported by Matthias Schuendehuette.
2003-04-17 15:04:11 +00:00
Hidetoshi Shimokawa
30eaffaf6c Fix bogus maxsegsz parameter for bus_dma_tag_create().
MFC: 1 week
2003-04-16 05:03:35 +00:00
Matthew N. Dodd
533294b956 - Don't call pci_enable_io() in drivers (unless needed for resume).
- Don't test memory/port status and emit an error message; the PCI
  bus code will do this now.
2003-04-16 03:16:57 +00:00
Orion Hodson
538b04e4ad Fix mismatch between bus address stored for buffer descriptors and
actual address of buffer descriptor.  This should fix the reported
calibration failures and subsequent speed problems with ich chipsets.

Minor calibration comment updates.
2003-04-04 07:15:19 +00:00
Orion Hodson
6084370fe4 Perform warm reset if codec reports ready on attach.
Move AC97 link control power up poke so it is always performed on attach.
2003-03-28 16:33:15 +00:00
Orion Hodson
abe88fc972 Re-work ac97 initialization to match cold reset described in AC97r.23
and be prepared to wait much longer for codec to become ready.

Credit to Hugo D. Valentim <hvalentim@gmx.net> for reporting the
problem, providing useful pointers, and repeated diff testing.
2003-03-26 06:11:36 +00:00
Orion Hodson
8f832fd0ba For the VIA8233A use multi-sgd register set for primary playback
channel and disable DXS3.  Several users have reported DXS3 as playing
at half speed on the 8233A revision of the chipset.  This implicitly
means no SPDIF for VIA8233A users.
2003-03-26 05:51:13 +00:00
Orion Hodson
78a248c1db Add defines for low power and second codec ready. 2003-03-26 05:35:38 +00:00
Orion Hodson
600f6cbaa2 Distinguish between register sets that depend on ac97 caps (wr0, wr1,
msgd) and those that don't (dxs0-3) when reporting format caps.
2003-03-20 20:07:18 +00:00
Orion Hodson
876d09d890 Attempt a hard reset if AC97 codec is not ready on attach.
Halt attach if mixer_init fails.

Prompted by: points raised by Hugo Valentim <hvalentim@gmx.net>.
2003-03-05 05:56:18 +00:00
Olivier Houchard
33673595a6 Unbreak emu10k1 by properly using the buffer address.
New contestant for the lamest commit of the year award:	cognet
2003-02-26 16:11:18 +00:00
Orion Hodson
148f84cf1e Fix compilation on alpha. Pointy hat to Marcel. 2003-02-23 01:06:58 +00:00
Orion Hodson
c7bbf97e00 o Add back support for DXS channels.
o Make DXS3 the primary playback channel.  It may be the only
universally supported channel with the assorted revisions of this
chipset.

o Add sysctl and handler for enabling s/pdif output from DXS3.
2003-02-22 23:28:15 +00:00
Orion Hodson
3299968464 Clean up viachan_init. 2003-02-21 01:47:59 +00:00
Orion Hodson
439fa3dd0a Fix assignment of record sgd_addr and clean up via8233chan_init. 2003-02-21 01:47:17 +00:00
Olivier Houchard
38cc994207 Implement a "sndbuf_getbufaddr" function and use it instead of vtophys().
Reviewed by:	orion
2003-02-20 17:31:12 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Alfred Perlstein
8deebb0160 Consolidate MIN/MAX macros into one place (param.h).
Submitted by: Hiten Pandya <hiten@unixdaemons.com>
2003-02-02 13:17:30 +00:00
Orion Hodson
cb4458e030 Disable DRA to fix problems with recording. 2003-01-26 04:23:23 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Orion Hodson
a7697e5514 Add nForce2 device id.
Submitted by:	"Mikko S. Hyvarinen" <morphy@morphy.iki.fi>
MFC after:	5 days
2003-01-13 17:42:13 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Semen Ustimenko
83190e29d3 Do not return(foo()) in void function.
Submitted by:	marius@alchemy.franken.de
MFC after:	3 days
2002-12-18 22:53:24 +00:00