<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test2/sys/dev/sound/pcm/buffer.c, branch release/9.0.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test2/atom?h=release%2F9.0.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test2/atom?h=release%2F9.0.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/'/>
<updated>2011-03-11T22:42:04Z</updated>
<entry>
<title>Allocate the sound buffer DMA memory coherent. While NetBSD typically</title>
<updated>2011-03-11T22:42:04Z</updated>
<author>
<name>Marius Strobl</name>
<email>marius@FreeBSD.org</email>
</author>
<published>2011-03-11T22:42:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=496a7fcaae95bf960be5310fd37e56bf9ca2550c'/>
<id>urn:sha1:496a7fcaae95bf960be5310fd37e56bf9ca2550c</id>
<content type='text'>
also does this for sound drivers it's probably not necessary for all
combinations of controllers and drivers. However, given that our sound
drivers completely lack bus_dmamap_sync(9) calls this at least serves
as a workaround when enabling use of the IOMMU streaming buffers on
sparc64 and generally for arm and mips.

MFC after:	2 weeks
</content>
</entry>
<entry>
<title>Fix up a few more sysctl(9) mis-typing found in various LINT builds.</title>
<updated>2011-01-13T18:20:27Z</updated>
<author>
<name>Matthew D Fleming</name>
<email>mdf@FreeBSD.org</email>
</author>
<published>2011-01-13T18:20:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=240577c2a7442ca79256cdf359bbcea39d2ee216'/>
<id>urn:sha1:240577c2a7442ca79256cdf359bbcea39d2ee216</id>
<content type='text'>
</content>
</entry>
<entry>
<title>- Remove more dead code[1].  Since r207330, we only need to check division</title>
<updated>2010-05-04T16:56:59Z</updated>
<author>
<name>Jung-uk Kim</name>
<email>jkim@FreeBSD.org</email>
</author>
<published>2010-05-04T16:56:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=c909aebcbb2125164da7ec014ca9ec245074486f'/>
<id>urn:sha1:c909aebcbb2125164da7ec014ca9ec245074486f</id>
<content type='text'>
by zero of the second argument 'from'.
- Prefer u_int32_t over unsigned int to make its intention more clearer.
- Move the function to a header file and make it a static inline function.

Pointed out by:	Andrew Reilly (areilly at bigpond dot net dot au)[1]
MFC after:	3 days
</content>
</entry>
<entry>
<title>Remove dead code.  Calculated greatest common divisor was not used at all.</title>
<updated>2010-04-28T17:26:05Z</updated>
<author>
<name>Jung-uk Kim</name>
<email>jkim@FreeBSD.org</email>
</author>
<published>2010-04-28T17:26:05Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=8c975e70afa1d9d6224d2204cc0ea0ca309022e5'/>
<id>urn:sha1:8c975e70afa1d9d6224d2204cc0ea0ca309022e5</id>
<content type='text'>
On top of that, LLVM+Clang mis-compiles this code because of its register
allocator bug.

Analyzed by:	Andrew Reilly (areilly at bigpond dot net dot au)
Reviewed by:	ariff, rdivacky
MFC after:	3 days
</content>
</entry>
<entry>
<title>Sound Mega-commit. Expect further cleanup until code freeze.</title>
<updated>2009-06-07T19:12:08Z</updated>
<author>
<name>Ariff Abdullah</name>
<email>ariff@FreeBSD.org</email>
</author>
<published>2009-06-07T19:12:08Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=90da2b2859b259fca1ab223931f549a72e21a3a5'/>
<id>urn:sha1:90da2b2859b259fca1ab223931f549a72e21a3a5</id>
<content type='text'>
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 &lt;avg@freebsd.org&gt;
    * 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 &lt;olivier at gid0 d org&gt;, too many
          	unsung / unnamed heroes.
