Commit Graph

74 Commits

Author SHA1 Message Date
isaki 8b1980912d Fix minor bugs of SNDCTL_DSP_GETISPACE.
- hiwat is playback-only parameter.
- 'bytes' should not be rounded down.
2019-02-02 04:52:16 +00:00
isaki 6b4163e9ca Revert a wrong SNDCTL_DSP_GETOSPACE part of rev1.33.
- 'fragments' is the number of full free blocks and should not be
  negative value.
- 'bytes' should not be rounded down.
It makes mpv work correctly (fixes a second half of kern/53028).
Reviewed by mlelstv@
2019-01-29 11:54:02 +00:00
mrg bfe7e5d8b3 memset to zero the entire array, not just 8 bytes of it.
picked up by gcc7's checker that the array size has not
been multipled by the member size.

here, we had 8 but should have had 8 * sizeof(int).

XXX: real bug - pullup-7, pullup-8
2019-01-23 00:08:06 +00:00
nat e5d1b604d5 ABI of libossaudio did not change, so there was no need to bump the version
number.

Pointed out by mrg@
2017-03-24 11:46:52 +00:00
nat dab5456581 Calculate GETISPACE/GETOSPACE properly.
Bump version.

Addresses PR kern/51999.
2017-03-23 15:50:48 +00:00
maya 39d6057df2 speed limit is 80 (missed this one) 2017-02-10 08:52:04 +00:00
maya 6ac4e27787 strncpy->strlcpy. use sizeof instead of numbers. 2017-02-10 08:50:27 +00:00
nat 141dc004bd Add missing defines for 16, 24 and 32 bit NE and OE formats.
Add the ability to set 24 and 32 bit precision.

This commit was approved by wiz@
2014-09-09 10:45:18 +00:00
nat dc2ecd830b libossaudio minor version bump to signify new ioctls. 2014-05-18 10:36:34 +00:00
nat a8ba8ad76b Adds ioctls and defines for OSSv4 compatibility.
The ioctl definitions and accompanying structures were
taken from FreeBSD's soundcard.h, hopefully providing
some binary compatibility.

The ioctls are as follows:
	SNDCTL_SYSINFO: Returns a structure containing
		details about the audio device.
	SNDCTL_ENGINEINFO - SNDCTL_AUDIOINFO: Returns a
		structure with playback/recording
		characteristics.
	SNDCTL_DSP_GETPLAYVOL, SNDCTL_DSP_SETPLAYVOL,
	SNDCTL_DSP_GETRECVOL, SNDCTL_DSP_SETRECVOL:
		Retrieves/Sets Playback/Recording volume.
	SNDCTL_DSP_SKIP - SNDCTL_DSP_SILENCE: These ioctls
		were intended to manipulate the underlying
		audio buffer skip or insert silence.  These
		return EINVAL.

SOUND_VERSION is unchanged, but is definable,  It will be
changed when the mixer OSSv4 ioctls are written.

Addresses PR 46611
This commit was approved by wiz@.
2014-05-17 12:38:42 +00:00
christos a4deae0de5 fix typo, WARNS=5 2012-05-05 15:57:45 +00:00
christos 2cb8b46c96 avoid using cpp variadic macros and explain why. 2012-05-05 15:04:57 +00:00
christos 73e25da1dd - match regular ioctl prototype (3rd argument is optional)
- fix lint issues
2012-05-04 11:48:12 +00:00
matt 572e1c8587 These directories don't handle WARNS=5 2012-03-21 10:08:30 +00:00
christos 76389f09e9 fix non-portable shift. 2011-09-13 19:10:18 +00:00
jmcneill 5fc89c79bc Add support for AFMT_AC3 2011-09-06 01:19:34 +00:00
wiz 5c82067abe Remove USETBL, now that man page does not need tbl any longer. 2009-03-12 13:52:47 +00:00
joerg 8c2253d6e8 Use .Bl -column instead of tbl(1) for the device mapping list.
OK jmcneill@
2009-03-12 12:33:46 +00:00
jmcneill 1c31e53c25 Bump date for previous. 2009-02-03 12:48:00 +00:00
jmcneill 5cc75830ea Add a table that describes the mappings from native audio mixer names
to their OSS equivalents.
2009-02-03 12:46:13 +00:00
christos 46edb91e9f bump shared libraries. 2009-01-11 03:07:47 +00:00
martin 11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
bjs 22c6c5ebca s/prototyoe/prototype/ 2008-03-15 20:18:20 +00:00
drochner 754fc2622c Set the number of record and play channels individually -- currently
we try to set both in one ioctl, to the same value, which fails if not
both record and play direction support that many channels. (Having
more play than record channels is common these days.)
This does likely address part of the problem described in PR pkg/35444
by Mihai Chelaru, and it helped Matthew R. Green about half a year
ago -- see the thread in tech-misc in April.
2007-11-08 20:27:25 +00:00
mlelstv 6abb2a41f4 Implement OSS_SNDCTL_DSP_GETODELAY and provide a no-op function
for OSS_SNDCTL_DSP_PROFILE.
2007-09-18 22:57:31 +00:00
joerg 5ccf1c578a Add a new ioctl AUDIO_GETBUFINFO. It works like AUDIO_GETINFO, but
doesn't obtain the ports, gain and balance related parameters.
Those generally require reading from the hardware and therefore are much
more expensive to obtain. Modify OSS emulation to use the new ioctl
where possible.

