alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Raymond Yau <superquad.vortex2@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [RFC] Fix for conflict of HDMI and SPDIF IEC958 controls
Date: Mon, 15 Oct 2012 16:49:58 +0800	[thread overview]
Message-ID: <CAN8ccibBdGqPnkb06SV3EW1RukmBAKdbiLV1hsaLNTVMbU5EKw@mail.gmail.com> (raw)
In-Reply-To: <s5hvcect9nl.wl%tiwai@suse.de>

2012-10-15 下午4:35 於 "Takashi Iwai" <tiwai@suse.de> 寫道:
>
> At Mon, 15 Oct 2012 16:15:20 +0800,
> Raymond Yau wrote:
> >
> > 2012-10-15 下午3:46 於 "Takashi Iwai" <tiwai@suse.de> 寫道:
> > >
> > > At Mon, 15 Oct 2012 10:31:50 +0800,
> > > Raymond Yau wrote:
> > > >
> > > > 2012-10-12 下午11:19 於 "Takashi Iwai" <tiwai@suse.de> 寫道:
> > > > >
> > > > > Hi,
> > > > >
> > > > > there is a long-standing problem in HD-audio regarding IEC958
> > > > > controls.  When both an SPDIF and an HDMI are created on the same
> > > > > card (e.g. one from analog codec and one from graphics chip), the
> > > > > driver assigns the IEC958 controls just with new indices, 0, 1,
2...
> > > > >
> > > > > The problem is that there is no way to connect between this index
and
> > > > > the actual PCM device.  Currently, alsa-lib HDA-Intel.conf has a
fixed
> > > > > configuration:
> > > > >   spdif  -> IEC958 xxx index=0, PCM dev=1
> > > > >   hdmi,0 -> IEC958 xxx index=0, PCM dev=3
> > > > >   hdmi,1 -> IEC958 xxx index=1, PCM dev=7
> > > > >   hdmi,2 -> IEC958 xxx index=2, PCM dev=8
> > > > >   hdmi,3 -> IEC958 xxx index=3, PCM dev=9
> > > > >
> > > > > So obviously spdif and the first hdmi conflict.
> > > > >
> > > > > Basically this can be fixed by reassigning each IEC958 control
with
> > > > > the same device number corresponding to the PCM device.  That is,
for
> > > > > SPDIF, assign a control element with device=1, for HDMI,
> > > > > device=3,7...
> > > > > However, this obviously breaks the old configuration unless user
> > > > > upgrades the alsa-lib configuration.  Thus this is no-go.
> > > > >
> > > > > Now here is a compromise: the IEC958 control for SPDIF is
reassigned
> > > > > to device=1 *only* when SPDIF and HDMI coexist.  Since the
> > > > > configuration is anyway broken as is now in such a case, it's no
big
> > > > > deal to fix one side in an incompatible way.  (The reason why
SPDIF
> > > > > is re-assigned is that I guess majority of user require more HDMI
than
> > > > > SPDIF in such a configuration.)
> > > > >
> > > > > In addition, we need a fix in alsa-lib.  Also not for breaking the
> > > > > compatibility with older kernel, we need some fallback check.  I
did a
> > > > > quick hack to alsa-lib conf code and added "skip_rest" option to
the
> > > > > hook element, so that only the first matching element is taken.
> > > >
> > > > how about those hdmi jack and iec958 on ad1989b?
> > >
> > > On AD codecs, all digital outputs are exposed as a single cloned
> > > device with HDA_PCM_TYPE_SPDIF.
> >
> > how about ad1988b with nvidia codec ?
>
> Nvidia codec provides devices only with HDA_PCM_TYPE_HDMI, of course.
>
> > from user point of view , how can they differenitate hdmi jack is
digital
> > ouput and hdmi output ?
>
> The device 1 is from AD and the device 3 is from Nvidia codec, as you
> can see below.  And this is exactly the case the conflict happens as I
> mentioned in the original mail.

will your fix change the spdif of  those motherboard with ad1988b which
have iec958 but no hdmi jack ?

the current implementation does not expose the number of output streams
supported by the hda controller

ich8 seem support 4 ouput streams , how many output streams supported by
the nvidia controller

>
> Which is connected to what output, you can't know exactly unless you
> compare the obtained ELD.  The HD-audio spec isn't good enough to
> identify the actual output.

it seem that there is no presence detect on this codec

