Home | History | Annotate | Download | only in pad
History log of /src/sys/dev/pad/pad.c
RevisionDateAuthorComments
 1.85  27-May-2023  nat Revert to previous.

This change broke the intention of recent changes to pad(4).

The solution to address PR/57436 must be done in bta2dpd(8).
 1.84  26-May-2023  nat Fix previous.

The previous commit was misleading due to the flag names used.

The rationale for this change is that it is ok to return EAGAIN on first
read as playback has not started. Then it shoud wait on every subsequent read.

This is what makes the high precsision throttling of pad(4), for which these
degree of fine-grained sleeps are not possible in userland. This is a
requirement of users of pad(4) such as bta2dpd(8).
 1.83  26-May-2023  nat Fix logic for timing.

Addresses PR/57436.

XXX pullup-10.
 1.82  01-May-2023  mlelstv Don't overflow when scaling 32bit samples.
 1.81  23-Apr-2023  mlelstv No longer use AUDIO_INTERNAL_BITS but rely on passed audio format.
 1.80  10-Apr-2023  mlelstv Write slinear_le 16bit samples, independent from platform and
AUDIO_INTERNAL_BITS.
 1.79  24-Jan-2023  mlelstv Pace I/O timing to match the audio interface.
Enable interrupts while copying buffers.
 1.78  31-Mar-2022  pgoyette branches: 1.78.4;
For device modules that provide both auto-config and /dev/xxx
interfaces, make sure that initialization and destruction
follow the proper sequence. This is triggered by the recent
changes to the devsw stuff; per riastradh@ the required call
sequence is:

devsw_attach()
config_init_component() or config_cf*_attach()
...
config_fini_component() or config_cf*_detach()
devsw_detach()

While here, add a few missing calls to some of the detach
routines.

Testing of these changes has been limited to:
1. compile without build break
2. no related test failures from atf
3. modload/modunload work as well as
before.

No functional device testing done, since I don't have any
of these devices. Let me know of any damage I might cause
here!

XXX Some of the modules affected by this commit are already
XXX broken; see kern/56772. This commit does not break
any additional modules (as far as I know).
 1.77  28-Mar-2022  riastradh driver(9): devsw_detach never fails. Make it return void.

Prune a whole lotta dead branches as a result of this. (Some logic
calling this is also wrong for other reasons; devsw_detach is final
-- you should never have any reason to decide to roll it back. To be
cleaned up in subsequent commits...)

XXX kernel ABI change to devsw_detach signature requires bump
 1.76  12-Mar-2022  riastradh pad(4): Do harmless, not harmful, integer truncation.

Reported-by: syzbot+917ff3551897f1a99cf6@syzkaller.appspotmail.com
 1.75  14-Jun-2021  riastradh pad(4): Explain what's wrong with using device pointers like this.

...and why the kernel lock is not enough.
 1.74  14-Jun-2021  riastradh pad(4): Omit unused sc_blksize.
 1.73  14-Jun-2021  riastradh pad(4): Refactor for clarity, and fix locking bugs.

- Don't touch sc_buflen outside sc_intr_lock.

- Omit needless broadcast in pad_halt_output -- nothing wakes on the
new condition (sc_buflen == 0), so this can't make a difference
except possibly in buggy code.

- Sprinkle KASSERTs.
 1.72  14-Jun-2021  riastradh pad(4): Destroy the callout when done.

Should not be possible for it to be pending or firing at this point,
because we have detached the audio(4) child and so it should have
halted output.
 1.71  14-Jun-2021  riastradh pad(4): Make this exclusively a cloning device.

padN numbering never corresponded with audioM numbering except by
accident, so the non-cloning device never worked reliably for
scripting. This simplifies the logic substantially.

While here, fix drvctl detach race.
 1.70  14-Jun-2021  riastradh pad(4): Sort includes. Add missing includes to padvar.h.
 1.69  14-Jun-2021  riastradh pad(4): Fix some locking.

- No need for sc_cond_lock.
- Issue cv_broadcast under the correct lock.
- Use callout_halt, not haphazard callout_stop.
- IPL_SOFTCLOCK for a mutex taken from a callout.
 1.68  14-Jun-2021  riastradh pad(4): Some incomplete tidying.

