Commit Graph

370 Commits

Author SHA1 Message Date
Alexandre Ratchov aac840d9f9 oss: Fix sio_setpar() when channel number is not set
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
2021-06-16 09:32:46 +02:00
Alexandre Ratchov e450bab99e configure: Generate .pc file with variable-prefixed paths 2021-04-23 14:22:47 +02:00
Alexandre Ratchov 5a20439ec8 Add forgotten sndio.pc.in template 2021-04-20 11:43:40 +02:00
Alexandre Ratchov ce7e998772 Add initial pkg-config support, from brad@ 2021-04-20 11:02:47 +02:00
Michael Forney 7551d499a8 alsa: remove existing hardware config before setting a new one
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
2021-03-01 09:09:51 +01:00
Alexandre Ratchov d1c4d40cb9 Sync to OpenBSD.
Mostly the new AUDIO{REC,PLAY}DEVICE envoronment variables
and many man-page improvements.
2020-11-29 13:04:18 +01:00
Duncan Overbruck 7a03da2848 Add libsndio.so.${MAJ} symlink and use it as SONAME on linux
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.
2020-09-02 15:35:34 +02:00
Alexandre Ratchov c6d8b54ae9 Raw device access is not anymore a fall-back for when sndiod isn't running
Found by Jan Stary <hans at stare.cz>, discussed with jmc@
2020-07-19 09:35:32 +02:00
Alexandre Ratchov 375da98c57 sndio.h: mention SIOCTL_SEL in comments as well 2020-06-28 07:51:46 +02:00
Alexandre Ratchov d391925214 sio_open.3: massive macro cleanup from schwarze@
basic macro cleanup: .Fo for long .Fn lines, .Fa for struct fields,
avoid \*(Gt and \*(Lt, .Dv NULL, .Cm for pledge promises
2020-06-28 07:50:09 +02:00
Alexandre Ratchov fe4160e1fe Sync sioctl_open.3 to OpenBSD
Many fixes from schwarze@: wording, mdoc(7) use, environment and
history. Use integer instead of continuous.
2020-06-20 11:23:09 +02:00
Alexandre Ratchov 14b0682012 Add SIOCTL_SEL control type 2020-06-16 07:51:45 +02:00
Alexandre Ratchov 41b654cfe7 Document sioctl_desc structure maxval attribute 2020-06-16 07:34:42 +02:00
Alexandre Ratchov 0c3fd96693 Fix confusion between ALSA output and input periods count.
This could cause the play start threshold to be larger than the play
buffer in turn causing playback to never start.
2020-06-12 22:28:44 +02:00
Alexandre Ratchov c531dda0ad Reword and simplify certain sentinces
From schwarze@
2020-05-25 14:27:48 +02:00
Alexandre Ratchov b043bfcf32 Use .Nm sndio to refer to the sndio library
From schwarze@
2020-05-25 14:27:44 +02:00
Alexandre Ratchov 0da4d5ba34 Add Xr for aucat, midicat and sndioctl
From schwarze@
2020-05-25 14:27:30 +02:00
Alexandre Ratchov f8795c056d Replace off-topic parts of the desciption by an architecture overview
Remove useless (re)wording of what are audio(4) and midi(4), add a
quick description of sndiod as intermediate layer. Try to focuse on
what the sndio library and sndiod do instead of how they do it. As
suggested by schwarze, use the word "device descriptor" instead of
"device name" to avoid the common confusion with the device files.

Remove information already given in same sentence;

Tweaks from jmc@
2020-05-19 10:18:29 +02:00
Alexandre Ratchov 7433055e88 Use hardcoded rsnd/0 as openbsd default (hardware) device 2020-04-30 17:41:37 +02:00
Alexandre Ratchov 8d24dd3ef8 sioctl_sun.c: If no "xxx.mute" control is found, try "xxx_mute" 2020-04-30 17:25:22 +02:00
Alexandre Ratchov fcb50e68af man pages to cvs 2020-04-24 08:59:57 +02:00
Alexandre Ratchov 0f21b42d41 mixerctl and audioctl moved to section 8 2020-04-24 08:56:27 +02:00
Alexandre Ratchov 1d644ba2a8 Fix .Dt and Mdocdate in man pages 2020-02-26 18:13:17 +01:00
Alexandre Ratchov 2c894cc701 Bump sioctl_open.3 copyright year. 2020-02-26 18:12:02 +01:00
Alexandre Ratchov cc30ccae23 bump copyright year 2020-02-24 07:00:49 +01:00
Alexandre Ratchov c2226012ed Remove SIOCTL_DEVANY 2020-02-22 14:55:40 +01:00
Alexandre Ratchov e55971c61e Add "maxval" attribute to sioctl_desc structure.
As control may have different max values, make sndioctl
expose floats in the [0:1] range.
2020-02-22 14:52:20 +01:00
Alexandre Ratchov 2207b5e6db Represent sndioctl controls as floats in the [0:1] interval 2020-02-22 10:34:40 +01:00
Alexandre Ratchov b62a7eef6f Expose sun mixer master knobs in the top-level group.
This allows the same master knobs to be available no matter
if sndiod is running or net.
2020-02-08 15:50:56 +01:00
Alexandre Ratchov 9bec976a73 Crank library minor as this sioctl_xxx are new interfaces 2020-02-06 22:21:48 +01:00
Alexandre Ratchov 94515589f5 Rename wskbd_vol to volume 2020-02-05 17:32:23 +01:00
Alexandre Ratchov 1bfe9a4f39 Filter redundant control settings 2020-02-04 15:49:34 +01:00
Alexandre Ratchov 7f7fce942f Use non-blocking mode for all sioctl_aucat_xxx bits. 2020-02-04 15:48:15 +01:00
Alexandre Ratchov 21e52f9c4c Remove more unused USE_ALSA_MIXER tests. 2020-01-29 07:15:07 +01:00
Alexandre Ratchov 0575c9f2e1 Use new /dev/audioctlN read(2) interface 2020-01-29 07:04:30 +01:00
Alexandre Ratchov 3030ab2c66 Remove unused USE_ALSA_MIXER tests. 2020-01-29 06:16:19 +01:00
Alexandre Ratchov a077f6a7f3 Fix forgotten node->str to node->name changes 2020-01-23 12:20:13 +01:00
Alexandre Ratchov 0ac817ab82 Rename node->str to node->name3 2020-01-23 07:38:14 +01:00
Alexandre Ratchov f51534ae26 Rename sioctl_chan to sioctl_node 2020-01-23 07:16:27 +01:00
Alexandre Ratchov 0031ec4a72 Use "hw" group for hw controls to get stable control names.
To ensure chained sndiod controls get unique names, we prefix
groups sndiod creates with "dev".
2020-01-21 06:39:00 +01:00
Alexandre Ratchov d8e69e7e93 Remove SIOCTL_HALF 2020-01-17 06:34:38 +01:00
Alexandre Ratchov 1534d4f816 s/SIOCTL_INTMAX/SIOCTL_VALMAX 2020-01-16 07:47:23 +01:00
Alexandre Ratchov 74ae9cda72 Make the control group a simple string.
To handle nested devices, just prefix the group with the "dev."
prefix. To avoid namespace conflicts, put program controls in a
new "app" group.

The "master.level" control is renamed to "output.level" to match the
hardware name. This way snd/0 and rsnd/0 end-up with the same control
name.
2020-01-13 09:27:06 +01:00
Alexandre Ratchov 9edbee2bc1 sioctl_sun: Rename spkr->output, mic->input. 2020-01-13 07:19:55 +01:00
Alexandre Ratchov c64f25a5f8 Remove group for hardware controls. 2020-01-13 07:15:36 +01:00
Alexandre Ratchov 5a0fc8feb7 Move hw control in "inputs" and "outputs" groups 2020-01-11 11:01:56 +01:00
Alexandre Ratchov ddf18ab3e1 Allow "snd/default" style syntax 2020-01-03 15:41:30 +01:00
Alexandre Ratchov d2057194b1 Rename _setctl -> _setval and _onctl -> _onval 2020-01-03 15:30:06 +01:00
Alexandre Ratchov 6e83bb6a4f Rename siomix -> sioctl, stop using "mixer" word. 2020-01-03 15:19:25 +01:00
Alexandre Ratchov df7fa2512c Revert "siomix_sun: poll the mixer fd to detect when device is gone."
This reverts commit aceffe4729.
2019-08-31 10:18:49 +02:00