Linking ALSA playback devices and DRM connectors
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?
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*?
- A DRM connector property?
- Somehow expose the connector name via the ALSA API?
- Expose the connector EDID via ALSA?
- Other ideas?
Thanks!
Simon Ser
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 04.06.19 um 17:05 schrieb Ser, Simon:
Quoted 6 lines
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.
Quoted 6 lines
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?
Quoted 6 lines
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.
Quoted 1 line
- A DRM connector property?
If it's configurable than that sounds like a good option to me.
Anyway added our DC team, stuff like that is their construction site.
Regards,
Christian.
Quoted 11 lines
- Somehow expose the connector name via the ALSA API?
- Expose the connector EDID via ALSA?
- Other ideas?Thanks!
Simon Ser
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 27 lines · Christian König
Am 04.06.19 um 17:05 schrieb Ser, Simon:
Quoted 6 lines
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.
Quoted 6 lines
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?
Quoted 6 lines
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.
Quoted 12 lines
Quoted 1 line
- A DRM connector property?
If it's configurable than that sounds like a good option to me.
Anyway added our DC team, stuff like that is their construction site.
Regards,
Christian.Quoted 3 lines
- Somehow expose the connector name via the ALSA API?
- Expose the connector EDID via ALSA?
- Other ideas?
I think on our MST hw you get a combination of CRTCs x CONNECTORs on the alsa side. I.e. for every pair of connector and crtc you get a separate alsa pin. This is because with mst, you could have up to num_crtcs streams on a single connector. Not sure how to model that.
Bigger question: How do you want to make the cooperation happen? There's been some ideas floating about making the hdmi connection between drm and alsa somehow represented in the code, but nothing ever really happened. there's drm_audio_component.h, but that's just the interface, it doesn't really solve how to make the connection. Also only used by i915/hda.
-Daniel
Quoted 12 lines
Quoted 7 lines
Thanks!
Simon Ser
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 15 lines · Daniel Vetter
Quoted 13 lines · Christian König
Am 04.06.19 um 17:05 schrieb Ser, Simon:
Quoted 11 lines
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.
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
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?
Certain old i915 hardware is like that. You can drive multiple HDMI connectors at once but only one of them can get the audio. If you try to output audio to multiple ports at once you get no audio whatsoever. ATM we don't really handle that case properly.
Quoted 19 lines
Quoted 19 lines
Quoted 7 lines
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.
Quoted 1 line
- A DRM connector property?
If it's configurable than that sounds like a good option to me.
Anyway added our DC team, stuff like that is their construction site.
Regards,
Christian.
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
- Somehow expose the connector name via the ALSA API?
- Expose the connector EDID via ALSA?
- Other ideas?I think on our MST hw you get a combination of CRTCs x CONNECTORs on the alsa side. I.e. for every pair of connector and crtc you get a separate alsa pin. This is because with mst, you could have up to
num_crtcsstreams on a single connector. Not sure how to model that.
IIRC the current i915 vs. alsa model is that for SST/HDMI you have a 1:1 relationship between the port and the pcm device, but with MST you nave a 1:1 relationship between the pipe and the pcm device.
I think the only way to have any kind of static connector<->pcm relationship with MST would involve dynamically adding/removing pcm devices when the correcponding drm connector is added/removed. If we don't want to/can't add such pcm devices then we'd need to dynamically change the symlinks/whatever whenever an MST stream is started/stopped. And probably we should do the same for SST/HDMI as well, if for no other reason than to make sure userspace is prepared for it even if they didn't test with MST.
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 60 lines · Ville Syrjälä
Quoted 15 lines · Daniel Vetter
Quoted 13 lines · Christian König
Am 04.06.19 um 17:05 schrieb Ser, Simon:
Quoted 11 lines
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.Quoted 4 lines
Quoted 4 lines
Quoted 1 line
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?
Certain old i915 hardware is like that. You can drive multiple HDMI connectors at once but only one of them can get the audio. If you try to output audio to multiple ports at once you get no audio whatsoever. ATM we don't really handle that case properly.
Quoted 19 lines
Quoted 19 lines
Quoted 7 lines
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.
Quoted 1 line
- A DRM connector property?
If it's configurable than that sounds like a good option to me.
Anyway added our DC team, stuff like that is their construction site.
Regards,
Christian.Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
- Somehow expose the connector name via the ALSA API?
- Expose the connector EDID via ALSA?
- Other ideas?I think on our MST hw you get a combination of CRTCs x CONNECTORs on the alsa side. I.e. for every pair of connector and crtc you get a separate alsa pin. This is because with mst, you could have up to
num_crtcsstreams on a single connector. Not sure how to model that.IIRC the current i915 vs. alsa model is that for SST/HDMI you have a 1:1 relationship between the port and the pcm device, but with MST you nave a 1:1 relationship between the pipe and the pcm device.
Quoted 8 lines
I think the only way to have any kind of static connector<->pcm relationship with MST would involve dynamically adding/removing pcm devices when the correcponding drm connector is added/removed. If we don't want to/can't add such pcm devices then we'd need to dynamically change the symlinks/whatever whenever an MST stream is started/stopped. And probably we should do the same for SST/HDMI as well, if for no other reason than to make sure userspace is prepared for it even if they didn't test with MST.
The idea with the dynamic PCM device creation pops up occasionally, but it never flies. The biggest reason so far is the support of PulseAudio and others; although PA can deal with the hotplug *card* device, the devices below the card level aren't managed dynamically, hence the dynamic creation of PCM device doesn't work for them.
From API POV, the cleanest way would be to provide some information
over ALSA control element for each PCM stream that indicates the corresponding DRM connector. But other methods shouldn't be too hard to implement -- once when we have a certain way to obtain the DRM connector / PCM relationship :)
thanks,
Takashi
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 36 lines · Daniel Vetter
Quoted 34 lines · Christian König
Am 04.06.19 um 17:05 schrieb Ser, Simon:
Quoted 6 lines
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.
Quoted 6 lines
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?
Quoted 5 lines
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.
Quoted 1 line
- A DRM connector property?
If it's configurable than that sounds like a good option to me.
Anyway added our DC team, stuff like that is their construction site.
Regards,
Christian.
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
- Somehow expose the connector name via the ALSA API?
- Expose the connector EDID via ALSA?
- Other ideas?I think on our MST hw you get a combination of CRTCs x CONNECTORs on the alsa side. I.e. for every pair of connector and crtc you get a separate alsa pin. This is because with mst, you could have up to
num_crtcsstreams on a single connector. Not sure how to model that.
I assume this means "up to num_crtcs streams an a physical connector". With MST a physical connector can back more than one DRM connector.
Quoted 6 lines
Bigger question: How do you want to make the cooperation happen? There's been some ideas floating about making the hdmi connection between drm and alsa somehow represented in the code, but nothing ever really happened. there's
drm_audio_component.h, but that's just the interface, it doesn't really solve how to make the connection. Also only used by i915/hda.
To be completely honest I have no idea. That's why I sent this e- mail. :P
Indeed, it seems that the interface isn't enough (get_eld and pin2port are interesting though).
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Thanks!
Simon Ser
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 6 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 23 lines · Christian König
Am 04.06.19 um 17:05 schrieb Ser, Simon:
Quoted 6 lines
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.
Quoted 6 lines
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?
Quoted 5 lines
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*?
Quoted 5 lines
If it's fixed than those two options sound sane to me.
Quoted 1 line
- 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.
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?
Quoted 16 lines
Anyway added our DC team, stuff like that is their construction site.
Regards,
Christian.Quoted 11 lines
- Somehow expose the connector name via the ALSA API?
- Expose the connector EDID via ALSA?
- Other ideas?Thanks!
Simon Ser
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 06.06.19 um 11:13 schrieb Ser, Simon:
Quoted 19 lines · Christian König
Quoted 18 lines
Am 04.06.19 um 17:05 schrieb Ser, Simon:
Quoted 6 lines
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.
Quoted 6 lines
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?
Quoted 2 lines
If not, what would be the best way to expose this?
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
- 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.
Quoted 1 line
- 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.
Quoted 11 lines
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.
Quoted 19 lines
Would there be a way to expose some info about the monitor in the ALSA API?
Quoted 16 lines
Anyway added our DC team, stuff like that is their construction site.
Regards,
Christian.Quoted 11 lines
- Somehow expose the connector name via the ALSA API?
- Expose the connector EDID via ALSA?
- Other ideas?Thanks!
Simon Ser
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 26 lines · Simon
Quoted 25 lines · Christian König
Am 04.06.19 um 17:05 schrieb Ser, Simon:
Quoted 6 lines
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.
Quoted 6 lines
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?
Quoted 5 lines
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.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
- 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.
Ville, on this old Intel hw, is the single connector that gets the audio configurable?
The force-audio property can be used for that. That is, you can force audio off for all the connector where you don't want audio and then it should get automagically routed to the remaining connector.
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel