Commit Graph

987 Commits

Author SHA1 Message Date
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
cc726a7f98 Don't try to workaround broken apps (if any). If this still the case,
lets fix the broken apps instead.
2006-12-07 07:48:58 +00:00
Ariff Abdullah
b45d0ec80d Remove comment that is no longer relevant since previous
buffering fix.
2006-12-07 07:48:20 +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
Alexander Leidinger
4bc4dc4c4b MFP4 (109713):
Add OSS_GETVERSION ioctl for compatibility.

Some ports expect this and fail to compile on -current ATM.

Submitted by:	ryanb
2006-11-26 11:55:48 +00:00
Alexander Leidinger
394ebd352c MFP4:
Rename MAX_SAMPLE_RATES macro to OSS_MAX_SAMPLE_RATES.  The old
	macro clashed with those used in other applications and libaries
	(ex: RtAudio).  4Front responded by updating their spec, so we
	will follow suit.

Submitted by:	ryanb
Noticed by:	pointyhat/kris
2006-10-28 09:51:10 +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
503ee05bc3 Wrap debug printfs into SEQ_DEBUG() to avoid kernel messages clutter
during module unload.
2006-10-15 08:23:48 +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
Alexander Leidinger
0f85b689a5 Remove unnecessary test case. (As written, that branch will never
be followed.)

Submitted by:	ryanb
Found with:	Coverity Prevent
CID:		239860
2006-10-08 17:13:54 +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
3f630febba Backout remaining changes that make most AD1981B users unhappy.
The exact situation is understood, and proper solution will follow
sooner.
2006-10-02 20:46:34 +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
4f53344b73 Disable ad1981_patch for now until the real solution can be found
and makes everybody happy.
2006-10-02 15:32:12 +00:00
Ariff Abdullah
aab23ae39a Make this buildable on IA64.
Reported by:	phk
2006-10-02 15:26:37 +00:00
Alexander Leidinger
f06e3ebc56 snd_ak452x is replaced by snd_spicds and snd_envy24ht is new. 2006-10-01 14:57:34 +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
2c72e284ca Connect snd_hda(4) to build process...
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:18:56 +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
Ariff Abdullah
7567f38c8f Nuke OSSV4_EXPERIMENT ifdefs from kludgy MIXER_SIZE definition
since the exclusion of sizeof(oss_mixer_enuminfo) is the real
cause of overflow (worth of +3000 bytes).

Noticed by:	tegge
2006-09-30 01:24:22 +00:00
Ariff Abdullah
8ddbd40588 The addition of few more 32bit integer into struct snd_mixer causing
an accidental MIXER_SIZE overflow. Use 8bit integer instead of 32bit
to reduce the kludge size.

Noticed by:	tegge
2006-09-30 01:01:18 +00:00
Ariff Abdullah
18f453658f Fix pointer dereference before NULL pointer checking.
Noticed by:	netchild
CID:		243889
Found by:	Coverity Prevent (TM)
2006-09-29 14:08:53 +00:00
Ruslan Ermilov
a861847014 SNDCTL_TMR_{START,STOP,CONTINUE} don't take an argument. 2006-09-29 09:28:22 +00:00
Ruslan Ermilov
f77472e6dc The SNDCTL_DSP_NONBLOCK ioctl doesn't take an argument, from
what I can tell by browsing the Internet (Linux, OSS, etc.).
2006-09-29 09:10:54 +00:00
Ariff Abdullah
7699548f1b Various fixups, especially for the upcomming High Definition Audio
commit.

1) sys/dev/sound/pcm/sound.h
   sys/dev/sound/pcm/channel.c
   * Be more specific: SD_F_SOFTVOL -> SD_F_SOFTPCMVOL
2) sys/dev/sound/pcm/mixer.[ch]
   * Implement
       mix_setparentchild()
       mix_setrealdev()
       mix_getparent()
       mix_getchild()
     The purpose of these functions is implement relative volume
     adjustment, such as to tie two or more mixer device into a
     single logical device. Usefull for the upcoming HDA driver
     and few AC97 codec (such as AD1981B) where the master volume
     "vol" need to be implemented using this logical manner.
