[alsa-devel] Linking ALSA playback devices and DRM connectors

Koenig, Christian Christian.Koenig at amd.com
Thu Jun 6 11:20:13 CEST 2019


Am 06.06.19 um 11:13 schrieb Ser, Simon:
> On Tue, 2019-06-04 at 17:15 +0200, Christian König wrote:
>> Am 04.06.19 um 17:05 schrieb Ser, Simon:
>>> Hi,
>>>
>>> I'm trying to link ALSA playback devices and DRM connectors. In other
>>> words, I'd like to be able to know which ALSA device I should open to
>>> play audio on a given connector.
>>>
>>> Unfortunately, I haven't found a way to extract this information. I
>>> know /proc/asound/cardN/eld* expose the EDID-like data. However by
>>> looking at the ALSA API (also: aplay -l and -L) I can't find a way to
>>> figure out which PCM device maps to the ELD.
>>>
>>> Am I missing something?
>> Is that actually fixed on all hardware? Or do we maybe have some
>> hardware with only one audio codec and multiple connectors?
>>
>>> If not, what would be the best way to expose this?
>>>
>>> - A symlink to the ALSA audio PCM device in
>>>     /sys/class/drm/cardN-CONNECTOR?
>>> - A symlink to the DRM connector in /sys/class/sound/pcm*?
>> If it's fixed than those two options sound sane to me.
>>
>>> - A DRM connector property?
>> If it's configurable than that sounds like a good option to me.
> I'm still not sure whether this is fixed on all hardware or not.

Well from reading up on the thread I think the answer is that this is 
NOT fixed.

At least from AMD hardware I know that the original R600 had only one 
audio codec which could be routed to multiple HDMI connectors at the 
same time.

And I understand the reply about MST so that you can even have multiple 
streams over the same codec routed to different connectors.

Christian.

>
> Ville, on this old Intel hw, is the single connector that gets the
> audio configurable?
>
> Additional thought: since I need this for the IGT test suite I don't
> really care how this info is exposed as long as it's exposed, but other
> userspace programs (DEs) are probably interested in this information
> too. This would allow users to actually have the name of the monitor in
> the audio output selection UI. Having something that doesn't depend on
> sysfs would be better for this.
>
> Would there be a way to expose some info about the monitor in the ALSA
> API?
>
>> Anyway added our DC team, stuff like that is their construction site.
>>
>> Regards,
>> Christian.
>>
>>> - Somehow expose the connector name via the ALSA API?
>>> - Expose the connector EDID via ALSA?
>>> - Other ideas?
>>>
>>> Thanks!
>>>
>>> Simon Ser
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel at lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel



More information about the Alsa-devel mailing list