Codec: Nvidia MCP77/78 HDMI
Address: 3
AFG Function Id: 0x1 (unsol 0)
Vendor Id: 0x10de0002
Subsystem Id: 0x10de0101
Revision Id: 0x100000
No Modem Function Group found
Default PCM:
    rates [0x0]:
    bits [0x0]:
    formats [0x0]:
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
GPIO: io=0, o=0, i=0, unsolicited=0, wake=0
Node 0x04 [Audio Output] wcaps 0x211: Stereo Digital
  Control: name="IEC958 Playback Con Mask", index=1, device=0
  Control: name="IEC958 Playback Pro Mask", index=1, device=0
  Control: name="IEC958 Playback Default", index=1, device=0
  Control: name="IEC958 Playback Switch", index=1, device=0
  Device: name="HDMI 0", type="HDMI", device=3
  Converter: stream=0, channel=0
  Digital:
  Digital category: 0x0
  PCM:
    rates [0xc0]: 48000 88200
    bits [0xf]: 8 16 20 24
    formats [0x1]: PCM
Node 0x05 [Pin Complex] wcaps 0x400381: Stereo Digital
  Pincap 0x00000014: OUT Detect
  Pin Default 0x18560110: [Jack] Digital Out at Int HDMI
    Conn = Digital, Color = Unknown
    DefAssociation = 0x1, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=00, enabled=0
  Connection: 1
     0x04

>
>
> Takashi
>
>
> > https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/881826
> >
> > **** List of PLAYBACK Hardware Devices ****
> > card 0: NVidia [HDA NVidia], device 0: AD198x Analog [AD198x Analog]
> >   Subdevices: 1/1
> >   Subdevice #0: subdevice #0
> > card 0: NVidia [HDA NVidia], device 1: AD198x Digital [AD198x Digital]
> >   Subdevices: 1/1
> >   Subdevice #0: subdevice #0
> > card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
> >   Subdevices: 1/1
> >   Subdevice #0: subdevice #0
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2012-10-15  8:49 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 15:18 [RFC] Fix for conflict of HDMI and SPDIF IEC958 controls Takashi Iwai
2012-10-12 15:24 ` [PATCH RFC] ALSA: hda - Add workaround for conflicting " Takashi Iwai
2012-10-17  8:17   ` Takashi Iwai
2012-10-17 12:43     ` Raymond Yau
2012-10-17 12:44       ` Takashi Iwai
2013-02-08 22:44   ` [PATCH] ALSA: hda - Fix the " Anssi Hannula
2013-02-10 10:38     ` Takashi Iwai
2013-02-10 11:05       ` Anssi Hannula
2013-02-11 10:51         ` Takashi Iwai
2013-02-11 11:20           ` Anssi Hannula
2013-02-11 11:28             ` Takashi Iwai
2013-02-12 15:51               ` Anssi Hannula
2013-02-12 17:40                 ` Takashi Iwai
2012-10-12 15:25 ` [PATCH RFC 1/2] control: Simplify using snd_config_get_bool() Takashi Iwai
2012-10-12 15:25 ` [PATCH RFC 2/2] Add workaround for conflicting IEC958 controls for HD-audio Takashi Iwai
2013-02-03 16:40   ` Anssi Hannula
2013-02-04  9:34     ` Takashi Iwai
2012-10-15  2:31 ` [RFC] Fix for conflict of HDMI and SPDIF IEC958 controls Raymond Yau
2012-10-15  7:46   ` Takashi Iwai
2012-10-15  8:15     ` Raymond Yau
2012-10-15  8:35       ` Takashi Iwai
2012-10-15  8:49         ` Raymond Yau [this message]
2012-10-15  8:55           ` Takashi Iwai
     [not found]             ` <CAN8ccib4Z9VpHcdGxP3q5kofikU6zt6risGDAbOBiRKyKVcsxA@mail.gmail.com>
     [not found]               ` <CAN8cciY0TfZ+50EuoYbFdz1AzgNuDKZAaDE-o0v-YD_MpXnO1g@mail.gmail.com>
2012-10-15 13:10                 ` Raymond Yau
2012-10-15 13:20                   ` Takashi Iwai
2012-10-15 10:09 ` David Henningsson
2012-10-15 10:18   ` Takashi Iwai
2012-10-15 10:58     ` David Henningsson
2012-10-15 10:21 ` Jaroslav Kysela
2012-10-15 10:31   ` Takashi Iwai
2012-10-15 11:11     ` Jaroslav Kysela
2012-10-15 12:06       ` Takashi Iwai

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=CAN8ccibBdGqPnkb06SV3EW1RukmBAKdbiLV1hsaLNTVMbU5EKw@mail.gmail.com \
    --to=superquad.vortex2@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /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).