1. 16 12月, 2014 1 次提交
  2. 15 12月, 2014 1 次提交
  3. 20 10月, 2014 1 次提交
    • A
      ALSA: hda - hdmi: Fix missing ELD change event on plug/unplug · 6acce400
      Anssi Hannula 提交于
      The ELD ALSA control change event is sent by hdmi_present_sense() when
      eld_changed is true.
      
      Currently, it is only true when the ELD buffer contents have been
      modified. However, the user-visible ELD controls also change to a
      zero-length value and back when eld_valid is unset/set, and no event is
      currently sent in such cases (such as when unplugging or replugging a
      sink).
      
      Fix the code to always set eld_changed if eld_valid value is changed,
      and therefore to always send the change event when the user-visible
      value changes.
      Signed-off-by: NAnssi Hannula <anssi.hannula@iki.fi>
      Cc: David Henningsson <david.henningsson@canonical.com>
      Cc: <stable@vger.kernel.org> # 3.9+
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      6acce400
  4. 16 9月, 2014 1 次提交
    • T
      ALSA: hda - Allow multiple callbacks for jack · 1a4f69d5
      Takashi Iwai 提交于
      So far, hda_jack infrastructure allows only one callback per jack, and
      this makes things slightly complicated when a driver wants to assign
      multiple tasks to a jack, e.g. the standard auto-mute with a power
      up/down sequence.  This can be simplified if the hda_jack accepts
      multiple callbacks.
      
      This patch is such an extension: the callback-specific part (the
      function and private_data) is split to another struct from
      hda_jack_tbl, and multiple such objects can be assigned to a single
      hda_jack_tbl entry.
      
      The new struct hda_jack_callback is passed to each callback function
      now, thus the patch became bigger than expected.  But these changes
      are mostly trivial.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      1a4f69d5
  5. 11 9月, 2014 1 次提交
    • T
      ALSA: hda - Get rid of action field from struct hda_jack_tbl · 62f949bf
      Takashi Iwai 提交于
      The action value assigned to each hda_jack_tbl entry is mostly
      superfluous.  The actually used values are either the widget NID or a
      value specific to the callback.
      
      The former case can be simply replaced by a reference to widget NID
      itself.  The only place doing the latter is STAC/IDT codec driver for
      the powermap handling.  But, the code doesn't need to check the action
      field at all -- the function jack_update_power() is called either with
      a specific pin or with NULL.  So the check of jack->action can be
      removed completely there, too.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      62f949bf
  6. 19 8月, 2014 2 次提交
  7. 04 8月, 2014 1 次提交
  8. 08 7月, 2014 1 次提交
  9. 25 6月, 2014 1 次提交
  10. 23 6月, 2014 1 次提交
  11. 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
  12. 20 5月, 2014 1 次提交
  13. 13 5月, 2014 1 次提交
  14. 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
  15. 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
  16. 11 3月, 2014 1 次提交
  17. 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
  18. 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
  19. 09 1月, 2014 2 次提交
  20. 19 12月, 2013 1 次提交
  21. 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
  22. 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
  23. 06 12月, 2013 1 次提交
  24. 04 12月, 2013 1 次提交
  25. 26 11月, 2013 3 次提交
  26. 12 11月, 2013 2 次提交
  27. 07 11月, 2013 3 次提交
  28. 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
  29. 01 11月, 2013 1 次提交
  30. 25 10月, 2013 2 次提交
    • 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