Skip to content

sof-ucm: Align PCM and transducer columns to minimize edge crossings - #13

Merged
lgirdwood merged 1 commit into
mainfrom
fix/sof-ucm-column-alignment
Dec 5, 2026
Merged

lgirdwood merged 1 commit into
mainfrom
fix/sof-ucm-column-alignment

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

Summary

Fixes left PCM column ordering, right physical transducer column alignment, and SoundWire/codec endpoint classification in sof-ucm (observed on ladybird sof-soundwire):

  • Terminal physical transducer classification (graph_builder.py):
    • Avoid mapping physical card DAPM widgets to DSP FE PCM stream stubs in fe_stream_to_pcm_nid.
    • Add _demote_non_terminal_codec_endpoints() so intermediate codec pins (rt722 HP, rt722 SPK, rt722 MIC2, dmic-codec:DMic) stay in the middle Codec zone instead of colliding in the right Endpoint column alongside physical card transducers (Headphone, Speaker, Headset Mic, SoC DMIC).
  • Crossing-minimized 3-zone columnar layout (layout.py):
    • Group middle lanes sharing a target endpoint (HDMI 1/2/3/hifi4 -> Digital Out HDMI), classify playback vs. capture lanes from DSP pipelines/PCMs/endpoints, run 2-pass barycenter column sorting, and pull non-PCM root codec supply nodes (rt722 PDE *) ALAP next to their consumer widgets.
    • Re-sort and pack both the left PCM column and right Endpoint column (_pack_column_near_targets()) directly across from their connected middle nodes.
  • Unit tests (tests/test_tplg_and_graph.py):
    • Add test_pcm_and_endpoint_columns_align_without_crossings.

Testing

  • make -C /home/lrg/work/sof-utils check: passed (py_compile clean across sof-builder, sof-ucm, sof-top; 12/12 sof-ucm unit tests passed in 0.821s).
  • Verified headless PNG render on ladybird (--ssh ladybird --card 0 --render-png, 149 nodes, 93 edges).

- graph_builder.py: Prevent fe_stream_to_pcm_nid from matching physical
  card transducer widgets, and add _demote_non_terminal_codec_endpoints()
  so intermediate codec pins (rt722 HP/SPK/MIC2, dmic-codec DMic) stay
  in the center Codec zone while only terminal physical transducers
  occupy the right Endpoint column.
- layout.py: Group middle lanes sharing a downstream Endpoint, infer
  lane playback vs. capture from pipelines/PCMs/endpoints, add 2-pass
  barycenter column sorting plus ALAP pulling for root codec supply
  widgets (e.g. SDCA PDEs), and sort/pack both the left PCM column and
  right Endpoint column opposite their connected middle nodes.
- tests/test_tplg_and_graph.py: Add unit test
  test_pcm_and_endpoint_columns_align_without_crossings covering
  codec-pin demotion, Deepbuffer/PCM31 grouping, and playback/capture
  vertical ordering.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@lgirdwood
lgirdwood force-pushed the fix/sof-ucm-column-alignment branch from ffd0ca6 to 9bc6b35 Compare December 5, 2026 19:14
@lgirdwood
lgirdwood marked this pull request as ready for review December 5, 2026 19:15
@lgirdwood
lgirdwood merged commit e378a2d into main Dec 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants