You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- JACK input backend support
- JACK priority after sndio (and both after pipewire)
- doc: extended documentation in README.md
- fix getPulseDefaultSink compilation warning
@@ -77,11 +78,12 @@ The development lib of one of these audio frameworks, depending on your distro:
77
78
* Pipewire
78
79
* Portaudio
79
80
* Sndio
81
+
* JACK
80
82
81
83
Optional components:
82
84
* SDL2 dev files
83
85
84
-
Only FFTW and the other build tools are actually required for CAVA to compile, but this will only give you the ability to read from fifo files. To more easly grab audio from your system pulseaudio, alsa, sndioor portaudio dev files are recommended (depending on what audio system you are using). Not sure how to get the pulseaudio dev files for other distros than debian/ubuntu or if they are bundled in pulseaudio.
86
+
Only FFTW and the other build tools are actually required for CAVA to compile, but this will only give you the ability to read from fifo files. To more easly grab audio from your system pulseaudio, alsa, sndio, jack or portaudio dev files are recommended (depending on what audio system you are using). Not sure how to get the pulseaudio dev files for other distros than debian/ubuntu or if they are bundled in pulseaudio.
85
87
86
88
87
89
For better a better visual experience ncurses is also recomended.
@@ -90,11 +92,17 @@ All the requirements can be installed easily in all major distros:
The system has three `pcm` sound devices, `pcm0`, `pcm1` and `pcm2`. `pcm0` corresponds to the analog
356
366
output jack on the rear, in which external stereo speakers are plugged in, and the analog input jack,
357
367
in which one could plug in a microphone. Because it encapsulates both, output and input, it is marked
358
368
as `play/rec`. It is also set as the `default` sound device. `pcm1` corresponds to another analog input
359
-
jack for a mic on the front side and is marked `rec`. A USB headset which an integrated mic is plugged
369
+
jack for a mic on the front side and is marked `rec`. A USB headset with an integrated mic is plugged
360
370
in an USB port and the system has created the `pcm2` sound device with `play/rec` capabilities for
361
371
it.
362
372
@@ -367,20 +377,17 @@ which acts like a symlink to the `default` audio device, in this example to `/de
367
377
368
378
Now in order to visualize the mic input in CAVA, the `source` value in the configuration file must
369
379
be set to the corresponding audio device, i.e.
370
-
```sh
371
-
[input]
372
-
source = /dev/dsp # or /dev/dsp0 for which /dev/dsp is a symlink in this example
373
-
```
380
+
381
+
source = /dev/dsp # or /dev/dsp0 for which /dev/dsp is a symlink in this example
382
+
374
383
(which is already the default for CAVA) for the `pcm0` mic on the rear, or
375
-
```sh
376
-
[input]
377
-
source = /dev/dsp1
378
-
```
384
+
385
+
source = /dev/dsp1
386
+
379
387
for the `pcm1` mic on the front, or
380
-
```sh
381
-
[input]
382
-
source = /dev/dsp2
383
-
```
388
+
389
+
source = /dev/dsp2
390
+
384
391
for the `pcm2` mic on the USB headset.
385
392
386
393
OSS can't record the outgoing audio on its own, i.e. the sounds from a music player or a browser which
@@ -403,6 +410,83 @@ It created a virtual device `dsp` from `/dev/dsp0`. Now the audio is visualized
403
410
`source = /dev/dsp` in the configuration file. Virtual OSS can be configured and started as a service
404
411
on FreeBSD.
405
412
413
+
### JACK
414
+
415
+
Set
416
+
417
+
method = jack
418
+
419
+
The JACK Audio Connection Kit (JACK) is a professional sound server API which is available on several
420
+
operating systems, e.g. FreeBSD and Linux.
421
+
422
+
CAVA is a JACK client with the base client name `cava` and adheres to the standard server start and
423
+
stop behaviour, i.e. CAVA starts a JACK server if none is already running and the environment variable
424
+
`JACK_START_SERVER` is defined, in which case the server also stops when all clients have exited. The
425
+
`source` in the CAVA configuration file specifies the name of the JACK server to which CAVA tries to
426
+
connect to. The default value is `default`, which is also the default JACK server name. The value can
427
+
be empty, in which case it implies `default`. Therefore the following three entries are equivalent:
428
+
429
+
; source = default
430
+
source = default
431
+
source =
432
+
433
+
One exception is the combination of an empty `source` entry and the environment variable `JACK_DEFAULT_SERVER`.
434
+
If the environment variable is defined, e.g. `export JACK_DEFAULT_SERVER=foo`, then the following entries
435
+
are equivalent:
436
+
437
+
source = foo
438
+
source =
439
+
440
+
Consult the manpage `jackd(1)` for further information regarding configuration and startup of a JACK
441
+
server.
442
+
443
+
CAVA creates terminal audio-typed (so no MIDI support) input ports. These ports can connect to output
444
+
ports of other JACK clients, e.g. connect to the output ports of a music player and CAVA will visualize
445
+
the music. Currently CAVA supports up to two input ports, i.e. it supports mono and stereo. The number
446
+
of input ports can be controlled via the `channels` option in the input section of the configuration
447
+
file:
448
+
449
+
channels = 1 # one input port, mono
450
+
451
+
or
452
+
453
+
channels = 2 # two input ports, stereo
454
+
455
+
The port's short name is simply `M` for mono, and `L` and `R` for stereo. The full name of the input
456
+
port according to the base client name is `cava:M` for mono, and `cava:L` and `cava:R` for stereo.
457
+
458
+
Currently CAVA doesn't connect its ports to other client's ports automatically, i.e. on program start
459
+
CAVA isn't connected to any other program and won't connect during execution on its own. There are
460
+
connection management programs in order to control and manage the connection between ports of the different
461
+
client programs. Some well known connection managers with a graphical user interface include QjackCtl
462
+
and Cadence. The JACK package itself often comes with CLI tools. Depending on the operating system
463
+
they might need to get installed separately, e.g. on FreeBSD
464
+
```sh
465
+
$ doas pkg install jack-example-tools
466
+
```
467
+
Among the tools are the programs `jack_lsp` and `jack_connect`. These two tools are enough to list
468
+
and connect ports on the commandline. The following example demonstrates how to setup connections with
469
+
these tools:
470
+
```sh
471
+
$ jack_lsp
472
+
system:capture_1
473
+
system:capture_2
474
+
system:playback_1
475
+
system:playback_2
476
+
cava:L
477
+
moc:output0
478
+
moc:output1
479
+
cava:R
480
+
```
481
+
This listing shows all full port names that are currently available. These correspond to two external
482
+
JACK clients (cava and moc) and one internal JACK client (system). There are also `-p` and `-c` switches
483
+
for `jack_lsp`, with which the types and current connections between the ports are listed. Connect
484
+
the ports of cava and moc:
485
+
```sh
486
+
$ jack_connect cava:L moc:output0
487
+
$ jack_connect cava:R moc:output1
488
+
```
489
+
Now CAVA visualizes the outgoing audio from MOC.
406
490
407
491
### squeezelite
408
492
[squeezelite](https://en.wikipedia.org/wiki/Squeezelite) is one of several software clients available for the Logitech Media Server. Squeezelite can export its audio data as shared memory, which is what this input module uses.
0 commit comments