1
0
mirror of https://github.com/ericonr/sndio.git synced 2024-02-18 04:45:21 -06:00
Commit Graph

1071 Commits

Author SHA1 Message Date
Alexandre Ratchov
441100e812 Allow switching between devices without disconnecting clients, again.
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.

ok mpi@
2019-09-21 06:53:34 +02:00
Alexandre Ratchov
3935da37f6 Setup channel join/expand after channle mapping conversions.
The channel mapping conversion calculate the number of channels
actually present on the hardware. This allows to join/expand the right
number of channels.
2019-09-19 09:08:29 +02:00
Alexandre Ratchov
e922c66fc0 Don't set to NULL conversion buffers when initializing the slot.
Bug introduced when conversions setup moved to its own routine.
2019-09-18 15:56:08 +02:00
Alexandre Ratchov
7cd9c4b0a9 Don't attempt to join/expand nonexistent channels.
If the (hardware) device has fewer channels than the exposed
sub-device and -jon is used, then mix the samples only to channels
that exist on the device.
2019-09-18 09:36:33 +02:00
Alexandre Ratchov
5e033425c0 Move slot convertions setup in its own routine. 2019-09-18 09:34:59 +02:00
Alexandre Ratchov
cf94ce9ae8 Move device buffer allocation to its own routines.
This makes the code more readable as device and slot buffer allocation
routines are similar. No behavior change.
2019-09-18 09:30:00 +02:00
Alexandre Ratchov
0310ad45e9 Revert "Allow switching between devices without disconnecting clients."
This change was not right: First, upon SIGHUP, next device should be
opened before the old one is closed. Second the migration code doesn't
reinitialize the conversion layer which breaks audio when switching
between devices with different channel counts.

