Age | Commit message (Collapse) | Author |
|
amendments to his diff are noted on tech
|
|
Fixes last few samples not being played when very large buffers
are used.
|
|
The new sio_flush(3) functions works the same way as sio_stop(3),
except that it doesn't wait for play buffer to be drained. Instead,
it discards its contents and returns immediately.
|
|
Found by and ok semarie@
|
|
The default device precision doesn't change (yet), i.e. we still
request the usual 16-bit mode, when available. Hardware supporting
24-bit samples only gets end-to-end 24-bit processing by default.
ok kettenis
|
|
person. Rewrite or use singular they.
ok thfr@ sthen@ daniel@ ian@ job@ kmos@ jcs@ ratchov@ phessler@ and
others I'm likely missing on an earlier version.
feedback tj@, feedback and ok jmc@
|
|
ok kn
|
|
mostly from kn@, tweaks from me
|
|
ok ratchov
|
|
|
|
This a shift towards a new model: clients connect to logical devices
(created with -s option) then the server routes data to/from the
underlying physical device (registered with -f option). The binding
may be changed at run-time with the server.device control exposed by
sndioctl(1).
As audio devices exposed by sndiod(8) are not bound to fixed physical
devices anymore, the physical audio device number component of
sndio(7) descriptors was removed.
fixes, help from and ok denis, edd
|
|
reduced to 480 frames. ok ratchov@
|
|
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.
Work done and verified by Ashton Fagg <ashton@fagg.id.au>
ok deraadt@ semarie@ claudio@
|
|
|
|
Now i386 compiler is smart enough to generate a single imul
instruction per fixed-point multiplication. This change also allows
24-bit precision to be used on all archs (if -DADATA_BITS=24 is used).
Tested on arm64 by Doug Moss <dougmoss710 at yahoo.com>, thanks
Suggested and ok naddy@
|
|
This is similar to what we already do when device is opened and its
mode doesn't match requested mode. Besides adding consistency, this
change would allow client's opt structure to be changed dynamically.
|
|
This is necessary to make rec-only devices properly work in
full-duplex. Fixes full-duplex clients stuck on rec-only device.
|
|
Besides being better coding style, this allows a client to be detached
and then attached to a device with different parameters.
|
|
Trying to rename the program level control is not needed anymore.
When a slot is given to another program, the new ctl_{new,del}()
functions can be used to delete the control of the old program and
create a new one for the new program. Cleaner, simpler.
|
|
|
|
This simplifies the logic of the initialization code, makes debug
printfs nicer and could slightly ease futur development.
No behavior change.
|
|
This is better style as since recently dev->master_enabled is used by
the ctlslot_xxx family functions which -- in the future -- could be
called with the device closed.
No behavior change.
|
|
|
|
|
|
No behavior change.
|
|
Moving to a global server-wide controls list is necessary to expose
controls that are not associated to a particular device (ex. a device
selector).
The current hack to use the device-side sioctl_desc->addr variable as
client-side key can't work anymore. So, we use a unique dynamically
allocated ctl->addr key; this is much cleaner. A new "scope" enum
(with two "void *" arguments) is used to determine what the control
does control. This adds flexibility and allows to easily add new
control types that are not associated to devices.
No behavior change.
|
|
Currently sndiod does not allow you to use alternative devices (-F
devices) which support only a subset of the modes of the main (-f)
device.
For example, if you do `sndiod -f rsnd/0 -F rsnd/1` and:
- rsnd/0 is full-duplex (rec + play).
- rsnd/1 is play-only.
Then you will be unable to use rsnd/1 as sndiod deems it incompatible
and refuses to use it (similarly if rsnd/1 is record-only).
This is annoying. It means if you want to use a record-only or play-only
device, you will either have to kill sndiod and restart it specifying
only that device (`sndiod -f rsnd/1` for the above example), or failing
that, downgrade the functionality of the main device (`-m play`).
This diff (a joint effort between ratchov@ and myself) makes mixing
devices with different modes possible. It does this by making both
recording and playing available for all devices, even if the underlying
hardware doesn't support both modes.
For example, if I try to record from a play-only device, then recording
will succeed, but the captured PCM data will be pure silence. Similarly,
if I try to play to a record-only device, then the audio stream will
disappear into the ether.
This is mostly a no-op for sndiod in the default configuration (except
that play-only devices now accept recording clients). If you use
alternative devices (-F), then it's possible for a record-only device to
be found first, which may be confusing if you just want to hear sound.
We can only assume that if you deviate from defaults, then you know what
you are doing.
With guidance from, and OK ratchov@, thanks!
|
|
The previous behavior of automatically decreasing playback volume
when new programs start playing can be achieved with '-w on'.
ok ratchov, patrick
|
|
Fixes crash that can occur when an usb device is unplugged, found by edd@
|
|
|
|
No behavior change. This decreases the number of explicit references
to the dev structure
|
|
No behavior change. This decreases the number of explicit references
to the dev structure.
|
|
No binary change.
|
|
No behavior change, except for improved debug printfs.
|
|
No behavior change. Later this will ease applying the configuration of
one device to another by "just" swapping pointers.
|
|
No behavior change. Later this will ease changing the controlled
device by "just" swapping pointers.
|
|
No behavior change. Later this will ease moving clients from one
device to another by "just" swapping pointers.
|
|
|
|
Clients are always drained before they disconnect, so this change
affects programs that die unexpectedly or loose thier network
connection.
Besides the bad style, this change fixes a theoretical bug when the
disconnected client slot could be recycled and given to another client
while it's being drained
|
|
This removes many redundant dereferences to obtain the dev pointer
from the slot stucture and makes the source slightly more readable.
No behavior change.
|
|
No behavior change; this change is only to make the maths easier to
proofread
|
|
No bahavior change. Now, slot_attach() moves slot's clock forward and
puts the slot on device list; slot_detach() does the opposite: remove
from device list and move clock backwards. This will allow to detach a
client and attach it later in exactly the same state.
|
|
|
|
|
|
At the expence of slightly more CPU cycles, it almost removes aliasing
noise in most practical use-cases.
|
|
Fixes confusion between s16 and u16 found in aucat by James Cook.
|
|
|
|
The initial alternate device number was set to 1 (instead of -1),
causing device number 1 to be skipped the first time sndiod is used.
|
|
|
|
mutually exclusive values. It's the same as SIOCTL_LIST except that
exactly one list element may be selected.
|