[alsa-devel] radeon multi-channel lpcm
Hi,
I figured I'd have a go at finishing up support for multi-channel lcpm over HDMI on radeon cards. I read a post from the AMD guys stating that the GPU portions were already in place, and it was the audio pieces that were missing. Unfortunately I was unable to figure out exactly what it is that remains to be done.
I poked around in patch_hdmi.c, and concluded that the generic code is what's being used for modern radeon cards. The card exposes two widgets (and output widget and a pin complex). But both widgets indicate through their capability registers that they only support stereo.
I don't know enough about HDA to have any clue where to go from here. Should the capability field be ignored for HDMI? Or does it need some coaxing to allow more than stereo? The ELD stuff isn't properly updated from the radeon driver, but the code seems to suggest it is just for hints, and not critical.
Rgds
Noone with any insight? I'm ready to do some leg work, but I couldn't find anything in either the HDA specification, or the AMD documentation. :/
On Fri, 31 Aug 2012 22:34:47 +0200 Pierre Ossman pierre-list@ossman.eu wrote:
Hi,
I figured I'd have a go at finishing up support for multi-channel lcpm over HDMI on radeon cards. I read a post from the AMD guys stating that the GPU portions were already in place, and it was the audio pieces that were missing. Unfortunately I was unable to figure out exactly what it is that remains to be done.
I poked around in patch_hdmi.c, and concluded that the generic code is what's being used for modern radeon cards. The card exposes two widgets (and output widget and a pin complex). But both widgets indicate through their capability registers that they only support stereo.
I don't know enough about HDA to have any clue where to go from here. Should the capability field be ignored for HDMI? Or does it need some coaxing to allow more than stereo? The ELD stuff isn't properly updated from the radeon driver, but the code seems to suggest it is just for hints, and not critical.
Rgds
At Wed, 5 Sep 2012 18:19:23 +0200, Pierre Ossman wrote:
Noone with any insight? I'm ready to do some leg work, but I couldn't find anything in either the HDA specification, or the AMD documentation. :/
Well, HD-audio HDMI codec driver just extracts the available channel setup from the given ELD, and the ELD data is sent from the graphics driver. So, if anything missing in ELD, it's supposed to be in the graphics driver side. In other words, if ELD doesn't give 6 channels, HD-audio codec won't follow that channel setup, too.
Takashi
On Fri, 31 Aug 2012 22:34:47 +0200 Pierre Ossman pierre-list@ossman.eu wrote:
Hi,
I figured I'd have a go at finishing up support for multi-channel lcpm over HDMI on radeon cards. I read a post from the AMD guys stating that the GPU portions were already in place, and it was the audio pieces that were missing. Unfortunately I was unable to figure out exactly what it is that remains to be done.
I poked around in patch_hdmi.c, and concluded that the generic code is what's being used for modern radeon cards. The card exposes two widgets (and output widget and a pin complex). But both widgets indicate through their capability registers that they only support stereo.
I don't know enough about HDA to have any clue where to go from here. Should the capability field be ignored for HDMI? Or does it need some coaxing to allow more than stereo? The ELD stuff isn't properly updated from the radeon driver, but the code seems to suggest it is just for hints, and not critical.
Rgds
-- -- Pierre Ossman
WARNING: This correspondence is being monitored by FRA, a Swedish intelligence agency. Make sure your server uses encryption for SMTP traffic and consider using PGP for end-to-end encryption. [1.2 signature.asc <application/pgp-signature (7bit)>]
[2 <text/plain; us-ascii (7bit)>] _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
On Wed, 05 Sep 2012 18:39:01 +0200 Takashi Iwai tiwai@suse.de wrote:
At Wed, 5 Sep 2012 18:19:23 +0200, Pierre Ossman wrote:
Noone with any insight? I'm ready to do some leg work, but I couldn't find anything in either the HDA specification, or the AMD documentation. :/
Well, HD-audio HDMI codec driver just extracts the available channel setup from the given ELD, and the ELD data is sent from the graphics driver. So, if anything missing in ELD, it's supposed to be in the graphics driver side. In other words, if ELD doesn't give 6 channels, HD-audio codec won't follow that channel setup, too.
I see. I got a bit confused by this code though:
/* Restrict capabilities by ELD if this isn't disabled */ if (!static_hdmi_pcm && eld->eld_valid) {
Which made me think that the ELD was just used to make sure you didn't send something the other end couldn't handle. IOW, eld_valid == false would give you all features the hw was capable off.
Some follow up questions, to confirm I haven't confused things:
- The ELD really needs to go into the hardware, not just end up in the hands of the audio driver? IOW, we cannot override this?
- The HDA interface only defines reading the ELD, so writing it would have to be done by the graphics driver using some GPU interface?
If so, I need to poke the AMD guys as I couldn't find any information in the public documentation about writing the ELD.
Thanks
At Wed, 5 Sep 2012 19:22:39 +0200, Pierre Ossman wrote:
On Wed, 05 Sep 2012 18:39:01 +0200 Takashi Iwai tiwai@suse.de wrote:
At Wed, 5 Sep 2012 18:19:23 +0200, Pierre Ossman wrote:
Noone with any insight? I'm ready to do some leg work, but I couldn't find anything in either the HDA specification, or the AMD documentation. :/
Well, HD-audio HDMI codec driver just extracts the available channel setup from the given ELD, and the ELD data is sent from the graphics driver. So, if anything missing in ELD, it's supposed to be in the graphics driver side. In other words, if ELD doesn't give 6 channels, HD-audio codec won't follow that channel setup, too.
I see. I got a bit confused by this code though:
/* Restrict capabilities by ELD if this isn't disabled */ if (!static_hdmi_pcm && eld->eld_valid) {
Which made me think that the ELD was just used to make sure you didn't send something the other end couldn't handle. IOW, eld_valid == false would give you all features the hw was capable off.
Some follow up questions, to confirm I haven't confused things:
- The ELD really needs to go into the hardware, not just end up in the hands of the audio driver? IOW, we cannot override this?
Usually ELD won't go to the hardware as is but translated in a different way in the graphics side.
- The HDA interface only defines reading the ELD, so writing it would have to be done by the graphics driver using some GPU interface?
Yes.
If so, I need to poke the AMD guys as I couldn't find any information in the public documentation about writing the ELD.
It's not about "writing" ELD. If you got no valid ELD, it is the graphics driver who didn't send it. The graphics hardware certainly sends some audio information, and the graphics driver translates into an ELD and notifies to the audio codec. This part is missing or wrongly done, supposedly.
Takashi
Thanks
-- Pierre Ossman
WARNING: This correspondence is being monitored by FRA, a Swedish intelligence agency. Make sure your server uses encryption for SMTP traffic and consider using PGP for end-to-end encryption.
On Thu, 06 Sep 2012 07:59:52 +0200 Takashi Iwai tiwai@suse.de wrote:
At Wed, 5 Sep 2012 19:22:39 +0200, Pierre Ossman wrote:
Some follow up questions, to confirm I haven't confused things:
- The ELD really needs to go into the hardware, not just end up in the hands of the audio driver? IOW, we cannot override this?
Usually ELD won't go to the hardware as is but translated in a different way in the graphics side.
- The HDA interface only defines reading the ELD, so writing it would have to be done by the graphics driver using some GPU interface?
Yes.
If so, I need to poke the AMD guys as I couldn't find any information in the public documentation about writing the ELD.
It's not about "writing" ELD. If you got no valid ELD, it is the graphics driver who didn't send it. The graphics hardware certainly sends some audio information, and the graphics driver translates into an ELD and notifies to the audio codec. This part is missing or wrongly done, supposedly.
I've studied the Intel driver to get some feel for it, and it seems to work like this:
1) The graphics driver gets the EDID data from the GPU.
2) The kernel constructs the ELD structure from the EDID.
3) The graphics driver writes the ELD to some GPU registers.
4) The audio driver reads the ELD via the HDA interface.
But if you're saying that the hardware doesn't really need the ELD, then steps 3-4 could be replaced by a pure software channel. This would be convenient as it is currently unknown how to do 3) on radeon.
(2 is currently missing in the radeon driver, but it is trivial to add AFAICT)
I am a bit confused though. If the hardware doesn't actually look at the ELD, why are the widgets caps not indicating support for 8 channels? Isn't that coming straight from the hardware?
And static_hdmi_pcm is described as "Don't restrict PCM parameters per ELD info", which doesn't seem to be the case as I cannot get more than 2 channels no matter the setting of that parameter.
Rgds
At Thu, 6 Sep 2012 09:09:00 +0200, Pierre Ossman wrote:
On Thu, 06 Sep 2012 07:59:52 +0200 Takashi Iwai tiwai@suse.de wrote:
At Wed, 5 Sep 2012 19:22:39 +0200, Pierre Ossman wrote:
Some follow up questions, to confirm I haven't confused things:
- The ELD really needs to go into the hardware, not just end up in the hands of the audio driver? IOW, we cannot override this?
Usually ELD won't go to the hardware as is but translated in a different way in the graphics side.
- The HDA interface only defines reading the ELD, so writing it would have to be done by the graphics driver using some GPU interface?
Yes.
If so, I need to poke the AMD guys as I couldn't find any information in the public documentation about writing the ELD.
It's not about "writing" ELD. If you got no valid ELD, it is the graphics driver who didn't send it. The graphics hardware certainly sends some audio information, and the graphics driver translates into an ELD and notifies to the audio codec. This part is missing or wrongly done, supposedly.
I've studied the Intel driver to get some feel for it, and it seems to work like this:
The graphics driver gets the EDID data from the GPU.
The kernel constructs the ELD structure from the EDID.
The graphics driver writes the ELD to some GPU registers.
The audio driver reads the ELD via the HDA interface.
But if you're saying that the hardware doesn't really need the ELD, then steps 3-4 could be replaced by a pure software channel.
No, what I meant is about the audio codec perspective. From the audio codec, it has no direct hardware access to GPU that actually handles the ELD register things. It always communicate via HD-audio verbs to send/receive DIP bytes so the actual work is purely in the graphics driver side.
This would be convenient as it is currently unknown how to do 3) on radeon.
(2 is currently missing in the radeon driver, but it is trivial to add AFAICT)
Yeah, that's the big missing piece.
Takashi
On Thu, 06 Sep 2012 09:28:52 +0200 Takashi Iwai tiwai@suse.de wrote:
At Thu, 6 Sep 2012 09:09:00 +0200, Pierre Ossman wrote:
But if you're saying that the hardware doesn't really need the ELD, then steps 3-4 could be replaced by a pure software channel.
No, what I meant is about the audio codec perspective. From the audio codec, it has no direct hardware access to GPU that actually handles the ELD register things. It always communicate via HD-audio verbs to send/receive DIP bytes so the actual work is purely in the graphics driver side.
I assume "codec" here is in the HDA sense, as in the hardware hiding somewhere behind the HDA interface.
In the Intel case, I'd say the audio hardware as a whole does have some back channel to the GPU since a write to a GPU register somehow results in data in the audio hardware. But yes, it would be a purely graphics driver thing as it has both the ELD, and access to the registers you can write to.
I'm working on the assumption that the radeon hardware works in similar fashion as the Intel ones.
This would be convenient as it is currently unknown how to do 3) on radeon.
(2 is currently missing in the radeon driver, but it is trivial to add AFAICT)
Yeah, that's the big missing piece.
So I'll go poke the AMD people, as I cannot find anything in the public docs about ELD registers. Hopefully it's not something that's still classified... :/
Thanks
participants (2)
-
Pierre Ossman
-
Takashi Iwai