Repository navigation
Implement the shared dmdrvi audio stream contract - #8
Merged
Merged
Conversation
Replace the private DMSAI_IOCTL_* commands with the DMDRVI_IOCTL_AUDIO_* stream commands from dmdrvi 2.7 - GET_STREAM, START, STOP, GET_STATUS, SET/GET_TIMEOUT and DRAIN. A codec node such as dmwm8994 implements the same contract, so an application plays the same way on both and a codec drives its SAI friend without any dmsai header. - GET_STREAM reports the buffer layout (channels = active slots) and the serial link (dmdrvi_audio_stream_t). - CONFIGURE succeeds only for the ini format (rate, channels, width), -ENOTSUP otherwise. - START succeeds when already running (was -EBUSY). - GET_INFO, SET_VOLUME and SET_MUTE return -ENOTSUP: no analog stage, which also keeps dmdevfs from reporting the SAI as an "audio" device. dmsai_ioctl.h is removed. The port API keeps dmsai_config_t and dmsai_status_t; static asserts check that the format and clock role values match dmdrvi's. Requires dmdrvi 2.7. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nr1HhezRY951yBxxTm1b65
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.
Summary
Replaces the private
DMSAI_IOCTL_*commands with theDMDRVI_IOCTL_AUDIO_*stream commands from dmdrvi 2.7 (choco-technologies/dmdrvi#28, released). A codec node such as dmwm8994 implements the same contract, so an application plays the same way on the codec and on the bare SAI, and a codec drives its SAI friend without any dmsai header.This is the follow-up to #7. That PR was merged after only its first commit (the fix for the DMA wake-up) and before the contract change landed on the branch.
Changes
GET_STREAMreturnsdmdrvi_audio_stream_t: the buffer layout (rate, format, channels = active slots) and the serial link (framing, clock role, slots).CONFIGUREreturns 0 only when rate, channels and width match the ini format; otherwise-ENOTSUP.STARTsucceeds when the stream is already running (it used to return-EBUSY).STOP,GET_STATUS,SET_TIMEOUT/GET_TIMEOUTandDRAINbehave as before, under the new command numbers.GET_INFO,SET_VOLUMEandSET_MUTEreturn-ENOTSUP, since the SAI has no analog stage. This also keeps dmdevfs from reporting the SAI as anaudiodevice.include/dmsai_ioctl.handDMSAI_IOCTL_*are removed. The port API keepsdmsai_config_t/dmsai_status_t, and static asserts check that the format and clock role values match dmdrvi.docs/api-reference.mdand the driver board test are updated. The board test also checks CONFIGURE matching and mismatching, the-ENOTSUPvolume control and the idempotent START.Breaking: clients of
DMSAI_IOCTL_*must move to the dmdrvi commands. In this ecosystem that is dmwm8994 only, in choco-technologies/dmwm8994 (see the sibling PR). Merge the two together; until then a dmwm8994 build frommaintalks to this node with commands it no longer answers.Verification
/dev/wm8994, all 32 notes at the expected frequencies) and ran on/dev/dmsai1directly without underruns, apart from the drain tail. That path is silent, because nothing configures the codec on it.🤖 Generated with Claude Code
https://claude.ai/code/session_01Nr1HhezRY951yBxxTm1b65
Generated by Claude Code