summaryrefslogtreecommitdiff
path: root/usr.bin/sndiod
AgeCommit message (Collapse)Author
2020-01-23Remove unused sys/signal.h include.Alexandre Ratchov
2020-01-23When opening a device, loop over the alternate devices list in theAlexandre Ratchov
worker process instead of the helper process. It is simpler this way and allows the worker to properly log which device is being used.
2020-01-23Accept MIDI clients that don't reset status during sysex messages.Alexandre Ratchov
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.
2020-01-10Unbreak channel duplication (aka -j option).Alexandre Ratchov
Fix from Peter Piwowarski <peterjpiwowarski at gmail.com> with few tweaks from me. Thanks.
2019-11-27Initialize nfds fields of new file structures.Alexandre Ratchov
Fixes a possible crash when a new file structure is added in the time-out processing code-path.
2019-09-21tweak previous;Jason McIntyre
2019-09-21Fix missing word in -F and -Q descriptions.Alexandre Ratchov
2019-09-21Lower the default audio block size from 20ms to 10ms.Alexandre Ratchov
Then new default block size is supported by virtually all devices which allows switching between devices without further configuration. The buffer size remains the same, so this change won't affect audio stability. ok mpi@
2019-09-21Allow switching between devices without disconnecting clients.Alexandre Ratchov
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@
2019-09-19Don't attempt to join/expand nonexistent channels.Alexandre Ratchov
If the (hardware) device has fewer channels than the exposed sub-device, then join/expand only to channels that exist on the device.
2019-09-19Move device slot convertions setup in its own routine.Alexandre Ratchov
No behabior change.
2019-09-19Move device buffer allocation to its own routines.Alexandre Ratchov
This makes the code more readable and the routine available for other uses. No behavior change.
2019-08-29Split dev_close() routine in two parts.Alexandre Ratchov
The first part disconnects clients, the other closes the device and frees audio buffers. No behavior change.
2019-08-29Split dev_open() in two parts.Alexandre Ratchov
The first part resets audio parameters to the prefered ones, the second part opens the device and allocates the audio buffers. No behavior change.
2019-08-29Make debug printf in port_open() look as othersAlexandre Ratchov
2019-08-29Fix wrong comment about MIDI port hold flagAlexandre Ratchov
2019-08-29Move code de disconnect all MIDI clients to its own routine.Alexandre Ratchov
This makes the routine reusable, no behavior change.
2019-08-29Move code de disconnect all audio clients to its own routine.Alexandre Ratchov
This makes the routine reusable, no behavior change.
2019-08-29Uniformize device-specific debug printfsAlexandre Ratchov
2019-07-2816 channels is not enough to handle all common uaudio(4) devices, soAlexandre Ratchov
crank the maximum channels number to 64.
2019-07-12Add affinity between the program and its mixer control.Alexandre Ratchov
Currently, if there are two instances of the same program, sndiod will allocate one volume control to each. If both programs disconnect and reconnect, the information of which control is assigned to which program is lost. This makes difficult to run two instances of a player and crossfade between each other with a MIDI controller. To address this, the program chooses a 32-bit "id" (for now the process pid) and sends it to the server. The server records the id in the client's slot structure. When the server accepts a new connection, it uses the id to identify the slot the client used during the previous connection; if it was not recycled yet, it's assigned to the program.
2019-07-10Remove few level 3 debug printfs related to slot allocation.Alexandre Ratchov
2019-07-10Replace the "umap" bitmap by a simple table of slot pointers.Alexandre Ratchov
Makes the code simpler at virtually no cost since we need 8 entries only. No behavior change.
2019-07-10Swap "if" and "else" code blocks in slot_new() to improve readability.Alexandre Ratchov
No behavior change.
2019-07-10Slot name can't be empty. So, no need to check if it is empty.Alexandre Ratchov
2019-07-10Use NULL instead of 0 where a pointer is expected.Alexandre Ratchov
2019-07-05Fix spacing and comments, no code change.Alexandre Ratchov
2019-06-29Check if syscalls return -1 instead of any negative or non-zero value.Alexandre Ratchov
ok deraadt
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-06-16Ignore the frame cents component in MMC relocate message.Alexandre Ratchov
As MTC requires new position to be transmitted with one frame precision and then to advance in quarter-frame steps, its not necessary to pollute out mtc position pointer with a frame cents information, care about rounding errors and so on.
2019-06-16Say in comment why we use 1/2400 second as MTC time unit.Alexandre Ratchov
2019-05-10Backout latest, commited by mistake.Alexandre Ratchov
2019-05-10Use the correct length for MIDI common messages.Alexandre Ratchov
2019-05-10Don't try to send to device helper process if it's terminated.Alexandre Ratchov
2019-03-28Don't send MIDI-related flow control messages until at leastAlexandre Ratchov
half of the client buffer space is consumed. This avoids sending unnecessary/redundant messages on the network.
2018-09-18i forgot to sync sndiod with aucat/dsp.c rev 1.12miko
2018-08-08Use unveil(2) in the helper process to disallow access to other filesAlexandre Ratchov
than the devices specified with -f and -q options. ok deraadt@
2018-06-26Initialize the slot->skip counter in slot_start() instead ofAlexandre Ratchov
slot_attach(). Now this makes no difference, because slot_attach() is always called right after slot_start(). However this will allow us to call slot_{attach,detach}() routines, while preserving the state of the slot.
2018-06-26Remove redundant slot->tstate variable.Alexandre Ratchov
It was used to determine whether the slot obeys MMC and is ready to start. The stop->opt->mmc flag indicates if it obeys MMC and the slot->pstate == SLOT_READY indicates if it's ready. So slot->tstate can be safely removed.
2018-06-26Remove useless check if s->ops == NULL from slot_setvol().Alexandre Ratchov
2018-06-26No need to initialize slot->mix.weight as it's recalculated andAlexandre Ratchov
overwritten in dev_mix_adjvol(), which is always called.
2018-06-26Move slot-related debug printfs from sock_hello() to slot_new().Alexandre Ratchov
2018-06-26Convert all the slot_xxx() routines to use the number of channelsAlexandre Ratchov
instead of the maximum channel number. This way the code is simpler. No behaviour change.
2018-06-26Remove {mix,sub}.slot_cmin fields from the slot structure, as the sameAlexandre Ratchov
information is already available in the opt structure.
2018-06-26Remove dev_{cmin,cmax} from the slot structure as the same informationAlexandre Ratchov
is available in the opt structure.
2018-06-26Remove slot->dup which is a copy of opt->dup, and just use the latterAlexandre Ratchov
everywhere.
2018-06-26Remove slot->maxweight, because it's a copy of opt->maxweight. JustAlexandre Ratchov
use the latter everywhere.
2018-06-26Don't set slot's {slot,dev}_cmin parameters in slot_setpar() routine,Alexandre Ratchov
as their value doesn't change once the slot is initialized.
2018-06-26Initialize slot with parameters from the opt struct.Alexandre Ratchov
2018-06-26Move opt pointer from the sock to the slot struct.Alexandre Ratchov