Public bug reported:

[ Impact ]

 * On the MediaTek MT8391-EVK (Genio 720/520 EVK), the alsa-ucm-conf
   profile has three problems:

   - The Speaker device has only 1 channel, so the earphone output is
     mono (center only).

   - There are no hardware volume controls for Speaker, Headphones,
     Headset and Mic1. The volume sliders do not change the hardware
     gain and recordings from the analog microphone are very quiet.

   - There is no device for the DisplayPort output on the USB-C port,
     so no audio sink appears for an external monitor.

 * Upstream fixed the first two problems in 8275e1b and added the
   DisplayPort output in 8048d93. Both commits are merged upstream but
   are not in any release yet.

 * 8048d93 sets DPTX_OUT_MUX and HDMI_CH1_MUX only in the BootSequence,
   which runs from "alsactl init". On a normal boot alsa-restore replays
   the saved ALSA state instead. After an upgrade and a reboot:

   - A saved DPTX_OUT_MUX=Disconnect makes the DisplayPort PCM
     (hw:CardId,5) fail to open. WirePlumber then drops the whole HiFi
     profile and only a dummy output and no inputs are left.

   - A saved HDMI_CH1_MUX=CH0 leaves the right DisplayPort channel
     silent.

 * A third patch, the fix for 8048d93, sets the three DisplayPort muxes
   from the HiFi verb EnableSequence, so they are applied every time
   the profile is activated. 8048d93 must not be shipped without it.

[ Test Plan ]

 * Hardware used for the SRU verification:
   - MediaTek Genio 720 EVK (MT8391-EVK) with display-dpoc.dtbo in
     list_dtbo, and a DisplayPort monitor with speakers on the USB-C
     DP port (directly or through a USB-C hub).
   - Framework Laptop 13 (AMD Ryzen AI 300 Series), x86_64, for the
     regression test on non-MT8391 hardware.

 * Images on the Genio 720 EVK:
   - Noble: the official Ubuntu 24.04 desktop image for Genio.
   - Resolute and Stonking: there is no official Genio image for these
     releases. A special arm64 image is prepared for the SRU
     verification only, as was done for Questing in LP: #2139651.

 * The same steps are run on Noble, Resolute and Stonking, with the
   package from -proposed installed. Results are posted as one comment
   per release, with the installed version from
   "apt-cache policy alsa-ucm-conf" and the command output.

 1. Enable -proposed, install the updated alsa-ucm-conf, reboot and log
    in to the desktop.

 2. Run: wpctl status
    Confirm these sinks: "DP output", "I2S output", "PCM output",
    "Earphone speaker + Lineout speaker".
    Confirm these sources: "I2S input", "PCM input",
    "Digital microphone", "Analog microphone + Earphone microphone".

 3. Stale state after a reboot:
      sudo amixer -c0 cset name=DPTX_OUT_MUX Disconnect
      sudo amixer -c0 cset name=HDMI_CH1_MUX CH0
      sudo alsactl store
    Reboot and log in. Confirm that the sinks and sources are the same
    as in step 2, that
      sudo amixer -c0 cget name=DPTX_OUT_MUX
    shows Connect, that
      sudo amixer -c0 cget name=HDMI_CH1_MUX
    shows CH1, and that
      journalctl --user -b -u wireplumber
    has no "Error opening PCM device" line.

 4. Select "DP output" in Settings > Sound and run the speaker test.
    Confirm that Front Left and Front Right are heard from the monitor.

 5. Plug in headphones, select them and run the speaker test. Confirm
    that left and right are heard on the matching side and not in the
    center.

 6. Move the output and input volume sliders. Confirm that
    "Headset Volume", "Lineout Volume" and "PGA1 Volume" follow them in
    alsamixer, and that a recording from the analog microphone has a
    usable level.

 7. Boot with the default overlays (no display-dpoc.dtbo). Confirm that
    there is no DP output and that all other sinks and sources from
    step 2 are present.

 8. Regression test on the Framework Laptop 13: install the update,
    play and record audio with the built-in speakers and microphone,
    and confirm that "journalctl -b" has no new UCM errors.

 * Tenacious (the development release) is a normal upload and is not
   part of the SRU verification.

