Commit Graph

29 Commits

Author SHA1 Message Date
nat
69ec26e42b Allow reads from pad(4) less or greater than PAD_BLKSIZE.
Ensure that audio data is ready before reading.
Addresses PR 39204.

OK jmcneil@.
2016-02-26 13:17:04 +00:00
nat
79728ed766 Wrap up calls to sc_intr in kpreempt[en/dis]able.
This commit was approved by christos@
2015-07-10 21:58:56 +00:00
jmcneill
dd9a139587 Add common audio converters for software volume control. Only supports
slinear16_le and slinear16_be for now.

Convert pad(4) to use the new converters.
2014-11-18 01:53:17 +00:00
dholland
f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
christos
ad1d4a6684 sprinke __diagused 2013-11-02 00:37:12 +00:00
agc
c980395227 get rid of a variable which is no longer used after the demise of splaudio 2011-11-24 01:54:08 +00:00
jmcneill
aef2dcc2bc splaudio is no more 2011-11-24 01:11:04 +00:00
jmcneill
8a962f23f2 Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

  Add MP locking to the audio drivers.

  Making the audio drivers MP safe is necessary before efforts
  can be made to make the VM system MP safe.

  The are two locks per device instance, an ISR lock and
  a character device lock. The ISR lock replaces calls to
  splaudio()/splx(), and will be held across calls to device
  methods which were called at splaudio() before (e.g.
  trigger_output). The character device lock is held across
  calls to nearly all of the methods, excluding some only
  used for initialization, e.g. get_locks.

Welcome to 5.99.57.
2011-11-23 23:07:28 +00:00
riz
a110815e0b Use le16enc()/be16enc() to encode LE/BE values back into the audio stream.
This fixes the tests/dev/audio test on my macppc box.

While I'm here, use le16dec()/be16dec() directly instead of rewriting them.
2011-02-28 16:56:39 +00:00
jmcneill
3298ac716e - return EIO if audio data is received and /dev/pad isn't open
- give a better description for AUDIO_GETDEV
2010-09-03 19:19:48 +00:00
pooka
021e75bbe7 Don't print spammy message if read is interrupted (ctrl-c)
while waiting for data.
2010-06-28 17:45:08 +00:00
pooka
199d07fe55 fix field initializers 2010-05-01 23:40:21 +00:00
ahoka
bc0cafe08f Add support to be built as a kernel module. 2010-04-09 13:39:17 +00:00
dyoung
c217bc3b1d If the device does not exist, return ENXIO, as is customary, instead of
ENODEV.  Ok jmcneill@.
2010-01-18 23:57:14 +00:00
jmcneill
e875bf360e PR# kern/39899: audio attach with pad(4) segfaults
Make sure pad pulls in auconv mulaw support.
2009-09-08 09:47:42 +00:00
jmcneill
839e47bbd7 Catch up to audio(4) device_t/softc split. 2009-09-07 18:23:06 +00:00
ad
0fa70e9b6f 'boot -z' bogons 2009-03-14 11:08:28 +00:00
christos
51a52339c8 fix device is not split warning 2008-09-04 10:42:55 +00:00
drochner
4e69f53b47 remove a KASSERT which is wrong since audio(4)'s device/softc were split 2008-08-06 16:31:15 +00:00
drochner
1f0a423884 use new "defpseudodev" where appropriate, and remove dummy interface
attribute definitions which were only to trick config(8)
2008-06-10 12:49:16 +00:00
tsutsui
c9a8620b99 Replace homegrown pad_find_softc() with device_lookup_private(). 2008-06-08 18:14:31 +00:00
mlelstv
208ba41bb4 mutex.h is implied by condvar.h
param.h is required for xen
2008-06-06 20:51:51 +00:00
jmcneill
e1557cc154 Use 2-clause license. 2008-05-09 03:44:51 +00:00
cube
492d8b0d9e Split device_t and softc for audio(4), and other related cosmetic changes. 2008-03-04 18:23:44 +00:00
dyoung
91c7d67975 Add methods to detach self and children. 2008-02-22 20:52:14 +00:00
jmcneill
4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
ad
598ab03ad0 Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
2007-12-05 07:06:50 +00:00
jmcneill
b6ed7a1236 Implement volume controls for pseudo audio device. 2007-11-11 19:53:38 +00:00
jmcneill
23526fe3a9 Add pseudo audio device driver. With this pseudo-device, audio played back
via the standard audio interfaces is redirected back to userland as raw
PCM data on /dev/padN.

One example usage is to stream audio to an AirTunes compatible device using
rtunes (http://www.nazgul.ch/dev_rtunes.html), ie:

	$ rtunes - < /dev/pad0
	$ mpg123 -a /dev/sound1 blah.mp3

Another option is to capture audio output from eg. Real Player, by simply
instructing Real Player to output to /dev/sound1, and running:

	$ cat /dev/pad0 > blah.pcm
2007-11-11 17:37:45 +00:00