3) sys/dev/sound/pcm/ac97_patch.[ch]
   * Patch for AD1981B codec to enable (automuting) headphone jack sense.
4) sys/dev/sound/pcm/ac97.c
   * Implement proper logical master volume for AD9181B codec
     through various mix_set{parentchild,realdev}(). Tie both
     "ogain" (headphone volume) and "phone" (speaker/lineout) to
     a logical "vol".
5) sys/dev/sound/pcm/usb/uaudio_pcm.c
   * ditto, for "vol" -> { "pcm" }.

MFC after:	1 month
2006-09-28 17:29:00 +00:00
Alexander Leidinger
18c15b598d Fix uninitialized variable warning.
Submitted by:	dhw
Reviewed by:	ryanb
2006-09-24 17:37:03 +00:00
Alexander Leidinger
b611c801f0 MFp4 the sound Google Summer of Code project:
The goal was to sync with the OSSv4 API 4Front Technologies uses in their
proprietary OSS driver. This was successful as far as possible. The part
of the API which is stable is implemented, for the rest there are some
stubs already.

New system ioctls:
 - SNDCTL_SYSINFO - obtain audio system info (version, # of audio/midi/
   mixer devices, etc.)
 - SNDCTL_AUDIOINFO - fetch details about a specific audio device
 - SNDCTL_MIXERINFO - fetch details about a specific mixer device

New audio ioctls:
 - Sync groups (SNDCTL_DSP_SYNCGROUP/SNDCTL_DSP_SYNCSTART) which allow
   triggered playback/recording on multiple devices (even across processes
   simultaneously).
 - Peak meters (SNDCTL_DSP_GETIPEAKS/SNDCTL_DSP_GETOPEAKS) - can query
   audio drivers for peak levels (needs driver support, disabled for now).
 - Per channel playback/recording levels -
   SNDCTL_DSP_{GET,SET}{PLAY,REC}VOL.  Note that these are still in name
   only, just wrapping around the AC97-style mixer at the moment. The next
   step is to push them down to the drivers.

Audio ioctls still under development by 4Front (for which stubs may exist
in this commit):
 - SNDCTL_GETNAME, SNDCTL_{GET,SET}{SONG,LABEL}
 - SNDCTL_DSP_{GET,SET}_CHNORDER
 - SNDCTL_MIX_ENUMINFO, SNDCTL_MIX_EXTINFO - (might be documented enough in
   the OSS releases to work on this.  These ioctls cover the cool "twiddle
   any knob on your card" features.)

Missing:
 - SNDCTL_DSP_COOKEDMODE -- this ioctl is used to give applications direct
   access to a card's buffers, bypassing the feeder architecture.  It's
   a toughy -- "someone" needs to decide :
   (a) if this is desireable, and (b) if it's reasonably feasible.

Updates for driver writers:
 So far, only two routines to the channel class (in channel_if.m) are added.
 One is for fetching a list of discrete supported playback/recording rates
 of a channel, and the other is for fetching peak level info (useful for
 drawing peak meters).  Interested parties may want to help pushing down
 SNDCTL_DSP_{GET,SET}{PLAY,REC}VOL into the drivers.

To use the new stuff you need to rebuild the sound drivers or your kernel
(depending on if you use modules or not) and to install soundcard.h (a
buildworld/installworld handles this).

Sponsored by:	Google SoC 2006
Submitted by:	ryanb
Many thanks to:	4Front Technologies for their cooperation, explanations
		and the nice license of their soundcard.h.
2006-09-23 20:45:47 +00:00
Alexander Leidinger
f3ed5ebbcf Fix the check where we want to use the end of the supported range if the
value is out of the supported range.

Noticed by:	Ed Schouten <ed@fxq.nl>
Reviewed by:	Kazuhito HONDA <kazuhito@ph.noda.tus.ac.jp>
2006-09-09 14:43:03 +00:00
Scott Long
448ddd747f Catch up to USB changes. 2006-09-07 05:21:52 +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