Skip site navigation (1)Skip section navigation (2)

CVS log for src/sys/dev/sound/pci/maestro.c

[BACK] Up to [FreeBSD] / src / sys / dev / sound / pci

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.38.4.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (3 months ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.38.4.1: preferred, colored; next MAIN 1.39: preferred, colored
Changes since revision 1.38.4.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Nov 7 15:43:11 2011 UTC (3 months ago) by ed
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +1 -1 lines
SVN rev 227309 on 2011-11-07 15:43:11Z by ed

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.

Revision 1.38.4.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.38: preferred, colored; next MAIN 1.39: preferred, colored
Changes since revision 1.38: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)

Revision 1.36.2.1.10.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 3 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.36.2.1: preferred, colored; next MAIN 1.37: preferred, colored
Changes since revision 1.36.2.1: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)

Revision 1.38.2.1.6.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 3 weeks ago) by kensmith
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.38.2.1: preferred, colored; next MAIN 1.38.4.1: preferred, colored
Changes since revision 1.38.2.1: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)

Revision 1.38.2.1.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 4 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.38.2.1: preferred, colored; next MAIN 1.38.4.1: preferred, colored
Changes since revision 1.38.2.1: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)

Revision 1.36.2.1.8.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (2 years ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.36.2.1: preferred, colored; next MAIN 1.37: preferred, colored
Changes since revision 1.36.2.1: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)

Revision 1.38.2.1.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.38.2.1: preferred, colored; next MAIN 1.38.4.1: preferred, colored
Changes since revision 1.38.2.1: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)

Revision 1.38.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
CVS tags: RELENG_8_2_BP, RELENG_8_1_BP, RELENG_8_0_BP
Branch point for: RELENG_8_2, RELENG_8_1, RELENG_8_0
Diff to: previous 1.38: preferred, colored; next MAIN 1.39: preferred, colored
Changes since revision 1.38: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sun Jun 7 19:12:08 2009 UTC (2 years, 8 months ago) by ariff
Branches: MAIN
CVS tags: RELENG_9_BP, RELENG_8_BP
Branch point for: RELENG_9, RELENG_8
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +32 -48 lines
SVN rev 193640 on 2009-06-07 19:12:08Z by ariff

Sound Mega-commit. Expect further cleanup until code freeze.

For a slightly thorough explaination, please refer to
	[1] http://people.freebsd.org/~ariff/SOUND_4.TXT.html .

Summary of changes includes:

1 Volume Per-Channel (vpc).  Provides private / standalone volume control
  unique per-stream pcm channel without touching master volume / pcm.
  Applications can directly use SNDCTL_DSP_[GET|SET][PLAY|REC]VOL, or for
  backwards compatibility, SOUND_MIXER_PCM through the opened dsp device
  instead of /dev/mixer.  Special "bypass" mode is enabled through
  /dev/mixer which will automatically detect if the adjustment is made
  through /dev/mixer and forward its request to this private volume
  controller.  Changes to this volume object will not interfere with
  other channels.

  Requirements:
    - SNDCTL_DSP_[GET|SET][PLAY|REC]_VOL are newer ioctls (OSSv4) which
      require specific application modifications (preferred).
    - No modifications required for using bypass mode, so applications
      like mplayer or xmms should work out of the box.

  Kernel hints:
    - hint.pcm.%d.vpc (0 = disable vpc).

  Kernel sysctls:
    - hw.snd.vpc_mixer_bypass (default: 1).  Enable or disable /dev/mixer
      bypass mode.
    - hw.snd.vpc_autoreset (default: 1).  By default, closing/opening
      /dev/dsp will reset the volume back to 0 db gain/attenuation.
      Setting this to 0 will preserve its settings across device
      closing/opening.
    - hw.snd.vpc_reset (default: 0).  Panic/reset button to reset all
      volume settings back to 0 db.
    - hw.snd.vpc_0db (default: 45).  0 db relative to linear mixer value.

