Skip to content

Commit 2b1009d

Browse files
committed
Enable ALSA debug in kernel
Now gets "virtio_snd: probe of virtio2 failed with error -2" in dmesg.
1 parent 78e0011 commit 2b1009d

File tree

9 files changed

+1210
-1712
lines changed

9 files changed

+1210
-1712
lines changed

Makefile

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ include mk/common.mk
22

33
CC ?= gcc
44
CFLAGS := -O2 -g -Wall -Wextra
5-
CFLAGS += -include common.h
5+
CFLAGS += -include common.h -I./cnfa
66

77
# clock frequency
88
CLOCK_FREQ ?= 65000000
@@ -13,6 +13,8 @@ OBJS_EXTRA :=
1313
# command line option
1414
OPTS :=
1515

16+
LDFLAGS :=
17+
1618
# virtio-blk
1719
ENABLE_VIRTIOBLK ?= 1
1820
$(call set-feature, VIRTIOBLK)
@@ -41,8 +43,20 @@ ifeq ($(call has, VIRTIONET), 1)
4143
OBJS_EXTRA += virtio-net.o
4244
endif
4345

46+
# virtio-snd
47+
ENABLE_VIRTIOSND ?= 1
48+
ifneq ($(UNAME_S),Linux)
49+
ENABLE_VIRTIOSND := 0
50+
endif
51+
$(call set-feature, VIRTIOSND)
52+
ifeq ($(call has, VIRTIOSND), 1)
53+
OBJS_EXTRA += virtio-snd.o
54+
LDFLAGS += -lasound
55+
CFLAGS += -I/usr/local/include
56+
endif
57+
4458
BIN = semu
45-
all: $(BIN) minimal.dtb
59+
all: cnfa_dep $(BIN) minimal.dtb
4660

4761
OBJS := \
4862
riscv.o \
@@ -56,6 +70,11 @@ OBJS := \
5670

5771
deps := $(OBJS:%.o=.%.o.d)
5872

73+
cnfa_dep:
74+
rm cnfa/CNFA_sf.h
75+
make -C cnfa os_generic.h
76+
make -C cnfa CNFA_sf.h
77+
5978
$(BIN): $(OBJS)
6079
$(VECHO) " LD\t$@\n"
6180
$(Q)$(CC) -o $@ $^ $(LDFLAGS)

configs/buildroot.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ BR2_RELRO_NONE=y
3636
# BR2_RELRO_PARTIAL is not set
3737
# BR2_RELRO_FULL is not set
3838
BR2_FORTIFY_SOURCE_1=y
39+
BR2_PACKAGE_ALSA_UTILS=y
40+
BR2_PACKAGE_ALSA_UTILS_APLAY=y
41+
BR2_PACKAGE_ALSA_UTILS_SPEAKER_TEST=y
3942
# BR2_PACKAGE_URANDOM_SCRIPTS is not set
4043
BR2_TARGET_ROOTFS_CPIO=y
4144
BR2_TARGET_ROOTFS_CPIO_FULL=y

0 commit comments

Comments
 (0)