- Put pseudo-device softc setup/teardown back in pad_attach/detach,
not in the cdev/fops operations which are about file descriptors.
- Remove unnecessary sc_dying flag.
- Omit needless config_deactivate(sc->sc_audiodev); the only effect
of this is already done by config_detach anyway, which is done in
the same context.
- Issue config_detach_children and free softc stuff in the right
order.
- Omit needless `if (sc == NULL) return ENXIO'.

Survives eight parallel t_mixerctl tests many times over on an
8-thread/4-core machine.

XXX TODO:
- Remove padconfig; it is not appropriate to hold a mutex over
sleeping allocation or autoconf config_attach operations. This
should be done another way.
- Fix agreement of sc_condvar with locks: is it sc_cond_lock or
sc_intr_lock? Can't be both; unclear why both exist.
- Determine whether both cdev and fops are really needed -- it is
confusing to have two types of paths into all this logic, and it
seems to me only one of them should be necessary.
 1.67  13-Jun-2021  riastradh pad(4): Take kernel lock around autoconf stuff.

This is not really enough -- the padconfig locking logic violates
rules about sleeping while holding locks, might be deadlocky, and may
also be racy. But, it'll serve to make progress.
 1.66  08-Jun-2021  nia pad(4): run the callout if the buffer is saturated instead of returning

reverts to the same behavior as in -8 and -9. prevents immediate failures
and device timeouts if there's a slight delay in the buffer being
consumed.

this is reproducible with the example in the man page that uses
ffmpeg to record the output of audioplay:

$ ffmpeg -f s16le -ar 44100 -ac 2 -i /dev/pad0 output.wav
$ audioplay -d /dev/audio1 input.wav

if output.wav already exists, ffmpeg will prompt for confirmation
to overwrite as soon as audioplay starts, causing a noticable delay,
followed by a write failure that causes audioplay to immediately
exit.
 1.65  23-Feb-2020  isaki branches: 1.65.10;
Make start_input/halt_input optional if the driver has no recording,
make start_output/halt_output optional if the driver has no playback.
And remove such never called functions.
 1.64  22-Feb-2020  isaki Make calling get_props() lockless.
get_props() of all MD drivers now can be called without sc_lock.
 1.63  26-Jun-2019  isaki branches: 1.63.4;
Fix return value. fo_poll expects revents, not errno.
 1.62  26-Jun-2019  isaki Style fixes. No functional changes intended.
- Rename some functions for consistency.
- Rearrange some functions for readability.
- Unify to struct pad_softc.
 1.61  19-Jun-2019  isaki Don't call next callout when an error occurs in start_output.
 1.60  19-Jun-2019  isaki pad(4)'s output format is LE even on big endian arch.
 1.59  08-May-2019  isaki Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
 1.58  25-Sep-2018  nakayama branches: 1.58.2;
pad(4) mixer has only 1 channel, so return EINVAL in the case other than 1.

This fixes the following strange output of mixerctl(1):

outputs.master=255,0
inputs.dac=255,0
 1.57  25-Sep-2018  nakayama Revert to rev.1.53.
I accidentally committed the netbsd-8 branch file in rev.1.54.
 1.56  23-Sep-2018  kre Since we need an int paramater, and uio_resid is size_t cast it to int
to avoid warnings from the ever friendly compiler... (check that size if
in range was already made).
 1.55  23-Sep-2018  kre Open code min() so we don't need to find its prototype ...
 1.54  23-Sep-2018  nakayama pad(4) mixer has only 1 channel, so return EINVAL in the case other than 1.

This fixes the following strange output of mixerctl(1):

outputs.master=255,0
inputs.dac=255,0
 1.53  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.52  26-Jan-2018  pgoyette branches: 1.52.2; 1.52.4;
Fix typo in previous. mea culpa, mea culpa, mea maxima culpa
 1.51  26-Jan-2018  pgoyette Unitialized variable - CID/1428657
 1.50  09-Jan-2018  nat Fix pad on systems with many cores/cpus:

* Introduce a lock to serialize attach/detach of pad devices.
* Forcefully detach children of pad on close.
* Be more carefull in pad_open with regards to config_detach only
if new instances of the pad device are created and fail to open.

Addresses PR kern/52889.

These changes were developed with and tested by pgoyette@.
 1.49  17-Dec-2017  pgoyette If config_fini_component() fails (due to device driver busy), don't
discard its error value when re-attaching the devsw. If the devsw
is successfully re-attached and we return success, the module will
get detached anyway. And, since the device is actually busy, we'll
eventually panic.

Thanks to nat@ for providing the reproduction instructions.

XXX A driver-busy condition will currently still trigger the error
XXX message from config_fini_component()
XXX configure: attachment `pad' of `pad' driver fini failed: 16
XXX This will be addresses separately by having pad maintain its own
XXX ref-count and not relying on config_fini_component() to detect
XXX the busy state.
 1.48  16-Dec-2017  pgoyette Use config(1) and IOCONF= to generate most of the auto-config data