2 High quality fixed-point Bandlimited SINC sampling rate converter,
  based on Julius O'Smith's Digital Audio Resampling -
  http://ccrma.stanford.edu/~jos/resample/.  It includes a filter design
  script written in awk (the clumsiest joke I've ever written)
    - 100% 32bit fixed-point, 64bit accumulator.
    - Possibly among the fastest (if not fastest) of its kind.
    - Resampling quality is tunable, either runtime or during kernel
      compilation (FEEDER_RATE_PRESETS).
    - Quality can be further customized during kernel compilation by
      defining FEEDER_RATE_PRESETS in /etc/make.conf.

  Kernel sysctls:
    - hw.snd.feeder_rate_quality.
      0 - Zero-order Hold (ZOH).  Fastest, bad quality.
      1 - Linear Interpolation (LINEAR).  Slightly slower than ZOH,
          better quality but still does not eliminate aliasing.
      2 - (and above) - Sinc Interpolation(SINC).  Best quality.  SINC
          quality always start from 2 and above.

  Rough quality comparisons:
    - http://people.freebsd.org/~ariff/z_comparison/

3 Bit-perfect mode.  Bypasses all feeder/dsp effects.  Pure sound will be
  directly fed into the hardware.

4 Parametric (compile time) Software Equalizer (Bass/Treble mixer). Can
  be customized by defining FEEDER_EQ_PRESETS in /etc/make.conf.

5 Transparent/Adaptive Virtual Channel. Now you don't have to disable
  vchans in order to make digital format pass through.  It also makes
  vchans more dynamic by choosing a better format/rate among all the
  concurrent streams, which means that dev.pcm.X.play.vchanformat/rate
  becomes sort of optional.

6 Exclusive Stream, with special open() mode O_EXCL.  This will "mute"
  other concurrent vchan streams and only allow a single channel with
  O_EXCL set to keep producing sound.

Other Changes:
    * most feeder_* stuffs are compilable in userland. Let's not
      speculate whether we should go all out for it (save that for
      FreeBSD 16.0-RELEASE).
    * kobj signature fixups, thanks to Andriy Gapon <avg@freebsd.org>
    * pull out channel mixing logic out of vchan.c and create its own
      feeder_mixer for world justice.
    * various refactoring here and there, for good or bad.
    * activation of few more OSSv4 ioctls() (see [1] above).
    * opt_snd.h for possible compile time configuration:
      (mostly for debugging purposes, don't try these at home)
        SND_DEBUG
        SND_DIAGNOSTIC
        SND_FEEDER_MULTIFORMAT
        SND_FEEDER_FULL_MULTIFORMAT
        SND_FEEDER_RATE_HP
        SND_PCM_64
        SND_OLDSTEREO

Manual page updates are on the way.

Tested by:	joel, Olivier SMEDTS <olivier at gid0 d org>, too many
          	unsung / unnamed heroes.

Revision 1.36.2.1.6.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.36.2.1: preferred, colored; next MAIN 1.37: preferred, colored
Changes since revision 1.36.2.1: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)

Revision 1.36.2.1.4.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.36.2.1: preferred, colored; next MAIN 1.37: preferred, colored
Changes since revision 1.36.2.1: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)

Revision 1.28.2.3.8.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.28.2.3: preferred, colored; next MAIN 1.29: preferred, colored
Changes since revision 1.28.2.3: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)

Revision 1.36.2.1: download - view: text, markup, annotated - select for diffs
Sat Dec 15 04:07:25 2007 UTC (4 years, 1 month ago) by ariff
Branches: RELENG_7
CVS tags: RELENG_7_4_BP, RELENG_7_3_BP, RELENG_7_2_BP, RELENG_7_1_BP, RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0
Branch point for: RELENG_7_4, RELENG_7_3, RELENG_7_2, RELENG_7_1
Diff to: previous 1.36: preferred, colored; next MAIN 1.37: preferred, colored
Changes since revision 1.36: +12 -3 lines
MFC:

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
Approved by:	re (kensmith)