This reverts commit 5bc17e6cea.
2019-09-18 09:16:58 +02:00
Alexandre Ratchov
fd85070098 Merge branch 'master' into mixer 2019-09-05 21:31:35 +02:00
Alexandre Ratchov
e453b782d1 Merge branch 'master' of ssh://moule/~alex/git/sndio 2019-09-05 09:05:37 +02:00
Alexandre Ratchov
6918eaa94e Remove unused #include <sys/signal> 2019-09-05 09:05:33 +02: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
Alexandre Ratchov
aceffe4729 siomix_sun: poll the mixer fd to detect when device is gone.
This doesn't work yet, as the audio(4) driver doesn't properly
wakeup processes waiting in the poll syscall, see audio_detach()
2019-08-30 17:02:54 +02:00
Alexandre Ratchov
aefc78f715 sndiod: properly transmit deleted controls. 2019-08-30 16:53:41 +02:00
Alexandre Ratchov
efeed79b56 Don't try to add deleted controls (aka SIOMIX_NONE). 2019-08-30 16:45:19 +02:00
Alexandre Ratchov
f92eed1da9 Add SIOMIX_NONE control, to represent deleted controls. 2019-08-30 16:43:35 +02:00
Alexandre Ratchov
a4ac7781fd Add audio controls in dev_open(), not dev_open_do() 2019-08-30 15:35:29 +02:00
Alexandre Ratchov
e15f9cc366 Kick ctl clients when device is closed 2019-08-30 15:06:38 +02:00
Alexandre Ratchov
f73fd84ddf Add struct ctlops, and use it instead of the "inuse" flag. 2019-08-30 15:00:43 +02:00
Alexandre Ratchov
ac4e742089 Don't call dev_siomix_close() twice. 2019-08-30 10:12:55 +02:00
Alexandre Ratchov
e2e5298b26 Call dev_siomix_{open,close} from dev_sio_{open,close} 2019-08-30 10:01:29 +02:00
Alexandre Ratchov
4453acee80 Merge branch 'master' into mixer 2019-08-30 08:47:09 +02:00
Alexandre Ratchov
5bc17e6cea 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.
2019-08-29 14:24:05 +02:00
Alexandre Ratchov
58f116481d Split dev_close() routine in two parts.
The first part disconnects clients, the other closes the device
and frees audio buffers. No behavior change.
2019-08-29 09:36:57 +02:00
Alexandre Ratchov
803cf23380 Split dev_open() in two parts.
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-29 09:25:59 +02:00
Alexandre Ratchov
6a68d29389 Add missing prototypes. 2019-08-29 09:18:24 +02:00
Alexandre Ratchov
eee6a97114 Tweak debug printf in port_open() 2019-08-29 09:14:27 +02:00
Alexandre Ratchov
6ee8e730f4 Move code to disconnect all MIDI clients to its own routine. 2019-08-27 15:06:18 +02:00
Alexandre Ratchov
db1e20ae8f Fix comment about midi port hold flag. 2019-08-27 14:10:28 +02:00
Alexandre Ratchov
7933511f57 Move code to disconnect all clients to its own routine. 2019-08-27 10:21:12 +02:00
Alexandre Ratchov
9f85e83893 Uniformize device-specific debug printfs. 2019-08-27 10:19:23 +02:00
Alexandre Ratchov
4f5ac3cdb6 Merge branch 'master' into mixer 2019-07-28 11:27:10 +02:00
Alexandre Ratchov
436f0dbfff Fix builds with no DEBUG defined. 2019-07-28 11:26:51 +02:00
Alexandre Ratchov
50ccf31dd8 Crank max number of channels to 64. 2019-07-28 11:23:56 +02:00
Alexandre Ratchov
939300b1bb Merge branch 'master' into mixer 2019-07-12 08:31:01 +02:00
Alexandre Ratchov
285eafeec0 Add affinity between the program and its mixer control.
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-12 08:31:01 +02:00
Alexandre Ratchov
93ffa39ea2 Remove few level 3 debug printfs related to slot allocation. 2019-07-11 12:55:18 +02:00
Alexandre Ratchov
d2985fff2b Replace the "umap" bitmap by a simple table of slot pointers.
Makes the code simpler at virtually no cost since we need 8 entries
only. No behavior change.
2019-07-11 12:54:38 +02:00
Alexandre Ratchov
e6579625a0 Swap "if" and "else" code blocks in slot_new() to improve readability.
No behavior change.
2019-07-11 12:54:26 +02:00
Alexandre Ratchov
e21b26a56f Slot name can't be empty. So, no need to check if it empty. 2019-07-11 12:54:05 +02:00
Alexandre Ratchov
505722ac5d Use NULL instead of 0 where a pointer is expected. 2019-07-11 12:53:46 +02:00
Alexandre Ratchov
7e15b80ed3 Add forgottend copyright notice. 2019-07-06 00:34:06 +02:00
Alexandre Ratchov
c5f6aacfcb Use 4 spaces for indentation after "if". 2019-07-05 09:37:31 +02:00
Alexandre Ratchov
98d4c00b6a Fix comments and few debug printfs in utils.c. 2019-07-02 08:09:31 +02:00
Alexandre Ratchov
cbdd29c403 alsa: use (blksz - round) as start threshold.
The threshold making poll() return POLLOUT is one block (according to
alsa library sources). If a poll-based program writes blksz - 1
samples, playback never starts but poll won't return POLLOUT either.
In turn the program deadlocks. The problem could be observed in the
sio_alsa_xrun() routine.
2019-07-01 17:12:00 +02:00
Alexandre Ratchov
f9c0bed6d9 Check return values of syscalls against -1 in OSS code 2019-07-01 17:10:55 +02:00
Alexandre Ratchov
9e13d35c30 Merge branch 'master' into mixer 2019-07-01 09:24:43 +02:00
Alexandre Ratchov
42a25f2ca4 Factor audio buffer allocation into a dedicated allocbuf routine. 2019-07-01 09:20:33 +02:00
Alexandre Ratchov
934e1611e8 Check return values of syscalls against -1, from deraadt@. 2019-07-01 09:20:22 +02:00
Alexandre Ratchov
74abe4dcc7 Ignore sub-frames component in MMC relocate message. 2019-06-16 15:37:15 +02:00
Alexandre Ratchov
63505015b8 Merge branch 'master' into mixer 2019-05-17 14:29:23 +02:00