1. 08 7月, 2014 1 次提交
  2. 23 6月, 2014 1 次提交
  3. 12 6月, 2014 1 次提交
    • M
      ALSA: hda - verify pin:converter connection on unsol event for HSW and VLV · b4f75aea
      Mengdong Lin 提交于
      This patch will verify the pin's coverter selection for an active stream
      when an unsol event reports this pin becomes available again after a display
      mode change or hot-plug event.
      
      For Haswell+ and Valleyview: display mode change or hot-plug can change the
      transcoder:port connection and make all the involved audio pins share the 1st
      converter. So the stream using 1st convertor will flow to multiple pins
      but active streams using other converters will fail. This workaround
      is to assure the pin selects the right conveter and an assigned converter is
      not shared by other unused pins.
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      b4f75aea
  4. 20 5月, 2014 1 次提交
  5. 13 5月, 2014 1 次提交
  6. 05 5月, 2014 2 次提交
    • A
      ALSA: hda - hdmi: Set infoframe and channel mapping even without sink · 561a7d6e
      Anssi Hannula 提交于
      Currently infoframe contents and channel mapping are only set when a
      sink (monitor) is present.
      
      However, this does not make much sense, since
      1) We can make a very reasonable guess on CA after 18e39186 ("ALSA:
         hda - hdmi: Fallback to ALSA allocation when selecting CA") or by
         relying on a previously valid ELD (or we may be using a
         user-specified channel map).
      2) Not setting infoframe contents and channel count simply means they
         are left at a possibly incorrect state - playback is still allowed
         to proceed (with missing or wrongly mapped channels).
      
      Reasons for monitor_present being 0 include disconnected cable, video
      driver issues, or codec not being spec-compliant. Note that in
      actual disconnected-cable case it should not matter if these settings
      are wrong as they will be re-set after jack detection, though.
      
      Change the behavior to allow the infoframe contents and the channel
      mapping to be set even without a sink/monitor, either based on the
      previous valid ELD contents, if any, or based on sensible defaults
      (standard channel layouts or provided custom map, sink type HDMI).
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Tested-by: NStephan Raue <stephan@openelec.tv>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      561a7d6e
    • A
      ALSA: hda - hdmi: Set converter channel count even without sink · f06ab794
      Anssi Hannula 提交于
      Since commit 1df5a06a ("ALSA: hda - hdmi: Fix programmed active channel
      count") channel count is no longer being set if monitor_present is 0.
      This is because setting the count was moved after the CA value is
      determined, which is only after the monitor_present check in
      hdmi_setup_audio_infoframe().
      
      Unfortunately, in some cases, such as with a non-spec-compliant codec or
      with a problematic video driver, monitor_present is always 0. As a
      specific example, this seems to happen with gen1 ATV (SiI1390 codec),
      causing left-channel-only stereo playback (multi-channel playback has
      apparently never worked with this codec despite it reporting 8 channels,
      reason unknown).
      
      Simply setting converter channel count without setting the pin infoframe
      and channel mapping as well does not theoretically make much sense as
      this will just mean they are out-of-sync and multichannel playback will
      have a wrong channel mapping.
      
      However, adding back just setting the converter channel count even in
      no-monitor case is the safest change which at least fixes the stereo
      playback regression on SiI1390 codec. Do that.
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Reported-by: NStephan Raue <stephan@openelec.tv>
      Tested-by: NStephan Raue <stephan@openelec.tv>
      Cc: <stable@vger.kernel.org> # 3.12+
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      f06ab794
  7. 20 3月, 2014 1 次提交
    • M
      ALSA: hda - verify pin:cvt connection on preparing a stream for Intel HDMI codec · 2df6742f
      Mengdong Lin 提交于
      This is a temporary fix for some Intel HDMI codecs to avoid no sound output for
      a resuming playback after S3.
      
      After S3, the audio driver restores pin:cvt connection selections by
      snd_hda_codec_resume_cache(). However this can happen before the gfx side is
      ready and such connect selection is overlooked by HW. After gfx is ready, the
      pins make the default selection again. And this will cause multiple pins share
      a same convertor and mute control will affect each other. Thus a resumed audio
      playback become silent after S3.
      
      This patch verifies pin:cvt connection on preparing a stream, to assure the pin
      selects the right convetor and an assigned convertor is not shared by other
      unused pins. Apply this fix-up on Haswell, Broadwell and Valleyview (Baytrail).
      
      We need this temporary fix before a reliable software communication channel is
      established between audio and gfx, to sync audio/gfx operations.
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      2df6742f
  8. 11 3月, 2014 1 次提交
  9. 25 2月, 2014 1 次提交
    • T
      ALSA: hda - Replace with standard printk · 4e76a883
      Takashi Iwai 提交于
      Use dev_err() and co for messages from HD-audio controller and codec
      drivers.  The codec drivers are mostly bound with codec objects, so
      some helper macros, codec_err(), codec_info(), etc, are provided.
      They merely wrap the corresponding dev_xxx().
      
      There are a few places still calling snd_printk() and its variants
      as they are called without the codec or device context.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      4e76a883
  10. 01 2月, 2014 1 次提交
    • S
      ALSA: hda/hdmi - allow PIN_OUT to be dynamically enabled · 75fae117
      Stephen Warren 提交于
      Commit 384a48d7 "ALSA: hda: HDMI: Support codecs with fewer cvts
      than pins" dynamically enabled each pin widget's PIN_OUT only when the
      pin was actively in use. This was required on certain NVIDIA CODECs for
      correct operation. Specifically, if multiple pin widgets each had their
      mux input select the same audio converter widget and each pin widget had
      PIN_OUT enabled, then only one of the pin widgets would actually receive
      the audio, and often not the one the user wanted!
      
      However, this apparently broke some Intel systems, and commit
      6169b673 "ALSA: hda - Always turn on pins for HDMI/DP" reverted the
      dynamic setting of PIN_OUT. This in turn broke the afore-mentioned NVIDIA
      CODECs.
      
      This change supports either dynamic or static handling of PIN_OUT,
      selected by a flag set up during CODEC initialization. This flag is
      enabled for all recent NVIDIA GPUs.
      Reported-by: NUosis <uosisl@gmail.com>
      Cc: <stable@vger.kernel.org> # v3.13
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      75fae117
  11. 09 1月, 2014 2 次提交
  12. 19 12月, 2013 1 次提交
  13. 18 12月, 2013 1 次提交
    • D
      ALSA: hda - Explicitly keep codec powered up in hdmi_present_sense · da4a7a39
      David Henningsson 提交于
      This should help us avoid the following mutex deadlock:
      
      [] mutex_lock+0x2a/0x50
      [] hdmi_present_sense+0x53/0x3a0 [snd_hda_codec_hdmi]
      [] generic_hdmi_resume+0x5a/0x70 [snd_hda_codec_hdmi]
      [] hda_call_codec_resume+0xec/0x1d0 [snd_hda_codec]
      [] snd_hda_power_save+0x1e4/0x280 [snd_hda_codec]
      [] codec_exec_verb+0x5f/0x290 [snd_hda_codec]
      [] snd_hda_codec_read+0x5b/0x90 [snd_hda_codec]
      [] snd_hdmi_get_eld_size+0x1e/0x20 [snd_hda_codec_hdmi]
      [] snd_hdmi_get_eld+0x2c/0xd0 [snd_hda_codec_hdmi]
      [] hdmi_present_sense+0x9a/0x3a0 [snd_hda_codec_hdmi]
      [] hdmi_repoll_eld+0x34/0x50 [snd_hda_codec_hdmi]
      Signed-off-by: NDavid Henningsson <david.henningsson@canonical.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      da4a7a39
  14. 11 12月, 2013 1 次提交
    • A
      ALSA: hda - hdmi: Fix IEC958 ctl indexes for some simple HDMI devices · c9a6338a
      Anssi Hannula 提交于
      In case a single HDA card has both HDMI and S/PDIF outputs, the S/PDIF
      outputs will have their IEC958 controls created starting from index 16
      and the HDMI controls will be created starting from index 0.
      
      However, HDMI simple_playback_build_controls() as used by old VIA and
      NVIDIA codecs incorrectly requests the IEC958 controls to be created
      with an S/PDIF type instead of HDMI.
      In case the card has other codecs that have HDMI outputs, the controls
      will be created with wrong index=16, causing them to e.g. be unreachable
      by the ALSA "hdmi" alias.
      
      Fix that by making simple_playback_build_controls() request controls
      with HDMI indexes.
      
      Not many cards have an affected configuration, but e.g. ASUS M3N78-VM
      contains an integrated NVIDIA HDA "card" with:
      - a VIA codec that has, among others, an S/PDIF pin incorrectly
        labelled as an HDMI pin, and
      - an NVIDIA MCP7x HDMI codec.
      
      Reported-by: MysterX on #openelec
      Tested-by: MysterX on #openelec
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Cc: <stable@vger.kernel.org> # 3.8+
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c9a6338a
  15. 06 12月, 2013 1 次提交
  16. 04 12月, 2013 1 次提交
  17. 26 11月, 2013 3 次提交
  18. 12 11月, 2013 2 次提交
  19. 07 11月, 2013 3 次提交
  20. 04 11月, 2013 2 次提交
    • M
      ALSA: hda - rename function not_share_unassigned_cvt() · 300016b9
      Mengdong Lin 提交于
      The function name not_share_unassigned_cvt() is opposite to what it does.
      This patch renames it to intel_not_share_assigned_cvt(), and addes comments
      to explain why some Intel display codecs need this workaround.
      Signed-off-by: NMengdong Lin <mengdong.lin@intel.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      300016b9
    • A
      ALSA: hda - hdmi: Disallow unsupported 2ch remapping on NVIDIA codecs · 611885bc
      Anssi Hannula 提交于
      NVIDIA HDMI codecs do not seem to follow the Audio Sample Packet (ASP)
      channel mapping (as set by verb F32h per HDA specification 7.3.3.41)
      when playing back 2-channel audio (CEA CA 0x00).
      
      Basically this means that specifying swapped channels for stereo audio
      (FR,FL) does not take effect, and e.g. this command plays back on the
      wrong channel:
      speaker-test -c2 -Dhdmi:CARD=NVidia,DEV=0 -m FR,FL -s1
      
      Multichannel audio is not affected.
      
      This issue has been confirmed to exist on codec 0x10de0015 by me and on
      0x10de0040 by Juho Teperi.
      
      Disable 2ch FL/FR channel swapping on all NVIDIA HDMI codecs that use
      the standard HDA channel mapping system. Since this is a very minor
      functionality loss, we err on the side of disabling it for newer codecs
      as well until any future testing confirms that this issue has been
      fixed.
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Helped-by: NJuho Teperi <juho.teperi@iki.fi>
      Cc: Aaron Plattner <aplattner@nvidia.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      611885bc
  21. 01 11月, 2013 1 次提交
  22. 25 10月, 2013 6 次提交
    • A
      ALSA: hda - hdmi: Re-setup pin and infoframe on plug-in on all codecs · 7342017f
      Anssi Hannula 提交于
      hdmi_setup_audio_infoframe() does not set up pin and infoframe if there
      is no connected sink. If a sink is connected while audio playback is
      already in progress, the pin and infoframe will not be properly set up,
      causing no audio or wrongly mapped audio.
      
      On Intel Haswell codecs the hdmi_setup_audio_infoframe() is already
      called again from hdmi_present_sense() when an ELD appears because
      transcoder:port mapping may have changed.
      
      Make the call non-Haswell-specific so that audio will be properly set up
      if the playback was started before a sink was connected.
      
      Tested on non-Haswell Intel HDMI codec by plugging sink in during
      playback.
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7342017f
    • A
      ALSA: hda - hdmi: Disable ramp-up/down for non-PCM on AMD codecs · 84d69e79
      Anssi Hannula 提交于
      Recent AMD HDMI codecs (revision ID 3 and later, 0x100300 as reported by
      procfs codec#0) have a configurable ramp-up/down functionality.
      
      The documentation ( http://www.x.org/docs/AMD/AMD_HDA_verbs_v2.pdf )
      specifies that 180 ("180/256 =~ 0.7") is recommended for PCM and 0 for
      non-PCM.
      
      Apply the recommended values according to provided S/PDIF AES0 settings
      since ramp-up/down does not make sense for non-PCM.
      
      v2: adapted to hdmi_ops infrastructure
      
      * More note from Anssi:
      actually, re-reading mails reveals that Olivier didn't find the
      expected difference with this setting, except for "maybe slightly
      slower startup with AES0=6" (i.e. value 0, which is unexpected).
      
      So maybe
      a) it makes too unnoticiable a difference, or
      b) only affects certain hardware (card and/or sink), or
      c) ramp-up/down is only triggered with the MUTE bit of
         ATI_VERB_SET_MULTICHANNEL_xx which is also rev3+ specific,
         but is not presently used by the driver,
      or something else.
      
      So there's a significant chance setting ramp rate is useless for us ATM,
      but probably does not do actual harm either.
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Tested-by: Olivier Langlois <olivier@trillion01.com> # v1
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      84d69e79
    • A
      ALSA: hda - hdmi: Add HBR bitstreaming support for ATI/AMD HDMI codecs · 461cf6b3
      Anssi Hannula 提交于
      ATI/AMD HDMI codecs do not include standard HDA HDMI HBR support (which
      is required for bitstreaming DTS-HD and Dolby TrueHD), instead they have
      custom verbs for checking and enabling it.
      
      Add support for the ATI/AMD HDMI HBR verbs.
      
      The specification is available at:
      http://www.x.org/docs/AMD/AMD_HDA_verbs_v2.pdf
      
      v2: adapted to hdmi_ops infrastructure
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Tested-by: Peter Frühberger <fritsch@xbmc.org> # v1
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      461cf6b3
    • A
      ALSA: hda - hdmi: Add ELD emulation for ATI/AMD codecs · 89250f84
      Anssi Hannula 提交于
      ATI/AMD HDMI/DP codecs do not include standard HDA ELD (EDID-like data)
      support.
      
      In place of providing access to an ELD buffer, various vendor-specific
      verbs are provided to provide the relevant information. Revision ID 3
      and later (0x100300 as reported by procfs codec#X) have support for
      providing more information than the previous revisions (but only if
      supported by the display driver).
      
      Generate ELD from the information provided by the vendor-specific verbs
      on ATI/AMD codecs.
      
      The specification is available at:
      http://www.x.org/docs/AMD/AMD_HDA_verbs_v2.pdf
      
      v2: moved code to hda_eld.c and cleaned it up
      v3: adapted to hdmi_ops infrastructure
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Tested-by: Peter Frühberger <fritsch@xbmc.org> # v2
      Tested-by: Olivier Langlois <olivier@trillion01.com> # v2
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      89250f84
    • A
      ALSA: hda - hdmi: Add ATI/AMD multi-channel audio support · 5a613584
      Anssi Hannula 提交于
      ATI/AMD codecs do not support all the standard HDA HDMI/DP functions,
      instead various vendor-specific verbs are provided.
      
      This commit addresses these missing functions:
      - standard channel mapping support
      - standard infoframe configuration support
      
      ATI/AMD provides their own verbs that allow the following:
      - setting CA for infoframe
      - setting down-mix information for infoframe
      - channel pair remapping
      - individual channel remapping (revision ID 3+, 0x100300+)
      
      The documentation for the verbs has now been released by AMD:
      http://www.x.org/docs/AMD/AMD_HDA_verbs_v2.pdf
      
      Add support for the ATI/AMD specific verbs and use them instead of the
      generic methods on ATI/AMD codecs. This allows multi-channel PCM audio
      to work.
      
      Channel remapping is restricted to pairwise mapping on codecs with
      revision ID 2 (0x100200 as reported by procfs codec#X) or lower. This
      means cards up to Radeon HD7670 as far as I know. This will not affect
      standard multi-channel modes since these codecs support automatic
      FC-LFE swapping for HDMI.
      
      ATI/AMD codecs do not advertise all of their supported rates, formats
      and channel counts, therefore that information is forced accordingly so
      that all HDMI 1.x PCM parameters are marked as supported.
      
      Support for multiple ports is also added to patch_atihdmi so that
      0x1002aa01 codecs with multiple ports will work properly when switched
      back to that patch.
      
      v2: splitted ELD emulation to a separate patch, tlv fixes
      v3: adapted to the new hdmi_ops infrastructure, fixed rev3+ vendor id
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Tested-by: Peter Frühberger <fritsch@xbmc.org> # v2
      Tested-by: Olivier Langlois <olivier@trillion01.com> # v2+rev3fix
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      5a613584
    • A
      ALSA: hda - hdmi: Allow HDA patches to customize more operations · 307229d2
      Anssi Hannula 提交于
      Upcoming AMD multichannel support requires many customized operations
      (channel mapping, ELD, HBR) but can otherwise share most of its code
      with the generic patch.
      
      Add a local struct hdmi_ops containing customizable HDMI-specific
      callbacks and move the current code to those callbacks. Functionality is
      unaltered.
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      307229d2
  23. 21 10月, 2013 2 次提交
  24. 18 10月, 2013 2 次提交
  25. 08 10月, 2013 1 次提交
    • A
      ALSA: hda - hdmi: Fix channel map switch not taking effect · 39edac70
      Anssi Hannula 提交于
      Currently hdmi_setup_audio_infoframe() reprograms the HDA channel
      mapping only when the infoframe is not up-to-date or the non-PCM flag
      has changed.
      
      However, when just the channel map has been changed, the infoframe may
      still be up-to-date and non-PCM flag may not have changed, so the new
      channel map is not actually programmed into the HDA codec.
      
      Notably, this failing case is also always triggered when the device is
      already in a prepared state and a new channel map is configured while
      changing only the channel positions (for example, plain
      "speaker-test -c2 -m FR,FL").
      
      Fix that by always programming the channel map in
      hdmi_setup_audio_infoframe(). Tested on Intel HDMI.
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      39edac70