[ Where problems could occur ]

 * Only files under ucm2/MediaTek/mt8391-evk/ change. They are loaded
   only for the mt8391-evk sound card, so other hardware is not
   affected. To verify this, examine each debdiff attached to this bug:
   the three patches touch only ucm2/MediaTek/mt8391-evk/HiFi.conf.

 * On the MT8391-EVK:

   - The verb EnableSequence runs every time the profile is activated.
     If a kernel or device tree does not register one of the three mux
     controls, activating the profile could fail and audio would be
     lost. Test Plan step 7 covers the default overlays.

   - Speaker and Headphones priorities move to 400 and 500, above the
     DP output (300). With a monitor attached the default output stays
     the speaker and the user selects DP in the settings.

   - The volume sliders now drive the hardware gain, so the default
     microphone level differs from before (louder).

[ Other Info ]

 * Upstream status:

   - Patches 1 and 2 are backports of upstream commits merged on
     master. The latest release, v1.2.16.1, does not contain them yet.
     1. 8275e1b6577b "ucm2: MediaTek: mt8391-evk: Fix channels and add
        volume controls"
        https://github.com/alsa-project/alsa-ucm-conf/commit/8275e1b6577b
     2. 8048d93df191 "ucm2: MediaTek: mt8391-evk: Add DisplayPort output
        audio support"
        https://github.com/alsa-project/alsa-ucm-conf/commit/8048d93df191
   - Patch 3 is the fix for patch 2 and is NOT YET MERGED upstream:
     3. "ucm2: MediaTek: mt8391-evk: Set the DP audio muxes in the verb"
        (Fixes: 8048d93)
        https://github.com/alsa-project/alsa-ucm-conf/pull/902
     This bug will be updated when it merges, and the DEP-3 Origin of
     patch 3 will be changed to the upstream commit.

 * Sponsorship is requested. Debdiffs for Tenacious, Stonking, Resolute
   and Noble will be attached to this bug. Each series gets the same
   three patches, named after this bug number:
   - lp<bug>-ucm2-MediaTek-mt8391-evk-Fix-channels-and-add-volume-controls.patch
   - lp<bug>-ucm2-MediaTek-mt8391-evk-Add-DisplayPort-output-audio-support.patch
   - lp<bug>-ucm2-MediaTek-mt8391-evk-Set-the-DP-audio-muxes-in-the-verb.patch
   The resulting ucm2/MediaTek/mt8391-evk files are identical in all
   four series.

 * Debian: the first two patches are upstream commits and reach Debian
   with the next upstream release. Patch 3 is forwarded
   upstream as PR #902. No separate Debian bug is planned.

 * Tested on a Genio 720 EVK running 24.04: stereo output and volume
   controls, and DisplayPort audio including a reboot with a stale
   saved state, with the same changes except the Speaker and
   Headphones priority values.

 * Target releases:
   - Tenacious: 1.2.16.1-1ubuntu1 -> 1.2.16.1-1ubuntu2
   - Stonking:  1.2.16.1-1ubuntu1 -> 1.2.16.1-1ubuntu1.1
   - Resolute:  1.2.15.3-1ubuntu1.7 -> 1.2.15.3-1ubuntu1.8
   - Noble:     1.2.10-1ubuntu5.16 -> 1.2.10-1ubuntu5.17
     (5.16 is in noble-proposed, LP: #2068911)

 * The Tenacious and Stonking debdiffs also run update-maintainer,
   because the current upload still has the Debian maintainer in
   debian/control.

** Affects: alsa-ucm-conf (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2173715

Title:
  [SRU] MediaTek MT8391-EVK: fix stereo output, add volume controls and
  DisplayPort audio

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/alsa-ucm-conf/+bug/2173715/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to