[Intel-gfx] HDMI audio to support extcon

Yang, Libin libin.yang at intel.com
Tue May 16 01:35:49 UTC 2017


>-----Original Message-----
>From: Daniel Vetter [mailto:daniel.vetter at ffwll.ch] On Behalf Of Daniel Vetter
>Sent: Monday, May 15, 2017 9:49 PM
>To: Yang, Libin <libin.yang at intel.com>
>Cc: Vetter, Daniel <daniel.vetter at intel.com>; Bossart, Pierre-louis <pierre-
>louis.bossart at intel.com>; jani.nikula at linux.intel.com; intel-
>gfx at lists.freedesktop.org; Girdwood, Liam R <liam.r.girdwood at intel.com>;
>DRI Development <dri-devel at lists.freedesktop.org>
>Subject: Re: [Intel-gfx] HDMI audio to support extcon
>
>Adding dri-devel.
>
>On Mon, May 15, 2017 at 08:16:44AM +0000, Yang, Libin wrote:
>> Hi Daniel,
>>
>> >-----Original Message-----
>> >From: Vetter, Daniel
>> >Sent: Friday, May 12, 2017 2:06 AM
>> >To: Bossart, Pierre-louis <pierre-louis.bossart at intel.com>; Yang,
>> >Libin <libin.yang at intel.com>; jani.nikula at linux.intel.com
>> >Cc: Girdwood, Liam R <liam.r.girdwood at intel.com>; Lin, Mengdong
>> ><mengdong.lin at intel.com>
>> >Subject: Re: HDMI audio to support extcon
>> >
>> >On Thu, 2017-05-11 at 11:13 -0500, Pierre-louis Bossart wrote:
>> >> On 5/11/17 9:41 AM, Yang, Libin wrote:
>> >> > > -----Original Message-----
>> >> > > From: Jani Nikula [mailto:jani.nikula at linux.intel.com]
>> >> > > Sent: Thursday, May 11, 2017 4:29 PM
>> >> > > To: Yang, Libin <libin.yang at intel.com>; Vetter, Daniel
>> >> > > <daniel.vetter at intel.com>
>> >> > > Cc: Bossart, Pierre-louis <pierre-louis.bossart at intel.com>;
>> >> > > Lin, Mengdong <mengdong.lin at intel.com>; Girdwood, Liam R
>> >> > > <liam.r.girdwood at intel .com>
>> >> > > Subject: Re: HDMI audio to support extcon
>> >> > >
>> >> > > On Thu, 11 May 2017, "Yang, Libin" <libin.yang at intel.com> wrote:
>> >> > > > Hi Daniel & Jani,
>> >> > > >
>> >> > > > Currently Pierre and I are trying to enabling extcon for HDMI
>> >> > > > audio, which
>> >> > >
>> >> > > will be used in Android for the hotplug event notification.
>> >> > >
>> >> > > What's "extcon"?
>> >> >
>> >> > Extcon is used by kernel to communicate with userspace. It tries
>> >> > to replace switch class (switch class is a legacy method to
>> >> > communicate with userspace in Android). The code is located in
>> >> > drivers/extcon/*
>> >>
>> >> Most Android kernels are ancient (3.10 to 3.18) and use an
>> >> Android-specific switch class implemented in the kernel, the
>> >> uevents are then used by AOSP to enable HDMI outputs. See
>> >>
>> >https://android.googlesource.com/platform/frameworks/base/+/0e2d281
>/s
>> >> ervices/java/com/android/server/WiredAccessoryManager.java#348
>> >>
>> >> For Android-IA we are using 4.9 and we'd like to move forward with
>> >> the extcon solution which part of the mainline kernel. The extcon
>> >> api relies on a registration and a state which set/unset when the
>> >> external device is hot-plugged/removed. The change in state
>> >> generates the uevents required by Android.When the CONFIG_ANDROID
>> >> is defined, the kernel creates a /sys/class/switch symlink which is
>> >> backwards compatible with what Android can parse.
>> >>
>> >> The question is where do we put the extcon registration 1. in the
>> >> i915 code (e.g. in intel_codec_enable()/disable()) 2. in the
>> >> HDaudio and LPEaudio code (two locations to maintain)
>> >>
>> >> Ideally we'd like to add information on ports to userspace so that
>> >> multiple outputs can be enabled. Currently Android can only support
>> >> one output since it doesn't get additional information.
>> >>
>> >> Does this help frame the problem statement?
>> >
>> >Yay for reinventing wheels in Android I guess (we have hotplug
>> >notifications since forever in drm ofc), but so be it. I think the
>> >right way to do this is to wire this into the generic drm output
>> >probe helpers in drm_probe_helpers.c, perhaps filtered to only handle
>HDMI (or whatever it is Android wants).
>>
>> The extcon implementation may be related to our hardware. For example,
>> it depends on the DDI port number and audio capability. I'm not sure
>> it is OK to implement it in drm level.
>
>Why does it depend upon the DDI port and stuff like that? Do we need to
>make sure that the extcon id somehow lines up with the port on the sound
>side, or is just having a link between the drm connector and sound port
>enough?

Each DDI port should have an interface to the userspace if it has audio
capability. This means we need check the DDI port firstly. And then
we will export the extcon interface to the userspace. This should be
hardware dependent? What's more, to make extcon more powerful,
I'm planning to extend the extcon function with acomp, so we can 
notify the userspace which PCM will be impacted on the hotplug events.

Regards,
Libin

>
>Not sure where exactly the problem is here, but I also wasn't involved in the
>extcon discussions. Please explain.
>-Daniel
>--
>Daniel Vetter
>Software Engineer, Intel Corporation
>http://blog.ffwll.ch


More information about the dri-devel mailing list