[V8] Move to snd-hda-codec-hdmi for SOF HDMI/DP support#1155
[V8] Move to snd-hda-codec-hdmi for SOF HDMI/DP support#1155kv2019i wants to merge 13 commits intothesofproject:topic/sof-devfrom
Conversation
|
@libinyang and @xiulipan : can you check the thread on https://mailman.alsa-project.org/pipermail/alsa-devel/2019-August/154561.html about the dyn-pcm-assign mode in patch_hdmi.c. It would seem we are going towards DP-MST without the backup PCMs. Can you recall any critical problems with this approach (i.e. reasons for originally adding the backup PCMs to DP-MST support). |
plbossart
left a comment
There was a problem hiding this comment.
This is pretty heavy-duty stuff @kv2019i, thanks for sharing.
I am not clear on what we call the PCMs, and how we will refer to HDMI 'pcms' from a topology file. Or if we assume the topology is bypassed completely.
I would also suggest using the Up2 board without any codec, that is an excellent way of testing if plain vanilla HDMI works and with the same capabilities as legacy HDaudio.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
9058406 to
f405d36
Compare
@libinyang Thanks for the response. I found at least one related thing that has been fixed in PA. It seems that in Pulseaudio 11.x, there is no ELD autodetect support yet, so the PCM numbers have to be hardcoded in Pulseaudio paths files. This PA version is in e.g. 18.04 Ubuntu. Pulseaudio 12.x has ELD autodetect and this version is in Ubuntu 18.10 and newer. I think this is something we can live with SOF -> in practise recommend to use at least PA 12.x to make HDMI autodetect work. As for assigning pcms 9 and 10, that will still be an issue. I'll ask about this on pulseaudio devel. |
|
v2 patch uploaded, changes: added a mechanism to pass PCM device numbers from machine driver to HDA codec driver; lots of cleanups; tested with PA12.2; added support for skl-hda-generic-dsp |
@kv2019i Yes, the old PA may not support pcm 9 and pcm 10 well. But at least, it will not break the normal pcm 3, pcm 7, pcm 8. :) |
a4b8725 to
a5b1988
Compare
|
v3 patch uploaded: dynamically parse PCM ids from topology at probe; multiple clean ups This starts to look good. Unless any showstoppers seen, I'll send this to alsa-devel tomorrow for wider discussion. Aside testing, biggest remaining open is whether we switch over all machine drivers at once or not. Current patch basicly requires to switch all machine drivers at once, so for merging, all machine drivers (for SOF-supported devices) need to be updated in the same series. |
There was a problem hiding this comment.
@plbossart wrote:
I would also have expected the hdac_hdmi code to be removed, and all kconfigs to be updated?
Let's discuss that on alsa-devel. That's the big question for merging. Change of codec driver will be visible to applications -- the mixer interface is different, jack detection works differently (affects e.g. UCM). I guess what this comes down to is that can we just go ahead and make the change, or do we need to add Kconfig option to allow people to opt-in for the new behavior. Latter means we need to keep hdac_hdmi around, and potentially keep the support for both options in all machine drivers as well.
|
@kv2019i wrote:
Ok confirmed with PA developers. This is no longer an issue -> https://lists.freedesktop.org/archives/pulseaudio-discuss/2019-August/031358.html |
https://mailman.alsa-project.org/pipermail/alsa-devel/2019-October/156636.html |
To support the DP-MST multiple streams via single connector feature, the HDMI driver was extended with the concept of backup PCMs. See commit 9152085 ("ALSA: hda - add DP MST audio support"). This implementation works fine with snd_hda_intel.c as PCM topology is fully managed within the single driver. When the HDA codec driver is used from ASoC components, the concept of backup PCMs no longer fits. For ASoC topologies, the physical HDMI converters are presented as backend DAIs and these should match with hardware capabilities. The ASoC topology may define arbitrary PCMs (i.e. frontend DAIs) and have processing elements before eventual routing to the HDMI BE DAIs. With backup PCMs, the link between FE and BE DAIs would become dynamic and change when monitors are (un)plugged. This would lead to modifying the topology every time hotplug events happen, which is not currently possible in ASoC and there does not seem to be any obvious benefits from this design. To overcome above problems and enable the HDMI driver to be used from ASoC, this patch adds a new mode (mst_no_extra_pcms flags) to patch_hdmi.c. In this mode, the codec driver does not assume the backup PCMs to be created. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Handle all HDA codecs using same logic, including HDMI/DP. Call to snd_hda_codec_build_controls() is delayed for HDMI/DP HDA devices. This is needed to discover the PCM device numbers as defined in topology. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
696b039 to
b2ed8e3
Compare
|
Update to v7 @plbossart Do you want to take this via your pull-req, or should I sent a separate v007 mail to alsa-devel and to Mark Update: I made this non-draft in case we decide to merge this via sof-dev. |
Add support for using snd-hda-codec-hdmi driver for HDMI/DP instead of ASoC hdac-hdmi. This is aligned with how other HDA codecs are already handled. When snd-hda-codec-hdmi is used, the PCM device numbers are parsed from card topology and passed to the codec driver. This needs to be done at runtime as topology changes may affect PCM device allocation. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Match the include guard define to actual filename. The source directory now has an actual hda_dsp_common.h header, so the old include guard may cause confusion. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add support to implement HDMI/DP audio by using the common snd-hda-codec-hdmi driver. Change of codec driver affects user-space as the two drivers expose different mixer controls. A new kernel module option "use_common_hdmi" is added to user-space to indicate which interface should be used. The default driver can be selected via a Kconfig option. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add support for using snd-hda-codec-hdmi driver for HDMI/DP instead of ASoC hdac-hdmi. This is aligned with how other HDA codecs are already handled. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add support for using snd-hda-codec-hdmi driver for HDMI/DP instead of ASoC hdac-hdmi. This is aligned with how other HDA codecs are already handled. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add support for using snd-hda-codec-hdmi driver for HDMI/DP instead of ASoC hdac-hdmi. This is aligned with how other HDA codecs are already handled. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add support for using snd-hda-codec-hdmi driver for HDMI/DP instead of ASoC hdac-hdmi. This is aligned with how other HDA codecs are already handled. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add support for using snd-hda-codec-hdmi driver for HDMI/DP instead of ASoC hdac-hdmi. This is aligned with how other HDA codecs are already handled. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
https://mailman.alsa-project.org/pipermail/alsa-devel/2019-October/157201.html |
b2ed8e3 to
e64932b
Compare
|
V8 sent to alsa-devel. I'll stop refreshing the series to this PR and only push incremental changes to keep in sync |
|
@kv2019i we can close this one right? Its upstream and merged to sof-dev too |
Here's patchset to move from hdac-hdmi to snd-hda-codec-hdmi to implement HDMI/DP support.
Two machine drivers (UP^2 with Hifiberry and generic HDA-audio) are updated as example.
Related patch to topology to align the PCM interface with legacy driver: TBD-> topology changes not needed after allImplements #1123
Implements #1078
Fixes #1104
Fixes #1077
Fixes #1375
Event log:
Currently tested:
Open issues list: NONE, no open issues left
higher rate of failures on ICL in regression test-> fixed with V5 series WW39 and display driver patches WW40concept of backup/virtual PCMs used by "dyn-pcm-assign" mode of hda-codec-hdmi does not work well with ASoC, SOF and topologyhow do we pass the "SOF mode" info to hda-codec-hdmi?new hda-codec flag addedchmap ctl registration is brokennaming of some entities should be revisioted (e.g. get rid of the "hifiX" names)-> fixed in v2plan needed how/which machine drivers to update (on need basis, or move over all)compatibility of machine drivers with SST drivertest legacy driver works with the patch_hdmi.c modifications in this set