</content>
</entry>
<entry>
<title>Last (again ?!?) major commit for RELENG_7, featuring total Giant</title>
<updated>2007-06-16T03:37:28Z</updated>
<author>
<name>Ariff Abdullah</name>
<email>ariff@FreeBSD.org</email>
</author>
<published>2007-06-16T03:37:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=e4e61333ffa4e90360de2dd1e4e0146f7cbf0afb'/>
<id>urn:sha1:e4e61333ffa4e90360de2dd1e4e0146f7cbf0afb</id>
<content type='text'>
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...
</content>
</entry>
<entry>
<title>Buffer optimization and locking cleanup. Don't resize/malloc</title>
<updated>2007-06-14T11:15:51Z</updated>
<author>
<name>Ariff Abdullah</name>
<email>ariff@FreeBSD.org</email>
</author>
<published>2007-06-14T11:15:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=504e00af6baedb9f73a3c67ca6dd5151ed93af9f'/>
<id>urn:sha1:504e00af6baedb9f73a3c67ca6dd5151ed93af9f</id>
<content type='text'>
unless it is really necessary to ease down unlock/lock sequence.
</content>
</entry>
<entry>
<title>Last major commit and updates for RELENG_7:</title>
<updated>2007-05-31T18:43:33Z</updated>
<author>
<name>Ariff Abdullah</name>
<email>ariff@FreeBSD.org</email>
</author>
<published>2007-05-31T18:43:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=bba4862c6482ae036365342c54e10864922f4c74'/>
<id>urn:sha1:bba4862c6482ae036365342c54e10864922f4c74</id>
<content type='text'>
- Rework the entire pcm_channel structure:
  * Remove rarely used link placeholder, instead, make each pcm_channel
    as head/link of each own/each other. Unlock - Lock sequence due to
    sleep malloc has been reduced.
  * Implement "busy" queue which will contain list of busy/active
    channels. This greatly reduce locking contention for example while
    servicing interrupt for hardware with many channels or when virtual
    channels reach its 256 peak channels.

- So I heard you like v chan ... O RLY?
  Welcome to Virtual **Record** Channels (vrec, rec vchans, vchans for
  recording, Rec-Chan, you decide), the ultimate solutions for your
  nagging O_RDWR full-duplex wannabe (note: flash plugins) monopolizing
  single record channel causing EBUSY.  Vrec works exactly like Vchans
  (or, should I rename it to "Vplay" :) , except that it operates on the
  opposite direction (recording). Up to 256 vrecs (like vchans) are
  possible.

  Notes:
   * Relocate dev.pcm.%d.{vchans,vchanformat,vchanrate} to each of its
     respective node/direction:
       dev.pcm.%d.play.* for "play"   (cdev = dsp%d.vp%d)
       dev.pcm.%d.rec.*  for "record" (cdev = dsp%d.vr%d)
   * Don't expect that it will magically give you ability to split
     "recording source" (eg: 1 channel for cdrom, 1 channel for mic,
     etc). Just admit that you only have a *single* recording source /
     channel. Please bug your hardware vendor instead :)

- Bump maxautovchans from 4 to 16. For a full-fledged multimedia
  desktop/workstation with too many soundservers installed (esound,
  artsd, jackd, pulse/polypaudio, ding-dong pling plong mudkip fuh fuh,
  etc), 4 seems inadequate. There will be no memory penalty here, since
  virtual channels are allocate only by demand.

- Nuke/Rework the entire statically created cdev entries. Everything is
  clonable through snd own clone manager which designed to withstand many
  kind of abusive devfs droids such as:
      * while : ; do /bin/test -e /dev/dsp ; done
      * jot 16777216 0 | while read x ; do ls /dev/dsp0.$x ; done
      * hundreds (could be thousands) concurrent threads/process opening
	"/dev/dsp" (previously, this might result EBUSY even with just
	3 contesting threads/procs).
  o Reusable clone objects (instead of creating new one like there's no
    tomorrow) after certain expiration deadline. The clone allocator will
    decide whether to reuse, share, or creating new clone.
  o Automatic garbage collector.

- Dynamic unit magic allocator. Maximum attached soundcards can be tuned
  using tunable "hw.snd.maxunit" (Default to 512). Minimum is 16, and
  maximum is 2048.

- ..other fixes, mostly related to concurrency issues.

joel@ will do the manpage updates on sound(4).

Have fun.
</content>
</entry>
<entry>
<title>sndbuf_alloc() now accept dmaflags argument which will be forwarded to</title>
<updated>2007-04-18T18:26:41Z</updated>
<author>
<name>Ariff Abdullah</name>
<email>ariff@FreeBSD.org</email>
</author>
<published>2007-04-18T18:26:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=2e334adf6a1959f29ad75e3c0933d72d892ac5d1'/>
<id>urn:sha1:2e334adf6a1959f29ad75e3c0933d72d892ac5d1</id>
<content type='text'>
internal bus_dmammem_alloc() for greater flexibility on setting up DMA /
page attributes.
</content>
</entry>
<entry>
<title>Memory leak killing spree, mostly bus_dma(9) related.</title>
<updated>2007-03-21T18:17:03Z</updated>
<author>
<name>Ariff Abdullah</name>
<email>ariff@FreeBSD.org</email>
</author>
<published>2007-03-21T18:17:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=703c934a48e8465f0027506356f83b05f291d731'/>
<id>urn:sha1:703c934a48e8465f0027506356f83b05f291d731</id>
<content type='text'>
</content>
</entry>
</feed>