Revision 1.37: download - view: text, markup, annotated - select for diffs
Fri Dec 14 02:16:26 2007 UTC (4 years, 1 month ago) by ariff
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +12 -3 lines
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

Revision 1.36: download - view: text, markup, annotated - select for diffs
Sun Jun 17 06:10:42 2007 UTC (4 years, 7 months ago) by ariff
Branches: MAIN
CVS tags: RELENG_7_BP
Branch point for: RELENG_7
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +1 -5 lines
Flush remaining malloc() cleanups (M_NOWAIT -> M_WAITOK).

Revision 1.35: download - view: text, markup, annotated - select for diffs
Thu Mar 15 16:41:26 2007 UTC (4 years, 10 months ago) by ariff
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +1 -1 lines
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.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Fri Feb 23 13:47:34 2007 UTC (4 years, 11 months ago) by netchild
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +2 -2 lines
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

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sat Jan 27 13:30:19 2007 UTC (5 years ago) by ariff
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +100 -102 lines
Massive inlining cleanups/removal to make it survive on WARNS=2.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Sun Jun 18 14:14:41 2006 UTC (5 years, 7 months ago) by netchild
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +3 -0 lines
- 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.

Revision 1.28.2.3: download - view: text, markup, annotated - select for diffs
Sat Feb 4 11:58:28 2006 UTC (6 years ago) by netchild
Branches: RELENG_6
CVS tags: RELENG_6_4_BP, RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3, RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2, RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1
Branch point for: RELENG_6_4
Diff to: previous 1.28.2.2: preferred, colored; branchpoint 1.28: preferred, colored; next MAIN 1.29: preferred, colored
Changes since revision 1.28.2.2: +10 -9 lines
MFC
 - rev 1.31 of maestro.c
 - rev 1.93 of dsp.c

Both fix potential NULL pointer dereferencing.

Found with:	Coverity Prevent(tm)
Approved by:	re (kensmith)

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sat Jan 21 11:50:56 2006 UTC (6 years ago) by netchild
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +10 -9 lines
Prevent dereferencing a NULL pointer if the malloc() fails.

CID:		219
Found with:	Coverity Prevent(tm)

Revision 1.28.2.2: download - view: text, markup, annotated - select for diffs
Sat Jan 14 00:35:18 2006 UTC (6 years ago) by ariff
Branches: RELENG_6
Diff to: previous 1.28.2.1: preferred, colored; branchpoint 1.28: preferred, colored
Changes since revision 1.28.2.1: +1 -1 lines
MFC: 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.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Wed Jan 11 23:22:57 2006 UTC (6 years, 1 month ago) by ariff
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +1 -1 lines
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

Revision 1.28.2.1: download - view: text, markup, annotated - select for diffs
Mon Jan 9 02:06:17 2006 UTC (6 years, 1 month ago) by ariff
Branches: RELENG_6
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +9 -6 lines
MFC: Fix locking violation, causing frantic diagnostic messages during boot.

Reported by:	[1] julian

[1] http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-January/003408.html

Revision 1.29: download - view: text, markup, annotated - select for diffs
Fri Jan 6 10:36:55 2006 UTC (6 years, 1 month ago) by ariff
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +9 -6 lines
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

Revision 1.28: download - view: text, markup, annotated - select for diffs
Tue Mar 1 08:58:05 2005 UTC (6 years, 11 months ago) by imp
Branches: MAIN
CVS tags: RELENG_6_BP, RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Branch point for: RELENG_6
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +1 -1 lines
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.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Tue Feb 1 07:43:34 2005 UTC (7 years ago) by imp
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +4 -4 lines
BUS_SPACE_UNRESTRICTED shouldn't be used with the bus_alloc_resource
interface.  Instead, move to the convenience _any interface.

