Revision tags: release/7.0.0_cvs, release/7.0.0, release/6.3.0_cvs, release/6.3.0 |
|
#
a5b0e312 |
| 04-Jul-2007 |
Ariff Abdullah <ariff@FreeBSD.org> |
Be much more forgiving towards applications that requesting ioctls that should be a no-op (for example, requesting SYNC on record path). The standards does not indicate that such requests are illegal
Be much more forgiving towards applications that requesting ioctls that should be a no-op (for example, requesting SYNC on record path). The standards does not indicate that such requests are illegal, so just return it as success instead of EINVAL.
Approved by: re (mux)
show more ...
|
#
e4e61333 |
| 16-Jun-2007 |
Ariff Abdullah <ariff@FreeBSD.org> |
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 condva
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...
show more ...
|
#
adb0d36d |
| 10-Jun-2007 |
Matt Jacob <mjacob@FreeBSD.org> |
Cast len to be a uintmax_t and make format in KASSERT match so as to avoid different sizes on different platforms types of complaints.
Reviewed by: Ariff
|
#
9c271f79 |
| 03-Jun-2007 |
Ariff Abdullah <ariff@FreeBSD.org> |
Insert NULL pointer checking around devclass_get_maxunit(pcm_devclass, ..) . Things can get ugly without it due to uninitialized class. RELENG_6 need a simmilar, but different treatment as well.
err
Insert NULL pointer checking around devclass_get_maxunit(pcm_devclass, ..) . Things can get ugly without it due to uninitialized class. RELENG_6 need a simmilar, but different treatment as well.
err.. perhaps we should teach devclass_get_maxunit() to return -1 ?
MFC after: 1 day
show more ...
|
#
bba4862c |
| 31-May-2007 |
Ariff Abdullah <ariff@FreeBSD.org> |
Last major commit and updates for RELENG_7:
- Rework the entire pcm_channel structure: * Remove rarely used link placeholder, instead, make each pcm_channel as head/link of each own/each other
Last major commit and updates for RELENG_7:
- 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.
show more ...
|
#
7d9022b4 |
| 16-Mar-2007 |
Ariff Abdullah <ariff@FreeBSD.org> |
[stage: 7/9]
EWOULDBLOCK -> EAGAIN.
|
Revision tags: release/6.2.0_cvs, release/6.2.0 |
|
#
b45d0ec8 |
| 07-Dec-2006 |
Ariff Abdullah <ariff@FreeBSD.org> |
Remove comment that is no longer relevant since previous buffering fix.
|
#
a580b31a |
| 26-Nov-2006 |
Ariff Abdullah <ariff@FreeBSD.org> |
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
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.
show more ...
|
#
394ebd35 |
| 28-Oct-2006 |
Alexander Leidinger <netchild@FreeBSD.org> |
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 w
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
show more ...
|
#
0f85b689 |
| 08-Oct-2006 |
Alexander Leidinger <netchild@FreeBSD.org> |
Remove unnecessary test case. (As written, that branch will never be followed.)
Submitted by: ryanb Found with: Coverity Prevent CID: 239860
|
#
f77472e6 |
| 29-Sep-2006 |
Ruslan Ermilov <ru@FreeBSD.org> |
The SNDCTL_DSP_NONBLOCK ioctl doesn't take an argument, from what I can tell by browsing the Internet (Linux, OSS, etc.).
|
#
b611c801 |
| 23-Sep-2006 |
Alexander Leidinger <netchild@FreeBSD.org> |
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 th
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.
show more ...
|
Revision tags: release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0 |
|
#
844f9220 |
| 30-Mar-2006 |
Ariff Abdullah <ariff@FreeBSD.org> |
Remove paranoid thread hijacking check. It cause wierd behaviour (dangling channel - process association) especially in threaded or fork()ed apps.
|
#
3fdb3676 |
| 21-Mar-2006 |
Ariff Abdullah <ariff@FreeBSD.org> |
Apply more thorough fixes while dealing with device opening and closing:
- Determine open direction using 'flags', not 'mode'. This bug exist since past 4 years. - Don't allow opening the same dev
Apply more thorough fixes while dealing with device opening and closing:
- Determine open direction using 'flags', not 'mode'. This bug exist since past 4 years. - Don't allow opening the same device twice, be it in a same or different direction. - O_RDWR is allowed, provided that it is done by a single open (for example by mixer(8)) and the underlying hardware support true full-duplex operation. - Do various paranoid checking in case other process/thread trying to hijack the same device twice (or more).
MFC after: 5 days
show more ...
|
#
c8c4c87d |
| 29-Jan-2006 |
Alexander Leidinger <netchild@FreeBSD.org> |
Fix some potential NULL pointer dereferences.
This is supposed to fix some Coverity Prevent errors (Ariff didn't looked at the CID's (ENOTIME), I just told him that there are some problems in functi
Fix some potential NULL pointer dereferences.
This is supposed to fix some Coverity Prevent errors (Ariff didn't looked at the CID's (ENOTIME), I just told him that there are some problems in function dsp_ioctl()).
CID: 215-218 Found with: Coverity Prevent(tm) Submitted by: ariff MFC after: 5 days
show more ...
|
#
da8623ec |
| 25-Jan-2006 |
Joel Dahl <joel@FreeBSD.org> |
Fix typos and clean up some comments.
Approved by: ariff
|
#
2fd8d3d8 |
| 16-Jan-2006 |
Ariff Abdullah <ariff@FreeBSD.org> |
Restore old compatibility of feeding directly into /dev/dsp at 8000 hz while preserving the New World Order.
Discussed with: [1] Michael W. Oliver <michael at gargantuan.com> MFC after: 1 week
[1]
Restore old compatibility of feeding directly into /dev/dsp at 8000 hz while preserving the New World Order.
Discussed with: [1] Michael W. Oliver <michael at gargantuan.com> MFC after: 1 week
[1] http://lists.freebsd.org/pipermail/freebsd-multimedia/2006-January/003562.html
show more ...
|
#
c3ebbcbd |
| 31-Dec-2005 |
Ariff Abdullah <ariff@FreeBSD.org> |
Fix LOR #174.
Tested with: WITNESS, INVARIANTS and DIAGNOSTICS
|
#
f935ac60 |
| 30-Dec-2005 |
Ariff Abdullah <ariff@FreeBSD.org> |
Disable frantic DMA update within few SNDCTL_DSP_* ioctl. This should reduce huge playback / recording latency for applications that try to act smarter and manage their own buffering (XMMS, Skype, et
Disable frantic DMA update within few SNDCTL_DSP_* ioctl. This should reduce huge playback / recording latency for applications that try to act smarter and manage their own buffering (XMMS, Skype, etc.).
Note to Skype + via8xxx users: Remove previous hackish "hint.pcm.<unit>.via_dxs_disabled" from kernel hint and see whether this changes cure all those annoying sound issues.
show more ...
|
#
ee43f8a6 |
| 14-Nov-2005 |
Ariff Abdullah <ariff@FreeBSD.org> |
From luigi: In SNDCTL_DSP_SETFRAGMENT, if you specify both read and write channels, the existing code first acts on the read channel, but as a side effect it updates the arguments (maxfrags, frag
From luigi: In SNDCTL_DSP_SETFRAGMENT, if you specify both read and write channels, the existing code first acts on the read channel, but as a side effect it updates the arguments (maxfrags, fragsz) passed by the caller according to acceptable values for the read channel, and then uses the modified values to act on the write channel. The problem with this approach is that, given a (maxfrags, fragsz) user-specified value, the actual values computed by the read and write channels may differ: e.g. the read channel might want to allocate more fragments than what the user specified because it has no side-effects on the delay and it helps in case of slow readers, whereas the write channel needs to use as few fragments as possible to keep the audio latency low (very important with telephony apps).
This patch stores the values computed by the read channel into temproary variables so the write channel will use the actual arguments of the ioctl.
This patch is very helpful with telephony apps such as asterisk.
Submitted by: luigi Approved by: netchild (mentor)
show more ...
|
#
8be20fbe |
| 03-Nov-2005 |
Ariff Abdullah <ariff@FreeBSD.org> |
Appropriate NULL pointer checking to avoid mysterious panic during device cloning.
Approved by: netchild (mentor)
|
Revision tags: release/6.0.0_cvs, release/6.0.0 |
|
#
85cc3851 |
| 30-Oct-2005 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
Add some safeguards to AIOSFMT:
- Return EINVAL if play_format or rec_format is set but the corresponding sample rate is 0.
- Don't try to set the playback or recording format to 0. Previousl
Add some safeguards to AIOSFMT:
- Return EINVAL if play_format or rec_format is set but the corresponding sample rate is 0.
- Don't try to set the playback or recording format to 0. Previously, issuing an AIOSFMT ioctl with an all-zeroes snd_chan_param would trigger a KASSERT in chn_fmtchain(); I'm unsure about the effects on a kernel without INVARIANTS. After this commit, issuing AIOSFMT with an all-zeroes snd_chan_param is equivalent to issuing AIOGFMT.
MFC after: 2 weeks
show more ...
|
#
62340837 |
| 02-Oct-2005 |
Alexander Leidinger <netchild@FreeBSD.org> |
General spl* cleanup. It doesn't serve any purpose anymore.
Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
|
#
831a62e7 |
| 12-Sep-2005 |
Alexander Leidinger <netchild@FreeBSD.org> |
- Fix the locking in dsp.c to prevent a LOR (AFAIK not on the LOR page).
- Remove an assertion in sound.c, it's not needed (and causes a panic now). From the conversation via mail between glebius
- Fix the locking in dsp.c to prevent a LOR (AFAIK not on the LOR page).
- Remove an assertion in sound.c, it's not needed (and causes a panic now). From the conversation via mail between glebius and Ariff: ---snip--- > Well, but which mutex protects now? Do we own anything else > in pcm_chnalloc()? I see some queue(4) macros in pcm_chnalloc(), > they should be protected, shouldn't they? Queue insertion/removal occur during 1) driver loading (which is pretty much single thread / sequential) or unloading (mutex protected, bail out if there is any channel with refcount > 0 or busy). 2) vchan_create()/destroy(), (which is *sigh* quite complicated), but somehow protected by 'master'/parent channel mutex. Other thread cannot add/remove vchan (or even continue traversing that queue) unless it can acquire parent channel mutex. ---snip---
Fix the locking in dsp.c to prevent a LOR (AFAIK not on the LOR page).
Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my> Tested with: INVARIANTS[1] and DIAGNOSTICS[2] Tested by: netchild [1,2], David Reid <david@jetnet.co.uk> [1]
show more ...
|
#
a423446c |
| 10-Sep-2005 |
Alexander Leidinger <netchild@FreeBSD.org> |
Release lock for a while during chn_reset() / pcm_chnalloc() operation while malloc()ing, this fixes LOR 129.
See - http://lists.freebsd.org/pipermail/freebsd-current/2005-June/051157.html - http:
Release lock for a while during chn_reset() / pcm_chnalloc() operation while malloc()ing, this fixes LOR 129.
See - http://lists.freebsd.org/pipermail/freebsd-current/2005-June/051157.html - http://lists.freebsd.org/pipermail/freebsd-current/2005-August/054620.html - http://sources.zabbadoz.net/freebsd/lor.html#129
Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
show more ...
|