From 010dbf0824a98b7b638718690d2258e106ed6e0e Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Tue, 23 Jun 2026 12:58:00 -0700 Subject: [PATCH 1/6] doc: Document audio capture for rpi4 Document audio capture for rpi4 using Codec Zero MEMs mics Signed-off-by: Mark Adams --- source/platform/raspberry_pi4.rst | 70 +++++++++++++++ source/static/codecZeroDTChanges.patch | 113 +++++++++++++++++++++++++ 2 files changed, 183 insertions(+) create mode 100644 source/static/codecZeroDTChanges.patch diff --git a/source/platform/raspberry_pi4.rst b/source/platform/raspberry_pi4.rst index ea734de..3b55862 100644 --- a/source/platform/raspberry_pi4.rst +++ b/source/platform/raspberry_pi4.rst @@ -322,6 +322,73 @@ to **agmplay** for audio playback. To use aplay with AudioReach: .. note:: The arguments ``agm:100,100`` correspond to ``CARD=100`` and ``DEV=100`` as defined in the AGM virtual sound card configuration. Card ID ``100`` identifies the AGM virtual sound card (``virtualsndcard``), and device ID ``100`` refers to ``PCM100``, the playback PCM device defined under that card. For capture, device ID ``101`` (``PCM101``) would be used instead. These IDs are not fixed by the plugin itself — they are defined in the virtual sound card definition file and must match accordingly. +Audio Capture Use Case +---------------------- + +Capturing audio on the Rasbperry PI requires adding the Codec Zero audio board to the system. Follow the instructions to install and configure the Codec Zero audio board at: `Raspbery PI Audio Docs `_ + +Additionally update /boot/config.txt with the following changes: + + * Navigate to the file "/boot/config.txt" + * Locate the line **dtoverlay=vc4-kms-v3d** + * Change this line to **dtoverlay=vc4-kms-v3d,noaudio** + * Locate the commented out line **#dtparam=i2s=on** + * Uncomment it to become: **dtparam=i2s=on** + +.. note:: + **The Codec Zero device will need to be added manually to the Linux device tree to be enumerated by default.** + A patch file with the required device tree changes can be downloaded here: :download:`codecZeroDTChanges.patch <../static/codecZeroDTChanges.patch>` + +**Applying the Device Tree Patch** + +Before building the Yocto image, apply the provided patch to your Linux kernel source tree to add Codec Zero device tree support. + + * Navigate to the root of your Linux kernel source directory: + + .. code-block:: bash + + cd + + * Apply the patch using ``git apply``: + + .. code-block:: bash + + git apply codecZeroDTChanges.patch + + * Alternatively, apply using the ``patch`` command: + + .. code-block:: bash + + patch -p1 < codecZeroDTChanges.patch + + * Verify the patch was applied successfully: + + .. code-block:: bash + + git diff --stat + + * Rebuild the kernel and device tree blobs, then reflash the image onto the Raspberry Pi. + +**Running the Capture Use Case** + +To run the audio capture use case: + + * Ensure the **agm_server** is running in a terminal: + + .. code-block:: bash + + agm_server + + * Run the AGM capture use case: + + .. code-block:: bash + + agmcap /etc/rec.wav -D 100 -d 101 -i PCM_RT_PROXY-TX-2 + +The file /etc/rec.wav should contain stereo audio data captured from the MEMS microphones on the Codec Zero card. +Use SCP to copy the recorded wav files to your host machine to play/edit in your favorite audio editor. + + Troubleshooting =============== @@ -343,6 +410,9 @@ forgot to enable the sound cards (see section `Configure bootup settings <#confi :figclass: fig-left :scale: 100 % +When connected to the Codec Zero device the sound card list should read: + 0 [IQaudIOCODEC ]: IQaudIOCODEC - IQaudIOCODEC + Check the sound card ID ----------------------- diff --git a/source/static/codecZeroDTChanges.patch b/source/static/codecZeroDTChanges.patch new file mode 100644 index 0000000..a5be200 --- /dev/null +++ b/source/static/codecZeroDTChanges.patch @@ -0,0 +1,113 @@ +diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +index 75ce412a85dd..67d64eba457b 100644 +--- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts ++++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +@@ -44,6 +44,18 @@ sd_vcc_reg: regulator-sd-vcc { + enable-active-high; + gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; + }; ++ ++ iqaudio_dac: iqaudio_dac { ++ compatible = "iqaudio,iqaudio-codec"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++}; ++ ++//i2s_clk_consumer: &i2s {}; ++ ++&ddc0 { ++ status = "okay"; + }; + + &bt { +@@ -399,17 +411,39 @@ &i2c0if { + clock-frequency = <100000>; + }; + ++&i2s { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s_pins>; ++}; ++ + &i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + clock-frequency = <100000>; +-}; + +-&i2s { +- pinctrl-names = "default"; +- pinctrl-0 = <&i2s_pins>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ da2713@1a { ++ #sound-dai-cells = <0>; ++ compatible = "dlg,da7213"; ++ reg = <0x1a>; ++ status = "okay"; ++ }; + }; + ++//sound { ++// iqaudio_dac: { ++// compatible = "iqaudio,iqaudio-codec"; ++// i2s-controller = <&i2s>; ++// status = "okay"; ++// }; ++// status = "okay"; ++//} ++ ++ ++ + // ============================================= + // Board specific stuff here + +diff --git a/sound/soc/bcm/iqaudio-codec.c b/sound/soc/bcm/iqaudio-codec.c +index 08b9c51759cc..cb7cc080b53a 100644 +--- a/sound/soc/bcm/iqaudio-codec.c ++++ b/sound/soc/bcm/iqaudio-codec.c +@@ -249,6 +249,8 @@ static int snd_rpi_iqaudio_codec_probe(struct platform_device *pdev) + return ret; + } + ++ dev_err(&pdev->dev, "Probed iqaudio_codec\n"); ++ + return 0; + } + +diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c +index 36439fbe0d76..7bda92ef6d35 100644 +--- a/sound/soc/codecs/da7213.c ++++ b/sound/soc/codecs/da7213.c +@@ -1813,6 +1813,7 @@ static struct da7213_platform_data + static int da7213_probe(struct snd_soc_component *component) + { + struct da7213_priv *da7213 = snd_soc_component_get_drvdata(component); ++ pr_err("da7213 probe enter"); + + pm_runtime_get_sync(component->dev); + +@@ -1941,8 +1942,10 @@ static int da7213_probe(struct snd_soc_component *component) + /* Check if MCLK provided */ + da7213->mclk = devm_clk_get(component->dev, "mclk"); + if (IS_ERR(da7213->mclk)) { +- if (PTR_ERR(da7213->mclk) != -ENOENT) ++ if (PTR_ERR(da7213->mclk) != -ENOENT) { ++ pr_err("da7213 pointer error"); + return PTR_ERR(da7213->mclk); ++ } + else + da7213->mclk = NULL; + } else { +@@ -1952,6 +1955,8 @@ static int da7213_probe(struct snd_soc_component *component) + da7213->fixed_clk_auto_pll = true; + } + ++ pr_err("Probed da7213"); ++ + return 0; + } + From dfb130673a63edad976209ea309f715e8bad1f39 Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Wed, 9 Sep 2026 11:36:16 -0700 Subject: [PATCH 2/6] Cleanup patch file Signed-off-by: Mark Adams Remove comments, redundant patch info --- source/static/codecZeroDTChanges.patch | 215 ++++++++++++------------- 1 file changed, 103 insertions(+), 112 deletions(-) diff --git a/source/static/codecZeroDTChanges.patch b/source/static/codecZeroDTChanges.patch index a5be200..7ab79c7 100644 --- a/source/static/codecZeroDTChanges.patch +++ b/source/static/codecZeroDTChanges.patch @@ -1,113 +1,104 @@ -diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts -index 75ce412a85dd..67d64eba457b 100644 ---- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts -+++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts -@@ -44,6 +44,18 @@ sd_vcc_reg: regulator-sd-vcc { - enable-active-high; - gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; - }; -+ -+ iqaudio_dac: iqaudio_dac { -+ compatible = "iqaudio,iqaudio-codec"; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ }; -+}; -+ -+//i2s_clk_consumer: &i2s {}; -+ -+&ddc0 { -+ status = "okay"; - }; - - &bt { -@@ -399,17 +411,39 @@ &i2c0if { - clock-frequency = <100000>; - }; - -+&i2s { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2s_pins>; -+}; -+ - &i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins>; - clock-frequency = <100000>; --}; - --&i2s { -- pinctrl-names = "default"; -- pinctrl-0 = <&i2s_pins>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ da2713@1a { -+ #sound-dai-cells = <0>; -+ compatible = "dlg,da7213"; -+ reg = <0x1a>; -+ status = "okay"; -+ }; - }; - -+//sound { -+// iqaudio_dac: { -+// compatible = "iqaudio,iqaudio-codec"; -+// i2s-controller = <&i2s>; -+// status = "okay"; -+// }; -+// status = "okay"; -+//} -+ -+ -+ - // ============================================= - // Board specific stuff here - -diff --git a/sound/soc/bcm/iqaudio-codec.c b/sound/soc/bcm/iqaudio-codec.c -index 08b9c51759cc..cb7cc080b53a 100644 ---- a/sound/soc/bcm/iqaudio-codec.c -+++ b/sound/soc/bcm/iqaudio-codec.c -@@ -249,6 +249,8 @@ static int snd_rpi_iqaudio_codec_probe(struct platform_device *pdev) - return ret; - } - -+ dev_err(&pdev->dev, "Probed iqaudio_codec\n"); -+ - return 0; - } - -diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c -index 36439fbe0d76..7bda92ef6d35 100644 ---- a/sound/soc/codecs/da7213.c -+++ b/sound/soc/codecs/da7213.c -@@ -1813,6 +1813,7 @@ static struct da7213_platform_data - static int da7213_probe(struct snd_soc_component *component) - { - struct da7213_priv *da7213 = snd_soc_component_get_drvdata(component); -+ pr_err("da7213 probe enter"); - - pm_runtime_get_sync(component->dev); - -@@ -1941,8 +1942,10 @@ static int da7213_probe(struct snd_soc_component *component) - /* Check if MCLK provided */ - da7213->mclk = devm_clk_get(component->dev, "mclk"); - if (IS_ERR(da7213->mclk)) { -- if (PTR_ERR(da7213->mclk) != -ENOENT) -+ if (PTR_ERR(da7213->mclk) != -ENOENT) { -+ pr_err("da7213 pointer error"); - return PTR_ERR(da7213->mclk); -+ } - else - da7213->mclk = NULL; - } else { -@@ -1952,6 +1955,8 @@ static int da7213_probe(struct snd_soc_component *component) - da7213->fixed_clk_auto_pll = true; - } - -+ pr_err("Probed da7213"); -+ - return 0; - } +diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +index 75ce412a85dd..67d64eba457b 100644 +--- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts ++++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +@@ -44,6 +44,18 @@ sd_vcc_reg: regulator-sd-vcc { + enable-active-high; + gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; + }; ++ ++ iqaudio_dac: iqaudio_dac { ++ compatible = "iqaudio,iqaudio-codec"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++}; ++ ++ ++&ddc0 { ++ status = "okay"; + }; + + &bt { +@@ -399,17 +411,39 @@ &i2c0if { + clock-frequency = <100000>; + }; + ++&i2s { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s_pins>; ++}; ++ + &i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + clock-frequency = <100000>; +-}; + +-&i2s { +- pinctrl-names = "default"; +- pinctrl-0 = <&i2s_pins>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ da2713@1a { ++ #sound-dai-cells = <0>; ++ compatible = "dlg,da7213"; ++ reg = <0x1a>; ++ status = "okay"; ++ }; + }; + ++ ++ ++ + // ============================================= + // Board specific stuff here + +diff --git a/sound/soc/bcm/iqaudio-codec.c b/sound/soc/bcm/iqaudio-codec.c +index 08b9c51759cc..cb7cc080b53a 100644 +--- a/sound/soc/bcm/iqaudio-codec.c ++++ b/sound/soc/bcm/iqaudio-codec.c +@@ -249,6 +249,8 @@ static int snd_rpi_iqaudio_codec_probe(struct platform_device *pdev) + return ret; + } + ++ dev_err(&pdev->dev, "Probed iqaudio_codec\n"); ++ + return 0; + } + +diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c +index 36439fbe0d76..7bda92ef6d35 100644 +--- a/sound/soc/codecs/da7213.c ++++ b/sound/soc/codecs/da7213.c +@@ -1813,6 +1813,7 @@ static struct da7213_platform_data + static int da7213_probe(struct snd_soc_component *component) + { + struct da7213_priv *da7213 = snd_soc_component_get_drvdata(component); ++ pr_err("da7213 probe enter"); + + pm_runtime_get_sync(component->dev); + +@@ -1941,8 +1942,10 @@ static int da7213_probe(struct snd_soc_component *component) + /* Check if MCLK provided */ + da7213->mclk = devm_clk_get(component->dev, "mclk"); + if (IS_ERR(da7213->mclk)) { +- if (PTR_ERR(da7213->mclk) != -ENOENT) ++ if (PTR_ERR(da7213->mclk) != -ENOENT) { ++ pr_err("da7213 pointer error"); + return PTR_ERR(da7213->mclk); ++ } + else + da7213->mclk = NULL; + } else { +@@ -1952,6 +1955,8 @@ static int da7213_probe(struct snd_soc_component *component) + da7213->fixed_clk_auto_pll = true; + } + ++ pr_err("Probed da7213"); ++ + return 0; + } From 4cdfe26ef37ea8ae12ba491ddbc3703ce2dddac9 Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Wed, 9 Sep 2026 12:26:41 -0700 Subject: [PATCH 3/6] Remove debug info from patch Signed-off-by: Mark Adams Remove debug info from patch --- source/static/codecZeroDTChanges.patch | 160 +++++++++---------------- 1 file changed, 57 insertions(+), 103 deletions(-) diff --git a/source/static/codecZeroDTChanges.patch b/source/static/codecZeroDTChanges.patch index 7ab79c7..3e2f935 100644 --- a/source/static/codecZeroDTChanges.patch +++ b/source/static/codecZeroDTChanges.patch @@ -1,104 +1,58 @@ -diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts -index 75ce412a85dd..67d64eba457b 100644 ---- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts -+++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts -@@ -44,6 +44,18 @@ sd_vcc_reg: regulator-sd-vcc { - enable-active-high; - gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; - }; -+ -+ iqaudio_dac: iqaudio_dac { -+ compatible = "iqaudio,iqaudio-codec"; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ }; -+}; -+ -+ -+&ddc0 { -+ status = "okay"; - }; - - &bt { -@@ -399,17 +411,39 @@ &i2c0if { - clock-frequency = <100000>; - }; - -+&i2s { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2s_pins>; -+}; -+ - &i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins>; - clock-frequency = <100000>; --}; - --&i2s { -- pinctrl-names = "default"; -- pinctrl-0 = <&i2s_pins>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ da2713@1a { -+ #sound-dai-cells = <0>; -+ compatible = "dlg,da7213"; -+ reg = <0x1a>; -+ status = "okay"; -+ }; - }; - -+ -+ -+ - // ============================================= - // Board specific stuff here - -diff --git a/sound/soc/bcm/iqaudio-codec.c b/sound/soc/bcm/iqaudio-codec.c -index 08b9c51759cc..cb7cc080b53a 100644 ---- a/sound/soc/bcm/iqaudio-codec.c -+++ b/sound/soc/bcm/iqaudio-codec.c -@@ -249,6 +249,8 @@ static int snd_rpi_iqaudio_codec_probe(struct platform_device *pdev) - return ret; - } - -+ dev_err(&pdev->dev, "Probed iqaudio_codec\n"); -+ - return 0; - } - -diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c -index 36439fbe0d76..7bda92ef6d35 100644 ---- a/sound/soc/codecs/da7213.c -+++ b/sound/soc/codecs/da7213.c -@@ -1813,6 +1813,7 @@ static struct da7213_platform_data - static int da7213_probe(struct snd_soc_component *component) - { - struct da7213_priv *da7213 = snd_soc_component_get_drvdata(component); -+ pr_err("da7213 probe enter"); - - pm_runtime_get_sync(component->dev); - -@@ -1941,8 +1942,10 @@ static int da7213_probe(struct snd_soc_component *component) - /* Check if MCLK provided */ - da7213->mclk = devm_clk_get(component->dev, "mclk"); - if (IS_ERR(da7213->mclk)) { -- if (PTR_ERR(da7213->mclk) != -ENOENT) -+ if (PTR_ERR(da7213->mclk) != -ENOENT) { -+ pr_err("da7213 pointer error"); - return PTR_ERR(da7213->mclk); -+ } - else - da7213->mclk = NULL; - } else { -@@ -1952,6 +1955,8 @@ static int da7213_probe(struct snd_soc_component *component) - da7213->fixed_clk_auto_pll = true; - } - -+ pr_err("Probed da7213"); -+ - return 0; - } +diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +index 75ce412a85dd..67d64eba457b 100644 +--- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts ++++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +@@ -44,6 +44,18 @@ sd_vcc_reg: regulator-sd-vcc { + enable-active-high; + gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; + }; ++ ++ iqaudio_dac: iqaudio_dac { ++ compatible = "iqaudio,iqaudio-codec"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++}; ++ ++ ++&ddc0 { ++ status = "okay"; + }; + + &bt { +@@ -399,17 +411,39 @@ &i2c0if { + clock-frequency = <100000>; + }; + ++&i2s { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s_pins>; ++}; ++ + &i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + clock-frequency = <100000>; +-}; + +-&i2s { +- pinctrl-names = "default"; +- pinctrl-0 = <&i2s_pins>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ da2713@1a { ++ #sound-dai-cells = <0>; ++ compatible = "dlg,da7213"; ++ reg = <0x1a>; ++ status = "okay"; ++ }; + }; + ++ ++ ++ + // ============================================= + // Board specific stuff here From 81c9ee2932d088772a5cb51a33bc2058a34625a3 Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Wed, 9 Sep 2026 12:37:46 -0700 Subject: [PATCH 4/6] Update Codec Zero doc per plai review Signed-off-by: Mark Adams Reword to better describe Codec Zero update Signed-off-by: Mark Adams Add message bodies --- source/platform/raspberry_pi4.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/platform/raspberry_pi4.rst b/source/platform/raspberry_pi4.rst index 3b55862..8775221 100644 --- a/source/platform/raspberry_pi4.rst +++ b/source/platform/raspberry_pi4.rst @@ -325,7 +325,7 @@ to **agmplay** for audio playback. To use aplay with AudioReach: Audio Capture Use Case ---------------------- -Capturing audio on the Rasbperry PI requires adding the Codec Zero audio board to the system. Follow the instructions to install and configure the Codec Zero audio board at: `Raspbery PI Audio Docs `_ +Capturing audio on the Rasbperry PI requires adding a HATS audio board that supports mic input. Codec Zero is one such board and is chosen for this guide. Follow the instructions to install and configure the Codec Zero audio board at: `Raspbery PI Audio Docs `_ Additionally update /boot/config.txt with the following changes: @@ -337,7 +337,7 @@ Additionally update /boot/config.txt with the following changes: .. note:: **The Codec Zero device will need to be added manually to the Linux device tree to be enumerated by default.** - A patch file with the required device tree changes can be downloaded here: :download:`codecZeroDTChanges.patch <../static/codecZeroDTChanges.patch>` + To have the Codec Zero board enumerated by default apply the patch file with the required device tree changes here: :download:`codecZeroDTChanges.patch <../static/codecZeroDTChanges.patch>` **Applying the Device Tree Patch** From 445e2173e9731a498eb57d94cbc85f3ab0398717 Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Wed, 9 Sep 2026 16:38:22 -0700 Subject: [PATCH 5/6] cleanup patch after validation Signed-off-by: Mark Adams Validation found that patch needed updating to match latest --- source/static/codecZeroDTChanges.patch | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/source/static/codecZeroDTChanges.patch b/source/static/codecZeroDTChanges.patch index 3e2f935..f9e3856 100644 --- a/source/static/codecZeroDTChanges.patch +++ b/source/static/codecZeroDTChanges.patch @@ -1,8 +1,8 @@ diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts -index 75ce412a85dd..67d64eba457b 100644 +index 75ce412a85dd..510f946a8e56 100644 --- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts -@@ -44,6 +44,18 @@ sd_vcc_reg: regulator-sd-vcc { +@@ -44,6 +44,12 @@ sd_vcc_reg: regulator-sd-vcc { enable-active-high; gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; }; @@ -12,15 +12,10 @@ index 75ce412a85dd..67d64eba457b 100644 + i2s-controller = <&i2s>; + status = "okay"; + }; -+}; -+ -+ -+&ddc0 { -+ status = "okay"; }; &bt { -@@ -399,17 +411,39 @@ &i2c0if { +@@ -399,17 +405,31 @@ &i2c0if { clock-frequency = <100000>; }; From b930017c69c0cc3b9c67939d3dfd16250704ca93 Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Sun, 13 Sep 2026 15:36:48 -0700 Subject: [PATCH 6/6] cleaner patch, doc mixer ctrls Signed-off-by: Mark Adams Created a cleaner patch file for dts. Removed debug code and comments. Update the capture documentation to include mixer control settings to turn on mics and correct codec routing. --- source/platform/raspberry_pi4.rst | 19 +++++++++++++++++ source/static/codecZeroDTChanges.patch | 29 +++++++------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/source/platform/raspberry_pi4.rst b/source/platform/raspberry_pi4.rst index 8775221..70815f9 100644 --- a/source/platform/raspberry_pi4.rst +++ b/source/platform/raspberry_pi4.rst @@ -373,6 +373,25 @@ Before building the Yocto image, apply the provided patch to your Linux kernel s To run the audio capture use case: + * Turn on microphones and configure controls for Zero Codec card: + + .. code-block:: bash + + amixer -c 0 cset numid=23 on # Mic 1 Switch ON + amixer -c 0 cset numid=1 5 # Mic 1 Volume + amixer -c 0 cset numid=24 on # Mic 2 Switch ON + amixer -c 0 cset numid=2 5 # Mic 2 Volume + amixer -c 0 cset numid=27 on # ADC Switch + amixer -c 0 cset numid=5 114,114 # ADC Volume + amixer -c 0 cset numid=26 on # Mixin PGA Switch + amixer -c 0 cset numid=4 7,7 # Mixin PGA Volume + amixer -c 0 cset numid=73 on # Mixin Left Mic 1 ON + amixer -c 0 cset numid=74 off # Mixin Left Mic 2 OFF + amixer -c 0 cset numid=77 on # Mixin Right Mic 2 ON + amixer -c 0 cset numid=78 off # Mixin Right Mic 1 OFF + amixer -c 0 cset name='DAI Left Source MUX' 'ADC Left' + amixer -c 0 cset name='DAI Right Source MUX' 'ADC Right' + * Ensure the **agm_server** is running in a terminal: .. code-block:: bash diff --git a/source/static/codecZeroDTChanges.patch b/source/static/codecZeroDTChanges.patch index f9e3856..b0bea1a 100644 --- a/source/static/codecZeroDTChanges.patch +++ b/source/static/codecZeroDTChanges.patch @@ -1,8 +1,7 @@ diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts -index 75ce412a85dd..510f946a8e56 100644 --- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts +++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-4-b.dts -@@ -44,6 +44,12 @@ sd_vcc_reg: regulator-sd-vcc { +@@ -38,6 +38,12 @@ sd_vcc_reg: regulator-sd-vcc { enable-active-high; gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; }; @@ -15,24 +14,12 @@ index 75ce412a85dd..510f946a8e56 100644 }; &bt { -@@ -399,17 +405,31 @@ &i2c0if { - clock-frequency = <100000>; - }; - -+&i2s { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2s_pins>; -+}; -+ +@@ -402,10 +402,21 @@ &i2c0if { &i2c1 { pinctrl-names = "default"; pinctrl-0 = <&i2c1_pins>; clock-frequency = <100000>; --}; - --&i2s { -- pinctrl-names = "default"; -- pinctrl-0 = <&i2s_pins>; ++ + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; @@ -45,9 +32,7 @@ index 75ce412a85dd..510f946a8e56 100644 + }; }; -+ -+ -+ - // ============================================= - // Board specific stuff here - + &i2s { + pinctrl-names = "default"; + pinctrl-0 = <&i2s_pins>; + };