alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Anssi Hannula <anssi.hannula@iki.fi>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Takashi Iwai <tiwai@suse.de>,
	alsa-devel@alsa-project.org,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/radeon/audio: fix missing multichannel PCM SAD in some cases
Date: Fri, 01 Nov 2013 01:52:52 +0200	[thread overview]
Message-ID: <5272ED54.2020400@iki.fi> (raw)
In-Reply-To: <CACna6rzvZd-6s5gBLJnqFUfBCQuSKgCmJ7mNPhaEGuPscfxqqA@mail.gmail.com>

01.11.2013 01:38, Rafał Miłecki kirjoitti:
> 2013/10/29 Anssi Hannula <anssi.hannula@iki.fi>:
>> Because of this, only the 2-channel SAD may be used if it appears before
>> the 8-channel SAD. Unless other SADs require otherwise, this may cause
>> the ALSA HDA driver to allow stereo playback only.
> 
> I can confirm that the problem exists. My SADs (Onkyo TX-SR605):
> Format: 1 (PCM)        Channels:1    Freq:0x7F (32-192)    B2:0x07 (16-24b)
> Format: 1 (PCM)        Channels:7    Freq:0x7F (32-192)    B2:0x07 (16-24b)
> Format: 2 (AC3)        Channels:7    Freq:0x07 (32-48)    B2:0x50 (640?)
> Format: 7 (DTS)        Channels:7    Freq:0x06 (44-48)    B2:0xC0 (1536?)
> Format: 10 (EAC3)    Channels:7    Freq:0x06 (44-48)    B2:0x00
> Format: 11 (DTS_HD)    Channels:7    Freq:0x7E (44-192)    B2:0x01
> Format: 12 (MLP)    Channels:7    Freq:0x1E (44-96)    B2:0x00
> 
> Unfortunately I get only 1 emulated SAD entry for PCM
> (/proc/asound/card1/eld#0.0):
> sad0_coding_type        [0x1] LPCM
> sad0_channels           2
> sad0_rates              [0x1ee0] 32000 44100 48000 88200 96000 176400 192000
> sad0_bits               [0xe0000] 16 20 24
> 
> So I can not play 8 channel LPCM "legally" (without forcing player to do so).
> 
> 
>> Fix the code to pick the PCM SAD with the highest number of channels,
>> while merging the rate masks of PCM SADs with lower amount of channels
>> into the additional stereo rate mask byte.
> 
> Does it mean that now instead of 2 real SADs:
> 1) 192kHz support for 2 channels
> 2) 96kHz support for 8 channels
> you will only get:
> 1) 192kHz support for 8 channels
> ?

No, the SADs will be separated again by the ATI/AMD ELD generator in
hda_eld.c (as the 4th byte in the register contains the PCM stereo rate
mask).

I.e., assuming a receiver with 96kHz PCM multichannel limitation, with
the patch the video-side sets the three standard SAD bytes according to
the SAD with the highest number of channels (8ch+96kHz+24b), and the
extra byte contains the or'ed rate mask of all PCM SADs (i.e. 192kHz).
The audio-side then notices that 96kHz (in SAD) != 192kHz (in extra
byte) and generates two SADs, one with 8ch 96kHz and one with 2ch 192kHz.

> Does it mean alsa may try to play 8channels audio at 192kHz and fail at this?
> That doesn't sound good, but on the other hand I can't propose
> anything better :|

