Repository navigation
Conversation
A HiFiBerry DSP add-on sits between the Pi and a DAC+/Amp100 and can send audio back to the Pi on the I2S data-in line (GPIO20), for example the signal on its S/PDIF input. The DAC+ machine driver only registers a playback codec, so that audio cannot be captured. Add a "hifiberry-dacplus,dsp_capture" DT property. When it is set, the DAI link gets a second codec, the existing "hifiberry,dacplusdsp" dummy codec, which provides the capture DAI. The PCM512x stays codec 0 and keeps handling playback, clocking and the mixer controls, so the card name, the playback device and the controls are unchanged. Capture runs at the playback sample rate, as both directions share one I2S link. startup/shutdown now return early for capture streams, so opening or closing a capture stream never toggles the LEDs or the amplifier mute GPIO. hifiberry-amp100-overlay gains a dsp_capture parameter that enables the dummy codec node (dormant fragment) and sets the property. Compile-tested against rpi-6.18.y on a Raspberry Pi 4 (no warnings). The same change, built out of tree as a separate module with its own compatible string, runs on a Raspberry Pi 4 with an Amp100 and a DSP add-on whose program routes its S/PDIF receiver to SDATA_OUT3: playback is unchanged and the optical input is captured and recorded. Signed-off-by: cxfxcxcb <72253403+xc0f0c0bx@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A HiFiBerry DSP add-on stacked between the Pi and a DAC+/Amp100 can send audio back to the Pi on the I2S data-in line (GPIO20), for example the signal on its S/PDIF input. The DAC+ machine driver only registers a playback codec, so that audio cannot be captured.
This adds an opt-in
dsp_captureparameter to thehifiberry-amp100overlay:hifiberry-dacplus,dsp_capture. When set, the DAI link gets a second codec: the existinghifiberry,dacplusdspdummy codec, which provides the capture DAI.startup/shutdownreturn early for capture streams, so opening or closing a capture stream never toggles the LEDs or the amplifier mute GPIO.The DSP side (routing the S/PDIF receiver to SDATA_OUT3 through a spare ASRC, register-only) and a matching DSP program are documented at https://github.com/xc0f0c0bx/hifiberry-dsp-spdif-capture, and proposed for hifiberry/dspprofiles in hifiberry/dspprofiles#5.
Testing
checkpatch.pl --strict: 0 errors, 0 warnings (one alignment CHECK that matches the neighbouringof_property_read_boollines).🤖 Generated with Claude Code