structures. (Note that bin/52823 documents the reasons for still
requiring hand-crafted cfattach structures.)
 1.47  16-Dec-2017  pgoyette Remove the correct extra #endif

:)
 1.46  16-Dec-2017  mrg remove extra #endif left in previous commit.
 1.45  15-Dec-2017  pgoyette Replace manipulation of individual config structures with calls to
config_{init,fini}_component()
 1.44  15-Dec-2017  pgoyette Rework so that module infrastructure is provided even when the module
is built-in to the kernel.

XXX pullup-8?
 1.43  30-Nov-2017  christos add fo_name so we can identify the fileops in a simple way.
 1.42  30-Jul-2017  nat The pad module will now compile with WARNS=5.
 1.41  02-Jul-2017  nat If a particular pad device is opened, ie pad1 then configure and use pad1
if it is not already configured.

This improves scriptability as you will know the particular pad(4) device
you have opened.

pad(4) devices still have a cloning interface if pad device (minor
number 254) is opened it will attach the next free device. This action
can be repeated.

XXX update MAKEDEV scripts to make /dev/pad the cloning device.

Ok christos@.
 1.40  02-Jul-2017  nat Return early from read if kpause is interrupted by a signal.
 1.39  01-Jul-2017  nat Pad is now clones its device, attaching upon open and detaching upon close.
This means that only one pad device is required in /dev.

The code contains a compile time limit of 128 units.

Ok christos@.
 1.38  01-Jul-2017  nat sc_audiodev should be defined as a device_t as this is what audio_attach_mi
returns.
 1.37  19-Jun-2017  nat Use defines to specify pad audio format. NFCI.

Ok christos@.
 1.36  06-Jun-2017  nat Style change.
 1.35  06-Jun-2017  nat Simplification of rate limiter. It now works uni/multiprocessor.
 1.34  06-Jun-2017  nat sc_bytes_count needs to be set in pad_audio_open not pad_open.
 1.33  06-Jun-2017  nat Express BYTESTOSLEEP as an 64 bit integer.
Use BYTESTOSLEEP in expresson of BYTES_PER_SEC.
 1.32  01-Jun-2017  pgoyette branches: 1.32.2;
Add infrastructure for modularization of audio, midi, and sequencer
 1.31  01-Jun-2017  chs remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.30  27-May-2017  nat Add missing sc_bytes_count.
 1.29  27-May-2017  nat Rework of previous.
Math for BYTESTOSLEEP and TIMENEXTREAD is now correct.
 1.28  23-Feb-2017  nat branches: 1.28.4;
Update pad due to changes in audio. sc_bytes_count and BYTESTOSLEEP are
no longer required.
 1.27  26-Jan-2017  nat Don't hold the thread_lock between successive calls to sc_intr as it
breaks mixing.

This will help passing the atf test. Changes to audio.c to ensue this
will be in a followup commit.
 1.26  15-Oct-2016  nat branches: 1.26.2;
pad(4) must be open before corresponding audio device is opened.

OK christos@
 1.25  07-Jul-2016  msaitoh branches: 1.25.2;
KNF. Remove extra spaces. No functional change.
 1.24  26-Feb-2016  nat Allow reads from pad(4) less or greater than PAD_BLKSIZE.

Ensure that audio data is ready before reading.
Addresses PR 39204.

OK jmcneil@.
 1.23  10-Jul-2015  nat Wrap up calls to sc_intr in kpreempt[en/dis]able.