Revision 1.23.2.2: download - view: text, markup, annotated - select for diffs
Sun Jan 30 01:00:04 2005 UTC (7 years ago) by imp
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5, RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.23.2.1: preferred, colored; branchpoint 1.23: preferred, colored; next MAIN 1.24: preferred, colored
Changes since revision 1.23.2.1: +1 -1 lines
MFC: /*- and my license changes for sys/[a-d]*

Revision 1.26: download - view: text, markup, annotated - select for diffs
Thu Nov 11 13:01:13 2004 UTC (7 years, 3 months ago) by ru
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +2 -2 lines
Fix build.

Submitted by:	Taku YAMAMOTO

Revision 1.25: download - view: text, markup, annotated - select for diffs
Wed Nov 10 04:29:09 2004 UTC (7 years, 3 months ago) by julian
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +1357 -475 lines
Add  record capability.

Submitted by:	Taku Yamamoto  (original author)

Revision 1.23.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 29 20:50:32 2004 UTC (7 years, 5 months ago) by green
Branches: RELENG_5
CVS tags: RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +15 -21 lines
MFC r1.24: fix totally broken memory allocation exposed by new contigmalloc.

Approved by:	re

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sun Aug 22 18:57:40 2004 UTC (7 years, 5 months ago) by green
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +15 -21 lines
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>

Revision 1.23: download - view: text, markup, annotated - select for diffs
Fri Jul 16 03:59:27 2004 UTC (7 years, 6 months ago) by tanimura
Branches: MAIN
CVS tags: RELENG_5_BP
Branch point for: RELENG_5
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +1 -1 lines
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

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sat Mar 6 15:52:42 2004 UTC (7 years, 11 months ago) by matk
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +2 -2 lines
Augment /dev/sndstat with the module names, if applicable.

Approved by:	  tanimura (mentor)

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sun Sep 7 16:28:03 2003 UTC (8 years, 5 months ago) by cg
Branches: MAIN
CVS tags: RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +1 -1 lines
update my email address.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Tue Sep 2 17:30:37 2003 UTC (8 years, 5 months ago) by jhb
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +1 -1 lines
Use PCIR_BAR(x) instead of PCIR_MAPS.

Glanced over by:	imp, gibbs
Tested by:		i386 LINT

Revision 1.19: download - view: text, markup, annotated - select for diffs
Fri Aug 22 07:04:10 2003 UTC (8 years, 5 months ago) by imp
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +3 -3 lines
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.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Tue Jul 1 15:52:01 2003 UTC (8 years, 7 months ago) by scottl
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +2 -1 lines
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

Revision 1.17: download - view: text, markup, annotated - select for diffs
Tue Nov 26 18:16:26 2002 UTC (9 years, 2 months ago) by cg
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1, RELENG_5_0_BP, RELENG_5_0_0_RELEASE, RELENG_5_0
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +1 -1 lines
(hopefully) fix build breakage some people are seeing

Approved by:	re

Revision 1.2.2.5: download - view: text, markup, annotated - select for diffs
Mon Apr 22 15:49:32 2002 UTC (9 years, 9 months ago) by cg
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9, RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8, RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7, RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_6, RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11, RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10
Diff to: previous 1.2.2.4: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.2.4: +21 -16 lines
mfc current pcm state.

this fixes various bugs, improves sndstat output, increases error checking,
allows tuning of hardware buffer sizes for most drivers, enables recording
of formats not native to the hardware, and lots of other things

Revision 1.16: download - view: text, markup, annotated - select for diffs
Tue Apr 16 01:58:13 2002 UTC (9 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +2 -1 lines
Cast another bus_addr_t to long long for a printf to quiet a warning on
alpha.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Mon Apr 15 19:16:37 2002 UTC (9 years, 9 months ago) by jhb
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +5 -5 lines
Use bus_addr_t instead of u_int for local variables that are derived from
the per-channel bus_addr_t offset.  Also, cast the offset to (long long)
and use %#llx instead of %#x to fix printf warnings on architectures where
sizeof(bus_addr_t) != sizeof(int).

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Jan 27 23:09:41 2002 UTC (10 years ago) by scottl
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +2 -2 lines
Recent changes to newpcm require that the CHANNEL_SETFORMAT op return 0
for success, non-zero otherwise.  The maestro and maestro3 drivers were
returning the format code, which was being interpreted as a failure code.
Fixed.  No one seems to have noticed that the maestro driver was broken,
but I'll fix it anyways.

MFC after:	2 weeks

Revision 1.13: download - view: text, markup, annotated - select for diffs
Mon Oct 8 05:57:56 2001 UTC (10 years, 4 months ago) by cg
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +11 -8 lines
use pcm_getbuffersize()

Revision 1.12: download - view: text, markup, annotated - select for diffs
Thu Aug 23 11:30:51 2001 UTC (10 years, 5 months ago) by cg
Branches: MAIN
CVS tags: KSE_PRE_MILESTONE_2, KSE_MILESTONE_2
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +3 -2 lines
many changes:

* add new channels to the end of the list so channels used in order of
addition

* de-globalise definition of struct snddev_info and provide accessor
functions where necessary.

* move the $FreeBSD$ tag in each .c file into a macro and allow the
/dev/sndstat handler to display these when set to maximum verbosity to aid
debugging.

* allow each device to register its own sndstat handler to reduce the amount
of groping sndstat must do in foreign structs.

Revision 1.2.2.4: download - view: text, markup, annotated - select for diffs
Wed Aug 1 03:40:58 2001 UTC (10 years, 6 months ago) by cg
Branches: RELENG_4
CVS tags: RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_5, RELENG_4_4_BP, RELENG_4_4_0_RELEASE, RELENG_4_4
Diff to: previous 1.2.2.3: preferred, colored
Changes since revision 1.2.2.3: +11 -14 lines
mfc of newpcm state as at june 24.

* untypedef various structs
* rate conversion feeder
* vchan support - no automatic creation however
* many bugfixes

Revision 1.2.2.3: download - view: text, markup, annotated - select for diffs
Fri Jun 29 15:45:34 2001 UTC (10 years, 7 months ago) by greid
Branches: RELENG_4
Diff to: previous 1.2.2.2: preferred, colored
Changes since revision 1.2.2.2: +2 -3 lines
MFC: Use M_ZERO flag to malloc(9)

Revision 1.11: download - view: text, markup, annotated - select for diffs
Thu Jun 21 19:45:59 2001 UTC (10 years, 7 months ago) by greid
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +2 -3 lines
Use the M_ZERO flag to malloc(9)

Reviewed by:	cg
MFC after:	1 week

Revision 1.10: download - view: text, markup, annotated - select for diffs
Sat Jun 16 21:25:08 2001 UTC (10 years, 7 months ago) by cg
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +1 -3 lines
use a global devclass for all drivers - i'm not entirely sure why this
worked before.

mixer, dsp and sndstat are seperate devices - give them their own cdevsws
instead of demuxing requests sent to a single cdevsw.

use the si_drv1/si_drv2 fields in dev_t structures for holding information
specific to an open instance of mixer/dsp.

nuke /dev/{dsp,dspW,audio}[0-9]* links - this functionality is now provided
using cloning.

various locking fixes.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sat Mar 24 23:10:28 2001 UTC (10 years, 10 months ago) by cg
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +11 -12 lines
mega-commit.

this introduces a new buffering mechanism which results in dramatic
simplification of the channel manager.

as several structures have changed, we take the opportunity to move their
definitions into the source files where they are used, make them private and
de-typedef them.

the sound drivers are updated to use snd_setup_intr instead of
bus_setup_intr, and to comply with the de-typedefed structures.

the ac97, mixer and channel layers have been updated with finegrained
locking, as have some drivers- not all though.  the rest will follow soon.

Revision 1.2.2.2: download - view: text, markup, annotated - select for diffs
Sat Feb 3 01:29:10 2001 UTC (11 years ago) by cg
Branches: RELENG_4
CVS tags: RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_3
Diff to: previous 1.2.2.1: preferred, colored
Changes since revision 1.2.2.1: +93 -88 lines
MFC of many improvements, including kobjification, new sb8/sb16 code,
setblocksize support for lower latencies.  this is the sound code from
-current as of 01:00GMT 2001/02/03.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Thu Jan 11 23:26:38 2001 UTC (11 years, 1 month ago) by jhb
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +5 -5 lines
Catch up to the name changes in the hwvol API.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Fri Jan 5 07:07:48 2001 UTC (11 years, 1 month ago) by jhb
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -1 lines
Call mixer_hwinit() when attaching.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Wed Jan 3 01:32:57 2001 UTC (11 years, 1 month ago) by jhb
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +25 -20 lines
- When acknowledging interrupts, write the value 0xff to the interrupt
  status register rather than 0.  Without this, a single hardware volume
  event triggers an interrupt storm.
- Implement hardware volume control for the Maestro chips.  This version
  only handles the case where both channels are adjusted at the same time.

Reviewed by:	cg

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sat Dec 23 03:16:12 2000 UTC (11 years, 1 month ago) by cg
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +14 -9 lines
update code dealing with snd_dbuf objects to do so using a functional interface

modify chn_setblocksize() to pick a default soft-blocksize appropriate to the
sample rate and format in use.  it will aim for a power of two size small
enough to generate block sizes of at most 20ms.  it will also set the
hard-blocksize taking into account rate/format conversions in use.

update drivers to implement setblocksize  correctly:
updated, tested: 	sb16, emu10k1, maestro, solo
updated, untested: 	ad1816, ess, mss, sb8, csa
not updated: 		ds1, es137x, fm801, neomagic, t4dwave, via82c686

i lack hardware to test: ad1816, csa, fm801, neomagic
others will be updated/tested in the next few days.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Dec 18 01:36:35 2000 UTC (11 years, 1 month ago) by cg
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +55 -61 lines
kobjify.

this gives us several benefits, including:

* easier extensibility- new optional methods can be added to
  ac97/mixer/channel classes without having to fixup every driver.

* forward compatibility for drivers, provided no new mandatory methods are
  added.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Tue Nov 21 12:22:11 2000 UTC (11 years, 2 months ago) by julian
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +2 -2 lines
Bump the buffersize from 0x1000 to 0x4000.
0x1000 gets underflows on my dell 7500 whenever I moved the mouse.
(reported as "hwptr went backwards...", with jumpy sound)
Sounds great now....

Revision 1.2.2.1: download - view: text, markup, annotated - select for diffs
Thu Oct 5 05:30:46 2000 UTC (11 years, 4 months ago) by cg
Branches: RELENG_4
CVS tags: RELENG_4_2_0_RELEASE
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +1 -1 lines
MFC: ess mastro-2e driver

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sat Sep 9 19:21:03 2000 UTC (11 years, 5 months ago) by cg
Branches: MAIN
Branch point for: RELENG_4
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +3 -3 lines
detach support
remove un-needed setdir functions
add bus_teardown_intr calls where necessary
destroy our dma tags where necessary
destroy ac97 before releasing resources

Revision 1.1: download - view: text, markup, annotated - select for diffs
Wed Sep 6 20:10:54 2000 UTC (11 years, 5 months ago) by cg
Branches: MAIN
CVS tags: PRE_SMPNG
ess maestro driver - not enabled by default

Submitted by:   Taku YAMAMOTO <taku@cent.saitama-u.ac.jp>

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options