Skip to content

Commit 527e5dc

Browse files
committed
Remove macos support
1 parent 3321e36 commit 527e5dc

File tree

3 files changed

+2
-42
lines changed

3 files changed

+2
-42
lines changed

Makefile

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ endif
5555

5656
# virtio-snd
5757
ENABLE_VIRTIOSND ?= 1
58-
ifneq ($(UNAME_S),$(filter $(UNAME_S),Linux Darwin))
58+
ifneq ($(UNAME_S),$(filter $(UNAME_S),Linux))
5959
ENABLE_VIRTIOSND := 0
6060
endif
6161

@@ -66,22 +66,11 @@ ifeq ($(UNAME_S),Linux)
6666
ENABLE_VIRTIOSND := 0
6767
endif
6868
endif
69-
# Check core audio installation
70-
ifeq ($(UNAME_S),Darwin)
71-
ifeq (0, $(call check-coreaudio))
72-
$(warning No CoreAudio framework installed.)
73-
ENABLE_VIRTIOSND := 0
74-
endif
75-
endif
7669
$(call set-feature, VIRTIOSND)
7770
ifeq ($(call has, VIRTIOSND), 1)
7871
OBJS_EXTRA += virtio-snd.o
7972

80-
ifeq ($(UNAME_S),Linux)
81-
LDFLAGS += -lasound -lpthread
82-
else ifeq ($(UNAME_S),Darwin)
83-
LDFLAGS += -framework AudioToolbox -lpthread
84-
endif
73+
LDFLAGS += -lasound -lpthread
8574
CFLAGS += -Icnfa
8675

8776
cnfa/Makefile:

mk/check-libs.mk

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,8 @@ int main(){\n\
1010
}\n'
1111
endef
1212

13-
# Create a mininal Core Audio program
14-
define create-coreaudio-prog
15-
echo '\
16-
#include <CoreAudio/CoreAudio.h>\n\
17-
int main(){\n\
18-
AudioComponent comp;\n\
19-
comp = AudioComponentFindNext(NULL, &desc);\n\
20-
if (comp == NULL) exit (-1);\n\
21-
return 0;\n\
22-
}\n'
23-
endef
24-
2513
# Check ALSA installation
2614
define check-alsa
2715
$(shell $(call create-alsa-prog) | $(CC) -x c -lasound -o /dev/null > /dev/null 2> /dev/null -
2816
&& echo $$?)
2917
endef
30-
31-
# Check Core Audio installation
32-
define check-coreaudio
33-
$(shell $(call create-coreaudio-prog) | $(CC) -x c -framework CoreAudio -o /dev/null > /dev/null 2> /dev/null -
34-
&& echo $$?)
35-
endef

virtio-snd.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,6 @@ static void virtio_snd_read_pcm_prepare(const virtio_snd_pcm_hdr_t *query,
537537
static void virtio_snd_read_pcm_start(const virtio_snd_pcm_hdr_t *query,
538538
uint32_t *plen)
539539
{
540-
fprintf(stderr, "pcm_start start\n");
541540
const virtio_snd_pcm_hdr_t *request = query;
542541
uint32_t stream_id = request->stream_id;
543542
uint32_t code = vsnd_props[stream_id].pp.hdr.hdr.code;
@@ -557,13 +556,11 @@ static void virtio_snd_read_pcm_start(const virtio_snd_pcm_hdr_t *query,
557556
pthread_cond_signal(&props->v.ctrl_cond);
558557

559558
*plen = 0;
560-
fprintf(stderr, "pcm_start stop\n");
561559
}
562560

563561
static void virtio_snd_read_pcm_stop(const virtio_snd_pcm_hdr_t *query,
564562
uint32_t *plen)
565563
{
566-
fprintf(stderr, "pcm_stop start\n");
567564
const virtio_snd_pcm_hdr_t *request = query;
568565
uint32_t stream_id = request->stream_id;
569566
uint32_t code = vsnd_props[stream_id].pp.hdr.hdr.code;
@@ -582,13 +579,11 @@ static void virtio_snd_read_pcm_stop(const virtio_snd_pcm_hdr_t *query,
582579
pthread_cond_signal(&props->v.ctrl_cond);
583580

584581
*plen = 0;
585-
fprintf(stderr, "pcm_stop stop\n");
586582
}
587583

588584
static void virtio_snd_read_pcm_release(const virtio_snd_pcm_hdr_t *query,
589585
uint32_t *plen)
590586
{
591-
fprintf(stderr, "pcm_release start\n");
592587
const virtio_snd_pcm_hdr_t *request = query;
593588
uint32_t stream_id = request->stream_id;
594589
virtio_snd_prop_t *props = &vsnd_props[stream_id];
@@ -604,21 +599,16 @@ static void virtio_snd_read_pcm_release(const virtio_snd_pcm_hdr_t *query,
604599
props->pp.hdr.hdr.code = VIRTIO_SND_R_PCM_RELEASE;
605600

606601
/* Tear down PCM buffer related locking attributes. */
607-
fprintf(stderr, "pcm_release tear down PCM buffer start\n");
608602
free(props->intermediate);
609-
610603
/* Explicitly unlock the CVs and mutex. */
611604
pthread_cond_broadcast(&props->lock.readable);
612605
pthread_cond_broadcast(&props->lock.writable);
613606
pthread_mutex_unlock(&props->lock.lock);
614-
615607
pthread_mutex_destroy(&props->lock.lock);
616608
pthread_cond_destroy(&props->lock.readable);
617609
pthread_cond_destroy(&props->lock.writable);
618-
fprintf(stderr, "pcm_release tear down PCM buffer stop\n");
619610

620611
/* Tear down PCM buffer queue. */
621-
fprintf(stderr, "pcm_release tear down PCM buffer queue\n");
622612
vsnd_buf_queue_node_t *tmp = NULL;
623613
vsnd_buf_queue_node_t *node;
624614
if (!list_empty(&props->buf_queue_head)) {
@@ -639,7 +629,6 @@ static void virtio_snd_read_pcm_release(const virtio_snd_pcm_hdr_t *query,
639629
pthread_cond_destroy(&props->v.ctrl_cond);
640630

641631
*plen = 0;
642-
fprintf(stderr, "pcm_release stop\n");
643632
}
644633

645634
static void __virtio_snd_frame_dequeue(short *out,

0 commit comments

Comments
 (0)