The trap value set by sio_initpar() was interpreted as a channel
number, causing sio_setpar() to fail.
Found and analysed by Roman Bogorodskiy <bogorodskiy at gmail.com>,
thanks
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@
Now we need to use opt's mode instead of slot's mode as this is the
one used by dev_cycle(). Fixes monitoring mode not working in case
dev->rchan != dev->pchan
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.
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.
From edd@
In Linux 5.11, a behavior change for USB audio devices was introduced[0]
that prevents changing parameters such as sample rate or period
size once they are initially set without a snd_pcm_hw_free in
between. This causes sndio to get forced to 48000 Hz and and a
period size of 4800, since those are the parameters set during
sio_open.
To fix this, call snd_pcm_hw_free at the start of sio_alsa_setpar_hw
to remove any previous configuration before setting a new one.
[0] https://bugzilla.kernel.org/show_bug.cgi?id=211941
No bahavior change, but this makes the code is much easier.
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.
If stdout is not flushed, output is not seen by programs using
sndioctl through a pipe (ex. "sndioctl -m | cat" displays nothing).
Patch from Érico Nogueira <ericonr@disroot.org>, idea
from Duncan Overbruck <mail@duncano.de>
This avoids having to rebuild a lot of packages even if the
ABI did not break. cubeb used by firefox currently dlopen's
either libsndio.so.7.1 or libsndio.so, with the major link
this would also avoid having to patch this as long as the
ABI doesn't break without having to ship the libsndio.so
symlink outside of -dev/-devel packages.