Well, ALSA does not restrict that currently in any case (the ALSA HDMI
code currently only takes the maximum channels/rate/etc into account, it
doesn't check if the specific combination is allowed by SADs), but that
is mostly just because nobody has added such code yet.

> Out of curiosity, what does fglrx set in the verbs?

I don't know, though I'd expect it to put the same values that get put
there with this patch.

>> Technically there are even more cases to handle (multiple non-PCM SADs
>> of the same type, more than two PCM SADs with varying channel counts,
>> etc), but those have not actually been encountered in the field and
>> handling them would be non-trivial.
>>
>> Example affected EDID from Onkyo TX-SR674 specifying 192kHz stereo
>> support and 96kHz 8-channel support (and other 8-channel compressed
>> formats):
> 

-- 
Anssi Hannula
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2013-10-31 23:52 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 18:10 [PATCH v3 0/5] ALSA: hda - hdmi: ATI/AMD multi-channel and HBR support Anssi Hannula
2013-10-24 18:10 ` [PATCH 1/5] ALSA: hda - hdmi: Allow HDA patches to customize more operations Anssi Hannula
2013-10-24 18:10 ` [PATCH 2/5] ALSA: hda - hdmi: Add ATI/AMD multi-channel audio support Anssi Hannula
2013-10-24 18:10 ` [PATCH 3/5] ALSA: hda - hdmi: Add ELD emulation for ATI/AMD codecs Anssi Hannula
2013-10-24 18:10 ` [PATCH 4/5] ALSA: hda - hdmi: Add HBR bitstreaming support for ATI/AMD HDMI codecs Anssi Hannula
2013-10-24 18:10 ` [PATCH 5/5] ALSA: hda - hdmi: Disable ramp-up/down for non-PCM on AMD codecs Anssi Hannula
2013-10-24 19:00   ` Anssi Hannula
2013-10-24 18:26 ` [PATCH v3 0/5] ALSA: hda - hdmi: ATI/AMD multi-channel and HBR support Anssi Hannula
2013-11-08  5:08   ` Olivier Langlois
2013-11-08 10:27     ` Anssi Hannula
2013-11-08 18:17       ` Olivier Langlois
2013-11-08 21:28         ` Olivier Langlois
2013-11-08 22:03           ` Anssi Hannula
2013-11-10  5:42             ` Olivier Langlois
2013-11-10  6:01               ` Anssi Hannula
2013-11-10  7:25                 ` speaker-test chmap bugs (was: [PATCH v3 0/5] ALSA: hda - hdmi: ATI/AMD multi-channel and HBR support) Anssi Hannula
2013-11-10 18:29                   ` [PATCH 1/3] speaker-test: Fix chmapped channel selection without specified chmap Anssi Hannula
2013-11-10 18:29                     ` [PATCH 2/3] speaker-test: Always show chmap channel names if available Anssi Hannula
2013-11-10 18:29                     ` [PATCH 3/3] speaker-test: Show out-of-chmap channels as Unknown Anssi Hannula
2013-11-11 15:56                     ` [PATCH 1/3] speaker-test: Fix chmapped channel selection without specified chmap Takashi Iwai
2013-11-11 20:23                       ` Anssi Hannula
2013-11-11 22:04                         ` [PATCH 1/3 v2] " Anssi Hannula
2013-11-12  8:11                           ` Takashi Iwai
2013-11-12 12:34                             ` Anssi Hannula
2013-11-12 13:08                               ` Takashi Iwai
2013-11-12  6:35                 ` [PATCH v3 0/5] ALSA: hda - hdmi: ATI/AMD multi-channel and HBR support Olivier Langlois
2013-11-14  0:04                   ` Anssi Hannula
2013-11-09  8:35         ` Takashi Iwai
2013-10-24 23:04 ` Takashi Iwai
2013-10-25 16:54   ` Andre Heider
2013-10-25 17:13     ` Takashi Iwai
2013-10-25 17:23     ` Anssi Hannula
2013-10-25 18:25       ` Andre Heider
2013-10-28 17:52       ` Andre Heider
2013-10-28 18:12         ` Anssi Hannula
2013-10-28 18:17           ` Andre Heider
2013-10-28 18:25             ` Anssi Hannula
2013-10-28 18:35               ` Andre Heider
2013-10-28 20:35                 ` Anssi Hannula
2013-10-28 22:00                   ` Andre Heider
2013-10-28 22:42                     ` Anssi Hannula
2013-10-28 23:15                       ` Andre Heider
2013-10-29 19:52                         ` LANGLOIS Olivier PIS -EXT
2013-10-29 20:30                           ` Anssi Hannula
2013-10-28 23:19                       ` [PATCH] drm/radeon/audio: fix missing multichannel PCM SAD in some cases Anssi Hannula
2013-10-31 23:38                         ` Rafał Miłecki
2013-10-31 23:46                           ` Rafał Miłecki
2013-10-31 23:52                           ` Anssi Hannula [this message]
2013-11-02  1:01                         ` Rafał Miłecki
2013-11-02  1:08                           ` Anssi Hannula
2013-11-02  1:15                             ` Rafał Miłecki
2013-11-02  1:03                         ` Rafał Miłecki
2013-11-02 15:32 ` [PATCH v3 0/5] ALSA: hda - hdmi: ATI/AMD multi-channel and HBR support Anssi Hannula
2013-11-23  1:05 ` James Le Cuirot
2013-11-23  1:29   ` Anssi Hannula
2013-11-23 15:40     ` James Le Cuirot
2013-11-23 15:45       ` Anssi Hannula
2013-11-24 14:57         ` James Le Cuirot
2013-11-25 13:20           ` Anssi Hannula
2013-11-25 14:32             ` James Le Cuirot
2013-11-25 14:56               ` Anssi Hannula
2014-05-13 12:01                 ` James Le Cuirot
2014-05-13 12:27                   ` Anssi Hannula
2014-05-13 16:16                     ` James Le Cuirot
2014-05-13 21:10                       ` James Le Cuirot
2014-05-13 21:50                         ` Anssi Hannula
2014-05-14 13:04                           ` Deucher, Alexander
2014-05-14 13:19                             ` James Le Cuirot
2013-11-25 15:07   ` Raymond Yau
2013-11-25 15:32     ` James Le Cuirot
2013-11-25 19:35     ` Anssi Hannula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5272ED54.2020400@iki.fi \
    --to=anssi.hannula@iki.fi \
    --cc=alexander.deucher@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=tiwai@suse.de \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).