Commit Graph

1141 Commits

Author SHA1 Message Date
Alexandre Ratchov e79f8b5c2f Fix initial alternate device number
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.
2020-07-19 13:07:26 +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 97413ec614 sndioctl: Check control types and skip unknown ones 2020-06-28 07:52:52 +02:00
Alexandre Ratchov 7d0bfffd42 sndioctl: add "mute" example, from espie@ 2020-06-28 07:52:16 +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 f96882d62d Remove server/ group, rename device.select to server.device 2020-06-27 10:30:20 +02:00
Alexandre Ratchov 24d12842ac Add server/ group for device.select control 2020-06-26 09:20: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 9a446c6b72 Allow alternate devices to be switched with sndioctl 2020-06-18 06:27:36 +02:00
Alexandre Ratchov 2494f95430 Allow control names to start with digits or underscores 2020-06-16 07:56:34 +02:00
Alexandre Ratchov 14b0682012 Add SIOCTL_SEL control type 2020-06-16 07:51:45 +02:00
Alexandre Ratchov 9bfc9cf713 Don't try to open device that's already open 2020-06-16 07:34:42 +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 f29a76bc19 On error, drop clients and close the device only if it's still open
Fixes crashes when USB devices are disconnected, caused by an attempt
to close the already closed device: it was closed once when its ref
counter drops to zero (after the last client is disconnected) and once
with an explicit call to dev_close() on the error code-path.

The same pattern was used for MIDI ports, it's fixed as well.
2020-06-12 17:26:38 +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 2c8bea3f08 sndioctl: Print lists as comma separated nodes 2020-05-05 06:43:52 +02:00
Alexandre Ratchov e2d1813cfa sndioctl: When -m is used, print only controls that changed 2020-05-05 06:36:48 +02:00
Alexandre Ratchov e4b2fc0b6e sndioctl: Use a dedicated routine to print single mixer entry 2020-05-05 06:33:25 +02:00
Alexandre Ratchov b3a1b52f6a sndioctl: factor code to print numbers 2020-05-05 06:22:30 +02:00
Alexandre Ratchov 4ac8a8cae7 Merge branch 'master' of ssh://moule/~alex/git/sndio 2020-05-02 17:55:37 +02:00
Alexandre Ratchov b4bf3f21ec Use _sndiop user on OpenBSD to access raw devices 2020-05-02 17:54:58 +02:00
Alexandre Ratchov 417e0d6bef Merge branch 'master' of ssh://caoua.org/~alex/git/sndio 2020-05-02 17:51:56 +02:00
Alexandre Ratchov a35ae59831 configure: quote device name of --default-dev argument
This remove the need for the quotes in the configure script argument
making its invocation simpler
2020-05-02 15:28:08 +02:00
Alexandre Ratchov f330fa3d4a If no -f options are used, expose first 4 midi(4) devices to sndiod clients
A single default device could be set at ./configure time with
the --default-dev option
2020-04-30 19:06:13 +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 5750e312db sndiod: Record if a client belongs to a session 2020-04-30 16:33:08 +02:00
Alexandre Ratchov 5736faa146 Get a reference to the device when "snd/N" MIDI ports are opened
As the master output level control is not in software any longer the
device needs to opened for adjustments to work.
2020-04-30 16:27:32 +02:00
Alexandre Ratchov d785baf4f3 sndioctl: Display numbers with 3 decimal places, from schwarze@ 2020-04-30 16:23:02 +02:00
Alexandre Ratchov 5324c19a9c sndioctl.1 fixes, from schwarze@ 2020-04-30 16:22:51 +02:00
Alexandre Ratchov 857f08fb6e Get a reference to the device when "snd/N" MIDI ports are opened
As the master output level control is not in software any longer the
device needs to opened for adjustments to work.
2020-04-25 07:05:53 +02:00
Alexandre Ratchov 343f13e33f Make sure devices are properly closed in case of an error
Fixes possible crashes if the contol device fails, while the audio
device continues to work.
2020-04-24 13:35:33 +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 a04ab3f18c sndioctl: Add -q option to suppress output when setting variables 2020-04-16 14:52:54 +02:00
Alexandre Ratchov 2254b715af sndioctl: Add -n option to suppress variable name in output 2020-04-16 14:51:20 +02:00
Alexandre Ratchov 54839e409a Properly log CTL_NONE controls 2020-04-15 14:41:21 +02:00
Alexandre Ratchov 573c328527 Don't forget to notify clients when a control is removed 2020-04-15 14:24:59 +02:00
Alexandre Ratchov 3b8a8de5f2 sndiod: Hide controls of unused slots 2020-04-14 05:39:31 +02:00
Alexandre Ratchov e5f270a89f If available, use the hardware output.level to control the volume.
With this change, there's a single outputs.level control: either the
hardware one or software one. Consequently, there can't be control
name clashes and there's no need to move hardware's top-level controls
into the "hw/" group.
2020-04-13 07:48:18 +02:00
Alexandre Ratchov fab9b7cb7e Call dev_ctlsync(), even if there's no control device
In the dev_reopen() code-path, the controls of the old device were
removed so all clients must be notified about the controls change.
2020-04-13 07:43:00 +02:00
Alexandre Ratchov ea0520142e If no -q options are used, expose first 8 midi(4) devices to sndiod clients 2020-04-02 09:18:44 +02:00
Alexandre Ratchov 3d5dbc6b9f Don't send "control changed" messages when hardware controls are set. 2020-03-31 09:00:39 +02:00
Alexandre Ratchov 420dd67129 Make parse_unit return signed int 2020-03-13 19:24:21 +01:00
Alexandre Ratchov 7d352f5494 Include bsd/bsd.h necessary if --with-libbsd is used 2020-03-13 19:06:18 +01:00