OpenBSD CVS

CVS log for src/usr.bin/sndiod/midi.c


[BACK] Up to [local] / src / usr.bin / sndiod

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.31 / (download) - annotate - [select for diffs], Sun May 19 00:05:43 2024 UTC (7 hours, 38 minutes ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.30: +1 -2 lines
Diff to previous 1.30 (colored)

remove prototypes with no matching function; ok ratchov@

Revision 1.30 / (download) - annotate - [select for diffs], Fri May 3 05:18:09 2024 UTC (2 weeks, 2 days ago) by ratchov
Branch: MAIN
Changes since 1.29: +18 -1 lines
Diff to previous 1.29 (colored)

sndiod: Fix SIGHUP to reopen the devices in priority order

With this commit, SIGHUP makes sndiod discover new devices and if
there is a new device with higher priority (greater -F option number)
than the current one, sndiod switches to it.  If the current device is
already the one with the highest priority (i.e. last -F), then SIGHUP
does nothing.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Nov 1 14:43:25 2021 UTC (2 years, 6 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.28: +108 -21 lines
Diff to previous 1.28 (colored)

Stop binding audio devices exposed by sndiod to physical devices

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

Revision 1.28 / (download) - annotate - [select for diffs], Mon Mar 8 09:42:50 2021 UTC (3 years, 2 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.27: +6 -4 lines
Diff to previous 1.27 (colored)

sndiod: Use chronological order for {dev,port}_list

This simplifies the logic of the initialization code, makes debug
printfs nicer and could slightly ease futur development.

No behavior change.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Jan 28 11:17:58 2021 UTC (3 years, 3 months ago) by ratchov
Branch: MAIN
Changes since 1.26: +17 -18 lines
Diff to previous 1.26 (colored)

When an audio device is disconnected, drop MIDI clients controlling it

Revision 1.26 / (download) - annotate - [select for diffs], Tue Jan 12 15:46:53 2021 UTC (3 years, 4 months ago) by naddy
Branch: MAIN
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

const-ify lookup tables; ok ratchov@

Revision 1.25 / (download) - annotate - [select for diffs], Fri Jun 12 15:40:18 2020 UTC (3 years, 11 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.24: +5 -4 lines
Diff to previous 1.24 (colored)

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.

Revision 1.24 / (download) - annotate - [select for diffs], Sat Apr 25 05:03:54 2020 UTC (4 years ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.23: +20 -1 lines
Diff to previous 1.23 (colored)

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.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jan 23 05:27:17 2020 UTC (4 years, 3 months ago) by ratchov
Branch: MAIN
Changes since 1.22: +15 -3 lines
Diff to previous 1.22 (colored)

Accept MIDI clients that don't reset status during sysex messages.

The MIDI protocol requires the status byte to be resent after common
messages, including system exclusive messages. But, some MIDI clients
forget to resend it; we workaround this restoring the status byte
after sysex messages.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Sep 21 04:42:46 2019 UTC (4 years, 7 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.21: +16 -3 lines
Diff to previous 1.21 (colored)

Allow switching between devices without disconnecting clients.

The new -F option allows alternate device to be specified.  If the
device is disconnected, the one given with the last -f or -F options
will be used instead. Similarly, the new -Q option allows an alternate
MIDI port to be specified.

ok mpi@

Revision 1.21 / (download) - annotate - [select for diffs], Thu Aug 29 07:19:15 2019 UTC (4 years, 8 months ago) by ratchov
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

Make debug printf in port_open() look as others

Revision 1.20 / (download) - annotate - [select for diffs], Thu Aug 29 07:10:27 2019 UTC (4 years, 8 months ago) by ratchov
Branch: MAIN
Changes since 1.19: +17 -9 lines
Diff to previous 1.19 (colored)

Move code de disconnect all MIDI clients to its own routine.

This makes the routine reusable, no behavior change.

Revision 1.19 / (download) - annotate - [select for diffs], Fri May 10 04:45:47 2019 UTC (5 years ago) by ratchov
Branch: MAIN
Changes since 1.18: +2 -3 lines
Diff to previous 1.18 (colored)

Backout latest, commited by mistake.

Revision 1.18 / (download) - annotate - [select for diffs], Fri May 10 04:40:16 2019 UTC (5 years ago) by ratchov
Branch: MAIN
Changes since 1.17: +3 -2 lines
Diff to previous 1.17 (colored)

Use the correct length for MIDI common messages.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Mar 28 11:18:56 2019 UTC (5 years, 1 month ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.16: +11 -1 lines
Diff to previous 1.16 (colored)

Don't send MIDI-related flow control messages until at least
half of the client buffer space is consumed. This avoids sending
unnecessary/redundant messages on the network.

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jan 3 06:53:20 2017 UTC (7 years, 4 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Many typos in comments. From Michael W. Bombardieri. Thanks.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Jan 8 16:17:31 2016 UTC (8 years, 4 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.14: +5 -5 lines
Diff to previous 1.14 (colored)

Make code fit in 80 columns, remove trailing spaces & tabs.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Nov 25 18:47:12 2015 UTC (8 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.13: +3 -2 lines
Diff to previous 1.13 (colored)

Allocate device names in the heap, so they can be generated.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Nov 23 18:16:41 2015 UTC (8 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.12: +1 -3 lines
Diff to previous 1.12 (colored)

define port_log even without -DDEBUG

Revision 1.12 / (download) - annotate - [select for diffs], Mon Nov 23 09:48:25 2015 UTC (8 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.11: +5 -7 lines
Diff to previous 1.11 (colored)

Insert new ports at the head of the list and stop assuming its
ordered.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Nov 22 16:42:22 2015 UTC (8 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

save port number if port structure

Revision 1.10 / (download) - annotate - [select for diffs], Sat Sep 28 18:49:32 2013 UTC (10 years, 7 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.9: +3 -24 lines
Diff to previous 1.9 (colored)

Fix condition to check if a midi port is referenced. Remove unused bits.

Revision 1.9 / (download) - annotate - [select for diffs], Sun May 12 05:02:08 2013 UTC (11 years ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.8: +6 -4 lines
Diff to previous 1.8 (colored)

use -q options order as order of exposed midi ports

Revision 1.8 / (download) - annotate - [select for diffs], Sun May 12 05:00:14 2013 UTC (11 years ago) by ratchov
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

Fix reversed condition to check if a midi port is referenced,
causing sometimes the port to be closed prematurely

Revision 1.7 / (download) - annotate - [select for diffs], Thu Dec 20 16:15:55 2012 UTC (11 years, 5 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.6: +2 -1 lines
Diff to previous 1.6 (colored)

readjust midi flow control after consuming input data

Revision 1.6 / (download) - annotate - [select for diffs], Sat Dec 1 12:13:34 2012 UTC (11 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.5: +2 -9 lines
Diff to previous 1.5 (colored)

remove misleading XXXs and TODOs

Revision 1.5 / (download) - annotate - [select for diffs], Fri Nov 30 22:26:34 2012 UTC (11 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.4: +22 -5 lines
Diff to previous 1.4 (colored)

drain midi port output buffer before closing it ensuring the last
few bytes are not lost

Revision 1.4 / (download) - annotate - [select for diffs], Fri Nov 30 21:04:35 2012 UTC (11 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.3: +7 -4 lines
Diff to previous 1.3 (colored)

use the hold flag for midi ports as well

Revision 1.3 / (download) - annotate - [select for diffs], Fri Nov 30 20:48:00 2012 UTC (11 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.2: +45 -3 lines
Diff to previous 1.2 (colored)

For MIDI ports, use the same open/close logic as for audio devices:
drop clients using it when the port is closed (eg. umidi disconnected)
and try to reopen it whenever a new client connects.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Nov 30 20:30:24 2012 UTC (11 years, 5 months ago) by ratchov
Branch: MAIN
Changes since 1.1: +107 -111 lines
Diff to previous 1.1 (colored)

Process incoming MIDI data on the fly rather than using an
input fifo; besides being simpler, this way there's no data
to drain when a connection is dropped.

Revision 1.1 / (download) - annotate - [select for diffs], Fri Nov 23 07:03:28 2012 UTC (11 years, 5 months ago) by ratchov
Branch: MAIN

Remplace aucat server by a new sndiod daemon aimed to be simpler
smaller and faster than aucat. It's a drop in replacement with the
following exceptions that don't affect the default setup:
  - The sample rate and the encoding are a per-device parameters
    thus -r and -e options must precede the corresponding -f option
  - MIDI thru boxes are dynamically created and no -M option
    is required anymore, so -M was removed.
  - MIDI ports are exposed with a new ``midi/N'' name, rather
    than abusing MIDI thru boxes.
with help from armani@, ok deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.