Skip to content

Commit c6cda7f

Browse files
committed
Add JACK sound multiplexer support
1 parent 83d31fb commit c6cda7f

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ jobs:
88
strategy:
99
matrix:
1010
dependency:
11-
- libpulse-dev
1211
- none
12+
- libpulse-dev
13+
- libjack-jackd2-dev
1314
steps:
1415
- name: checkout code
1516
uses: actions/checkout@v4
@@ -19,7 +20,9 @@ jobs:
1920
sudo apt-get install libasound2-dev libudev-dev
2021
- name: install sound multiplexer ${{ matrix.dependency }}
2122
if: matrix.dependency != 'none'
22-
run: sudo apt-get install ${{ matrix.dependency }}
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install ${{ matrix.dependency }}
2326
- name: default build
2427
run: make
2528
shell: bash

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ ifeq ($(call has, VIRTIOSND), 1)
8585
# Check PulseAudio installation
8686
ifeq (0, $(call check-pa))
8787
LDFLAGS += -lpulse
88+
else ifeq (0, $(call check-jack2))
89+
$(warning Detect JACK)
90+
LDFLAGS += -ljack
8891
endif
8992
endif
9093
ifeq ($(UNAME_S),Darwin)

mk/check-libs.mk

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,27 @@ endef
2424
define create-ca-prog
2525
echo '\
2626
#include <CoreAudio/CoreAudio.h>\n\
27-
#include <AudioToolbox/AudioQueue.h>
27+
#include <AudioToolbox/AudioQueue.h>\n\
2828
int main(){\n\
2929
AudioQueueRef queue;\n\
3030
AudioQueueDispose(queue, TRUE);\n\
3131
return 0;\n\
3232
}\n'
3333
endef
3434

35+
# Create a mininal jack2 program
36+
define create-jack2-prog
37+
echo '\
38+
#include <stdlib.h>\n\
39+
#include <jack/jack.h>\n\
40+
int main(){\n\
41+
jack_default_audio_sample_t *signal;\n\
42+
signal = (jack_default_audio_sample_t *)malloc(1024 * sizeof(jack_default_audio_sample_t));\n\
43+
free(signal);\n\
44+
return 0;\n\
45+
}\n'
46+
endef
47+
3548
# Check ALSA installation
3649
define check-alsa
3750
$(shell $(call create-alsa-prog) | $(CC) -x c - -lasound -o /dev/null > /dev/null 2> /dev/null
@@ -48,3 +61,9 @@ define check-coreaudio
4861
$(shell $(call create-ca-prog) | $(CC) -x c - -framework AudioToolbox -o /dev/null > /dev/null 2> /dev/null
4962
&& echo 0 || echo 1)
5063
endef
64+
65+
# Check JACK (formally jack2) installation
66+
define check-jack2
67+
$(shell $(call create-jack2-prog) | $(CC) -x c - -ljack -o /dev/null > /dev/null 2> /dev/null
68+
&& echo 0 || echo 1)
69+
endef

0 commit comments

Comments
 (0)