d569a230f7535a2dd24f08c2d3322bf00b6f8f84
[AGL/meta-agl-devel.git] / meta-pipewire / recipes-multimedia / wireplumber / wireplumber-board-config-agl_git.bb
1 SUMMARY     = "AGL configuration file for wireplumber"
2 HOMEPAGE    = "https://gitlab.freedesktop.org/gkiagia/wireplumber"
3 BUGTRACKER  = "https://jira.automotivelinux.org"
4 AUTHOR      = "George Kiagiadakis <george.kiagiadakis@collabora.com>"
5 SECTION     = "multimedia"
6
7 LICENSE = "MIT"
8 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
9
10 SRC_URI = "\
11     file://wireplumber.conf \
12     file://default.streams \
13     file://default-output-audio.endpoint-link.in \
14     file://default-input-audio.endpoint-link.in \
15     file://bluealsa-output-audio.endpoint-link.in \
16     file://bluealsa-input-audio.endpoint-link.in \
17 "
18
19 PACKAGE_ARCH = "${MACHINE_ARCH}"
20
21 do_configure[noexec] = "1"
22 do_compile[noexec] = "1"
23
24 #
25 # Device preferences are configured by listing a subset of the properties
26 # that the device node has on pipewire.
27 #
28 # Every property match needs to have a property name and an expected value.
29 # The values support shell-like pattern matching using the * and ? characters.
30 # The syntax adheres to the rules of TOML v0.5 table array.
31 #
32 # To list all device node properties, you can run (on the target):
33 #  export XDG_RUNTIME_DIR=/run/user/1001
34 #  wireplumber-cli
35 #
36 # Another way to figure out some of these properties is by parsing the
37 # aplay/arecord output. For example, this line is interpreted as follows:
38 #
39 #  card 0: PCH [HDA Intel PCH], device 2: ALC3246 [ALC3246 Analog]
40 #
41 # api.alsa.path = "hw:0,2"
42 # api.alsa.card = "0"
43 # api.alsa.card.id = "PCH"
44 # api.alsa.card.name = "HDA Intel PCH"
45 # api.alsa.pcm.device = "2"
46 # api.alsa.pcm.id = "ALC3246"
47 # api.alsa.pcm.name = "ALC3246 Analog"
48 #
49 DEV_PLAYBACK = '{ name = \"api.alsa.path\", value = \"hw:0,0\" }'
50 DEV_CAPTURE = '{ name = \"api.alsa.path\", value = \"hw:0,0\" }'
51
52 DEV_PLAYBACK_dra7xx-evm = '{ name = \"api.alsa.card.name\", value = \"DRA7xx-EVM\" }'
53 DEV_CAPTURE_dra7xx-evm = '{ name = \"api.alsa.card.name\", value = \"DRA7xx-EVM\" }'
54
55 DEV_PLAYBACK_m3ulcb = '{ name = \"api.alsa.card.name\", value = \"ak4613\" }'
56 DEV_CAPTURE_m3ulcb = '{ name = \"api.alsa.card.name\", value = \"ak4613\" }'
57
58 DEV_PLAYBACK_h3ulcb = '{ name = \"api.alsa.card.name\", value = \"ak4613\" }'
59 DEV_CAPTURE_h3ulcb = '{ name = \"api.alsa.card.name\", value = \"ak4613\" }'
60
61 DEV_PLAYBACK_raspberrypi3 = '{ name = \"api.alsa.pcm.name\", value = \"bcm2835 ALSA\" }, { name = \"api.alsa.card.name\", value = \"bcm2835 ALSA\" }'
62 DEV_CAPTURE_raspberrypi3 = '{ name = \"api.alsa.path\", value = \"hw:0,0\" }'
63
64 do_install_append() {
65     sed -e "s/PLAYBACK_DEV_PROPERTIES/${DEV_PLAYBACK}/" -e "s/CAPTURE_DEV_PROPERTIES/${DEV_CAPTURE}/" ${WORKDIR}/default-output-audio.endpoint-link.in > ${WORKDIR}/default-output-audio.endpoint-link
66     sed -e "s/PLAYBACK_DEV_PROPERTIES/${DEV_PLAYBACK}/" -e "s/CAPTURE_DEV_PROPERTIES/${DEV_CAPTURE}/" ${WORKDIR}/default-input-audio.endpoint-link.in > ${WORKDIR}/default-input-audio.endpoint-link
67     sed -e "s/PLAYBACK_DEV_PROPERTIES/${DEV_PLAYBACK}/" -e "s/CAPTURE_DEV_PROPERTIES/${DEV_CAPTURE}/" ${WORKDIR}/bluealsa-output-audio.endpoint-link.in > ${WORKDIR}/bluealsa-output-audio.endpoint-link
68     sed -e "s/PLAYBACK_DEV_PROPERTIES/${DEV_PLAYBACK}/" -e "s/CAPTURE_DEV_PROPERTIES/${DEV_CAPTURE}/" ${WORKDIR}/bluealsa-input-audio.endpoint-link.in > ${WORKDIR}/bluealsa-input-audio.endpoint-link
69     install -d ${D}/${sysconfdir}/wireplumber/
70     install -m 644 ${WORKDIR}/wireplumber.conf ${D}/${sysconfdir}/wireplumber/wireplumber.conf
71     install -m 644 ${WORKDIR}/default.streams ${D}/${sysconfdir}/wireplumber/default.streams
72     install -m 644 ${WORKDIR}/*.endpoint-link ${D}/${sysconfdir}/wireplumber/
73 }
74
75 FILES_${PN} += "\
76     ${sysconfdir}/wireplumber/* \
77 "
78 CONFFILES_${PN} += "\
79     ${sysconfdir}/wireplumber/* \
80 "
81
82 RPROVIDES_${PN} += "virtual/wireplumber-config"