This commit was approved by christos@
 1.22  18-Nov-2014  jmcneill branches: 1.22.2;
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.
 1.21  25-Jul-2014  dholland branches: 1.21.2;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.20  02-Nov-2013  christos branches: 1.20.2;
sprinke __diagused
 1.19  24-Nov-2011  agc branches: 1.19.8; 1.19.12;
get rid of a variable which is no longer used after the demise of splaudio
 1.18  24-Nov-2011  jmcneill splaudio is no more
 1.17  23-Nov-2011  jmcneill 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.
 1.16  03-Sep-2010  jmcneill branches: 1.16.8; 1.16.10;
- return EIO if audio data is received and /dev/pad isn't open
- give a better description for AUDIO_GETDEV
 1.15  28-Jun-2010  pooka Don't print spammy message if read is interrupted (ctrl-c)
while waiting for data.
 1.14  01-May-2010  pooka fix field initializers
 1.13  09-Apr-2010  ahoka Add support to be built as a kernel module.
 1.12  18-Jan-2010  dyoung branches: 1.12.2; 1.12.4;
If the device does not exist, return ENXIO, as is customary, instead of
ENODEV. Ok jmcneill@.
 1.11  14-Mar-2009  ad 'boot -z' bogons
 1.10  04-Sep-2008  christos branches: 1.10.2; 1.10.4; 1.10.6; 1.10.8;
fix device is not split warning
 1.9  06-Aug-2008  drochner remove a KASSERT which is wrong since audio(4)'s device/softc were split
 1.8  08-Jun-2008  tsutsui branches: 1.8.4;
Replace homegrown pad_find_softc() with device_lookup_private().
 1.7  09-May-2008  jmcneill Use 2-clause license.
 1.6  04-Mar-2008  cube branches: 1.6.2; 1.6.4; 1.6.6;
Split device_t and softc for audio(4), and other related cosmetic changes.
 1.5  22-Feb-2008  dyoung Add methods to detach self and children.
 1.4  09-Dec-2007  jmcneill branches: 1.4.6; 1.4.8; 1.4.12;
Merge jmcneill-pm branch.
 1.3  05-Dec-2007  ad branches: 1.3.2;
Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
 1.2  11-Nov-2007  jmcneill branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8; 1.2.10;