This reduces CPU usage of mplayer during mp3 playback with my Thinkpad
from 20% to < 1% and from 50% to 20% during Xvid playback.

Review and comments from jmcneill@
2007-06-11 13:05:46 +00:00
lukem f9d230b4f6 appease gcc -Wuninitialized. some delint 2005-06-01 11:22:18 +00:00
drochner f2a3f79f1c work around a prototype conflict by including ioctl.h
before we redefile ioctl()
2005-02-09 18:02:53 +00:00
perry 7bcd7064be de-__P 2005-02-04 16:14:21 +00:00
kent b285c03873 getdevinfo():
If a mixer item does not match with AudioNsomething, check whether
it ends with '.' + AudioNsomething.  PR#15441
2004-11-18 14:02:42 +00:00
grant 86f70dccd2 drop whitespace 2003-11-18 22:42:04 +00:00
wiz 472351e13d Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
2003-04-16 13:34:34 +00:00
lukem 8bf240ccae use __RCSID() 2003-03-09 01:03:54 +00:00
jdolecek 98cb17d023 add support for SNDCTL_DSP_SETDUPLEX ioctl to ossaudio emulation code
code provided by Andreas Wrede in PR kern/19793
2003-01-12 08:20:05 +00:00
wiz 57a4de98d0 New sentence, new line. From Robert Elz. 2002-10-01 19:26:58 +00:00
wiz 796338fdc4 Add SOUND_MASK_* for the last SOUND_MIXER_* values that didn't have any. 2002-05-27 14:42:15 +00:00
wiz e63f7d735b Improve markup, sort sections. 2002-02-20 11:38:02 +00:00
ross 814f296b77 Generate <>& symbolically. 2002-02-07 07:00:09 +00:00
kleink 0f83741fa0 Determine the 'native' endianness using _BYTE_ORDER from
<machine/endian_machdep.h>.

The previous method of wrapping a definition of _POSIX_SOURCE around the
inclusion of other headers to reduce namespace pollution had the
side-effect of not all required identifiers being defined when included
thereafter by the application itself (due to multiple-inclusion protection),
and is not blessed by that standard.
2002-01-11 12:11:09 +00:00
mycroft cbfac6596e Make SNDCTL_DSP_POST a nop. It's explicitly *not* supposed to sleep, and as
it's merely advisory (and in fact is implemented as a nop in the OSS->ALSA
shim), it should be safe to ignore it.
2001-12-24 00:10:46 +00:00
kim b399dad6eb Map OSS mixer device "line1" to native mixer device "aux". 2001-07-08 22:30:15 +00:00
jdolecek 16624f841d Use EAGAIN instead of EWOULDBLOCK. The actual numeric value is
same, but EAGAIN is the posixly correct name.
Addresses misc/12960.
2001-05-19 17:23:39 +00:00
augustss 5a71cdbf26 Impproved fix of PR12796, from Frederick Bruckman <fb@enteract.com> 2001-05-10 01:53:48 +00:00
augustss 5c9ba155e3 Apply patch in PR lib/12796 from Frederick Bruckman <fb@enteract.com> 2001-05-09 21:49:58 +00:00
tron 29e1f8bd9f Use accurate rounding in conversion between OSS and NetBSD volume values.
The optimized integer formula was supplied by Wolfgang Solfrank on
"tech-kern@netbsd.org". This fixes problems with e.g  FreeBSD TV (fxtv),
RealPlayer-7.0 Beta 2 (PR pkg/10818) and KDE's "kscd".
2000-08-16 16:14:33 +00:00
msaitoh f6f00e2615 remove extra period in SEE ALL section 2000-07-05 15:45:28 +00:00
augustss 17ac2f03ee Implement OSS_GETVERSION.
Accept mixer values above max (100).
Handle the info from AUDIO_MIXER_DEVINFO properly, parts of it is opaque.
2000-07-04 09:56:14 +00:00
augustss 41a71bdc48 Implement SOUND_MIXER_INFO. 1999-11-16 23:56:41 +00:00
kleink 79ce98b212 Per discussion with Lennart Augustsson, change the behaviour to report emulated
encodings, too.  (This is currently an issue with the eso(4) driver, which,
due to different byte orders in playing and recording directions, sets the
emulated flag for all 16-bit encodings, although it could be argued that this
is an unfortunate weakness of the query_encoding() interface.)
1999-08-22 13:43:09 +00:00