Implement volume controls for pseudo audio device.
 1.1  11-Nov-2007  jmcneill 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
 1.2.10.2  26-Dec-2007  ad Sync with head.
 1.2.10.1  08-Dec-2007  ad Sync with head.
 1.2.8.4  27-Dec-2007  mjf Sync with HEAD.
 1.2.8.3  08-Dec-2007  mjf Sync with HEAD.
 1.2.8.2  19-Nov-2007  mjf Try to fix sync botch.
 1.2.8.1  11-Nov-2007  mjf file pad.c was added on branch mjf-devfs on 2007-11-19 19:58:38 +0000
 1.2.6.6  17-Mar-2008  yamt sync with head.
 1.2.6.5  27-Feb-2008  yamt sync with head.
 1.2.6.4  21-Jan-2008  yamt sync with head
 1.2.6.3  07-Dec-2007  yamt sync with head
 1.2.6.2  15-Nov-2007  yamt sync with head.
 1.2.6.1  11-Nov-2007  yamt file pad.c was added on branch yamt-lazymbuf on 2007-11-15 11:44:16 +0000
 1.2.4.5  09-Dec-2007  jmcneill Sync with HEAD.
 1.2.4.4  08-Dec-2007  jmcneill Rename pnp(9) -> pmf(9), as requested by many.
 1.2.4.3  04-Dec-2007  jmcneill Register with power management framework, and de-noisify attachment.
 1.2.4.2  14-Nov-2007  joerg Sync with HEAD.
 1.2.4.1  11-Nov-2007  joerg file pad.c was added on branch jmcneill-pm on 2007-11-14 19:04:26 +0000
 1.2.2.2  13-Nov-2007  bouyer Sync with HEAD
 1.2.2.1  11-Nov-2007  bouyer file pad.c was added on branch bouyer-xenamd64 on 2007-11-13 16:32:17 +0000
 1.3.2.1  11-Dec-2007  yamt sync with head.
 1.4.12.4  28-Sep-2008  mjf Sync with HEAD.
 1.4.12.3  29-Jun-2008  mjf Sync with HEAD.
 1.4.12.2  02-Jun-2008  mjf Sync with HEAD.
 1.4.12.1  03-Apr-2008  mjf Sync with HEAD.
 1.4.8.1  24-Mar-2008  keiichi sync with head.
 1.4.6.3  23-Mar-2008  matt sync with HEAD
 1.4.6.2  09-Jan-2008  matt sync with HEAD
 1.4.6.1  09-Dec-2007  matt file pad.c was added on branch matt-armv6 on 2008-01-09 01:53:28 +0000
 1.6.6.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.6.6.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.6.4.5  09-Oct-2010  yamt sync with head
 1.6.4.4  11-Aug-2010  yamt sync with head.
 1.6.4.3  11-Mar-2010  yamt sync with head
 1.6.4.2  04-May-2009  yamt sync with head.
 1.6.4.1  16-May-2008  yamt sync with head.
 1.6.2.2  17-Jun-2008  yamt sync with head.
 1.6.2.1  18-May-2008  yamt sync with head.
 1.8.4.1  19-Oct-2008  haad Sync with HEAD.
 1.10.8.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.10.6.1  11-Dec-2008  ad Checkpoint work in progress.
 1.10.4.1  20-Nov-2010  riz Pull up following revision(s) (requested by hubertf in ticket #1386):
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.258
sys/dev/pad/pad.c: revision 1.11
sys/dev/scsipi/cd.c: revision 1.288
sys/dev/isa/pcppi.c: revision 1.33
sys/kern/subr_autoconf.c: revision 1.169
'boot -z' bogons
 1.10.2.1  28-Apr-2009  skrll Sync with HEAD.
 1.12.4.3  05-Mar-2011  rmind sync with head
 1.12.4.2  03-Jul-2010  rmind sync with head
 1.12.4.1  30-May-2010  rmind sync with head
 1.12.2.3  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.12.2.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.12.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.16.10.1  19-Nov-2011  jmcneill port ad-audiomp2 branch changes to 5.99.56
todo:
- port ad-audiomp2 pcppi changes
- these drivers need to be fixed:
- emuxki
- gcscaudio
- hdafg
- uaudio
- umidi
- MD audio drivers
 1.16.8.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.16.8.1  17-Apr-2012  yamt sync with head
 1.19.12.1  18-May-2014  rmind sync with head
 1.19.8.2  03-Dec-2017  jdolecek update from HEAD
 1.19.8.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.2.1  10-Aug-2014  tls Rebase.
 1.21.2.1  23-Nov-2014  martin Pull up following revision(s) (requested by jmcneill in ticket #249):
sys/modules/pad/Makefile: revision 1.2
sys/arch/arm/allwinner/awin_hdmiaudio.c: revision 1.5
sys/dev/pad/pad.c: revision 1.22
sys/dev/pad/padvol.c: file removal
sys/dev/pad/files.pad: revision 1.5
sys/dev/auvolconv.c: revision 1.1
sys/dev/pad/padvol.h: file removal
sys/dev/audio.c: revision 1.266
sys/dev/files.audio: revision 1.3 (via patch: sys/conf/files)
sys/dev/auvolconv.h: revision 1.1
sys/dev/pad/padvar.h: revision 1.5
sys/dev/audio_if.h: revision 1.70
sys/arch/arm/allwinner/files.awin: revision 1.26
Add common audio converters for software volume control. Only supports
slinear16_le and slinear16_be for now.
Convert pad(4) and awin_hdmiaudio to use the new converters.
 1.22.2.6  28-Aug-2017  skrll Sync with HEAD
 1.22.2.5  05-Feb-2017  skrll Sync with HEAD
 1.22.2.4  05-Dec-2016  skrll Sync with HEAD
 1.22.2.3  09-Jul-2016  skrll Sync with HEAD
 1.22.2.2  19-Mar-2016  skrll Sync with HEAD
 1.22.2.1  22-Sep-2015  skrll Sync with HEAD
 1.25.2.6  20-Mar-2017  pgoyette Sync with HEAD
 1.25.2.5  04-Nov-2016  pgoyette Sync with HEAD
 1.25.2.4  26-Jul-2016  pgoyette Rename LOCALCOUNT_INITIALIZER to DEVSW_MODULE_INIT. This better describes
what we're doing, and why.
 1.25.2.3  19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.25.2.2  18-Jul-2016  pgoyette Good grief - what was I thinking?

Let's make the d_localcount pointer point to a 'struct localcount' as
intended.
 1.25.2.1  18-Jul-2016  pgoyette Add 'struct localcount' for modular builds
 1.26.2.1  21-Apr-2017  bouyer Sync with HEAD
 1.28.4.3  17-May-2017  pgoyette At suggestion of chuq@, modify config_attach_pseudo() to return with a
reference held on the device.

Adapt callers to expect the reference to exist, and to ensure that the
reference is released.
 1.28.4.2  29-Apr-2017  pgoyette Remove more unnecessary #include for sys/localcount.h
 1.28.4.1  27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.32.2.3  03-Oct-2018  martin Pull up following revision(s) (requested by nakayama in ticket #1044):

sys/dev/pad/pad.c: revision 1.58

pad(4) mixer has only 1 channel, so return EINVAL in the case other than 1.

This fixes the following strange output of mixerctl(1):

outputs.master=255,0
inputs.dac=255,0
 1.32.2.2  23-Dec-2017  snj Pull up following revision(s) (requested by pgoyette in ticket #450):
sys/dev/pad/pad.c: revision 1.44
Rework so that module infrastructure is provided even when the module
is built-in to the kernel.
 1.32.2.1  10-Jun-2017  snj Pull up following revision(s) (requested by nat in ticket #20):
sys/dev/pad/pad.c: revisions 1.33-1.35
sys/dev/pad/padvar.h: revision 1.9
Express BYTESTOSLEEP as an 64 bit integer.
Use BYTESTOSLEEP in expresson of BYTES_PER_SEC.
--
sc_bytes_count needs to be set in pad_audio_open not pad_open.
--
Simplification of rate limiter. It now works uni/multiprocessor.
--
pad blocksize 1024 -> 8192. Helps when sleeping in rate limiter.
 1.52.4.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.52.4.1  10-Jun-2019  christos Sync with HEAD
 1.52.2.2  30-Sep-2018  pgoyette Ssync with HEAD
 1.52.2.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.58.2.4  06-May-2019  isaki Revive clonify.
XXX should clean code more.
 1.58.2.3  05-May-2019  isaki Remove unnecessary __diagused (which was imported in this branch).
 1.58.2.2  04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.58.2.1  21-Apr-2019  isaki Reimplement audio subsystem.
http://mail-index.netbsd.org/tech-kern/2019/04/01/msg024944.html
At first step, audio and devices tightly coupled to audio.
audio.c -> dev/audio.c: completely rewritten.
mulaw.c -> audio/mulaw.c, audio/alaw.c: improve quality.
audiovar.h, mulaw.h: should be removed.
audio/linear.c: efficient new linear-linear converter.
auconv.[ch]: should be removed but need some functions for now.
aurateconv, auvolconv: removed (new audio.c handles it).
audiobell.c: efficient and small new bell driver.
audiobelldata.h: removed 4KB sine wave data.
pad/pad.c: catch up audio, but not cloneable for now.
 1.63.4.1  29-Feb-2020  ad Sync with head.
 1.65.10.1  17-Jun-2021  thorpej Sync w/ HEAD.
 1.78.4.1  02-May-2023  martin Pull up following revision(s) (requested by mlelstv in ticket #153):

sys/dev/pad/pad.c: revision 1.80
sys/dev/pad/pad.c: revision 1.81
sys/dev/pad/pad.c: revision 1.82
sys/dev/pad/pad.c: revision 1.79
sys/dev/pad/padvar.h: revision 1.17

Pace I/O timing to match the audio interface.

Enable interrupts while copying buffers.

Write slinear_le 16bit samples, independent from platform and
AUDIO_INTERNAL_BITS.

No longer use AUDIO_INTERNAL_BITS but rely on passed audio format.
Don't overflow when scaling 32bit samples.

RSS XML Feed