1. 03 Apr, 2020 1 commit
    • Takashi Iwai's avatar
      ALSA: pcm: oss: Fix regression by buffer overflow fix (again) · ff7e06a5
      Takashi Iwai authored
      [ This is essentially the same fix as commit ae769d35, but it's
        adapted to the latest code for 5.7; hence it contains no Fixes or
        other tags for avoid backport confusion -- tiwai ]
      
      The recent fix for the OOB access in PCM OSS plugins (commit
      f2ecf903: "ALSA: pcm: oss: Avoid plugin buffer overflow") caused a
      regression on OSS applications.  The patch introduced the size check
      in client and slave size calculations to limit to each plugin's buffer
      size, but I overlooked that some code paths call those without
      allocating the buffer but just for estimation.
      
      This patch fixes the bug by skipping the size check for those code
      paths while keeping checking in the actual transfer calls.
      
      Link: https://lore.kernel.org/r/20200403073818.27943-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ff7e06a5
  2. 02 Apr, 2020 2 commits
  3. 31 Mar, 2020 5 commits
    • Andreas Steinmetz's avatar
      ALSA: usb-audio: Fix case when USB MIDI interface has more than one extra endpoint descriptor · 5c6cd702
      Andreas Steinmetz authored
      The Miditech MIDIFACE 16x16 (USB ID 1290:1749) has more than one extra
      endpoint descriptor.
      
      The first extra descriptor is: 0x06 0x30 0x00 0x00 0x00 0x00
      
      As the code in snd_usbmidi_get_ms_info() looks only at the
      first extra descriptor to find USB_DT_CS_ENDPOINT the device
      as such is recognized but there is neither input nor output
      configured.
      
      The patch iterates through the extra descriptors to find the
      proper one. With this patch the device is correctly configured.
      Signed-off-by: default avatarAndreas Steinmetz <ast@domdv.de>
      Link: https://lore.kernel.org/r/1c3b431a86f69e1d60745b6110cdb93c299f120b.camel@domdv.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      5c6cd702
    • Takashi Iwai's avatar
      Revert "ALSA: uapi: Drop asound.h inclusion from asoc.h" · b6f69c79
      Takashi Iwai authored
      This reverts commit 645c08f1
      which was reported to break the build a program using this header.
      
      The original issue was addressed in the alsa-lib side recently, so we
      can make the header more self-contained again.
      Reported-by: default avatarDmitry V. Levin <ldv@altlinux.org>
      Fixes: 645c08f1 ("ALSA: uapi: Drop asound.h inclusion from asoc.h")
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200331090023.8112-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      b6f69c79
    • Thomas Hebb's avatar
      ALSA: hda/realtek - Remove now-unnecessary XPS 13 headphone noise fixups · f36938aa
      Thomas Hebb authored
      patch_realtek.c has historically failed to properly configure the PC
      Beep Hidden Register for the ALC256 codec (among others). Depending on
      your kernel version, symptoms of this misconfiguration can range from
      chassis noise, picked up by a poorly-shielded PCBEEP trace, getting
      amplified and played on your internal speaker and/or headphones to loud
      feedback, which responds to the "Headphone Mic Boost" ALSA control,
      getting played through your headphones. For details of the problem, see
      the patch in this series titled "ALSA: hda/realtek - Set principled PC
      Beep configuration for ALC256", which fixes the configuration.
      
      These symptoms have been most noticed on the Dell XPS 13 9350 and 9360,
      popular laptops that use the ALC256. As a result, several model-specific
      fixups have been introduced to try and fix the problem, the most
      egregious of which locks the "Headphone Mic Boost" control as a hack to
      minimize noise from a feedback loop that shouldn't have been there in
      the first place.
      
      Now that the underlying issue has been fixed, remove all these fixups.
      Remaining fixups needed by the XPS 13 are all picked up by existing pin
      quirks.
      
      This change should, for the XPS 13 9350/9360
      
       - Significantly increase volume and audio quality on headphones
       - Eliminate headphone popping on suspend/resume
       - Allow "Headphone Mic Boost" to be set again, making the headphone
         jack fully usable as a microphone jack too.
      
      Fixes: 8c69729b ("ALSA: hda - Fix headphone noise after Dell XPS 13 resume back from S3")
      Fixes: 423cd785 ("ALSA: hda - Fix headphone noise on Dell XPS 13 9360")
      Fixes: e4c9fd10 ("ALSA: hda - Apply headphone noise quirk for another Dell XPS 13 variant")
      Fixes: 1099f484 ("ALSA: hda/realtek: Reduce the Headphone static noise on XPS 9350/9360")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarThomas Hebb <tommyhebb@gmail.com>
      Link: https://lore.kernel.org/r/b649a00edfde150cf6eebbb4390e15e0c2deb39a.1585584498.git.tommyhebb@gmail.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f36938aa
    • Thomas Hebb's avatar
      ALSA: hda/realtek - Set principled PC Beep configuration for ALC256 · c4473744
      Thomas Hebb authored
      The Realtek PC Beep Hidden Register[1] is currently set by
      patch_realtek.c in two different places:
      
      In alc_fill_eapd_coef(), it's set to the value 0x5757, corresponding to
      non-beep input on 1Ah and no 1Ah loopback to either headphones or
      speakers. (Although, curiously, the loopback amp is still enabled.) This
      write was added fairly recently by commit e3743f431143 ("ALSA:
      hda/realtek - Dell headphone has noise on unmute for ALC236") and is a
      safe default. However, it happens in the wrong place:
      alc_fill_eapd_coef() runs on module load and cold boot but not on S3
      resume, meaning the register loses its value after suspend.
      
      Conversely, in alc256_init(), the register is updated to unset bit 13
      (disable speaker loopback) and set bit 5 (set non-beep input on 1Ah).
      Although this write does run on S3 resume, it's not quite enough to fix
      up the register's default value of 0x3717. What's missing is a set of
      bit 14 to disable headphone loopback. Without that, we end up with a
      feedback loop where the headphone jack is being driven by amplified
      samples of itself[2].
      
      This change eliminates the update in alc256_init() and replaces it with
      the 0x5757 write from alc_fill_eapd_coef(). Kailang says that 0x5757 is
      supposed to be the codec's default value, so using it will make
      debugging easier for Realtek.
      
      Affects the ALC255, ALC256, ALC257, ALC235, and ALC236 codecs.
      
      [1] Newly documented in Documentation/sound/hd-audio/realtek-pc-beep.rst
      
      [2] Setting the "Headphone Mic Boost" control from userspace changes
      this feedback loop and has been a widely-shared workaround for headphone
      noise on laptops like the Dell XPS 13 9350. This commit eliminates the
      feedback loop and makes the workaround unnecessary.
      
      Fixes: e1e8c1fd ("ALSA: hda/realtek - Dell headphone has noise on unmute for ALC236")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarThomas Hebb <tommyhebb@gmail.com>
      Link: https://lore.kernel.org/r/bf22b417d1f2474b12011c2a39ed6cf8b06d3bf5.1585584498.git.tommyhebb@gmail.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c4473744
    • Thomas Hebb's avatar
      ALSA: doc: Document PC Beep Hidden Register on Realtek ALC256 · f1280904
      Thomas Hebb authored
      This codec (among others) has a hidden set of audio routes, apparently
      designed to allow PC Beep output without a mixer widget on the output
      path, which are controlled by an undocumented Realtek vendor register.
      The default configuration of these routes means that certain inputs
      aren't accessible, necessitating driver control of the register.
      However, Realtek has provided no documentation of the register, instead
      opting to fix issues by providing magic numbers, most of which have been
      at least somewhat erroneous. These magic numbers then get copied by
      others into model-specific fixups, leading to a fragmented and buggy set
      of configurations.
      
      To get out of this situation, I've reverse engineered the register by
      flipping bits and observing how the codec's behavior changes. This
      commit documents my findings. It does not change any code.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarThomas Hebb <tommyhebb@gmail.com>
      Link: https://lore.kernel.org/r/bd69dfdeaf40ff31c4b7b797c829bb320031739c.1585584498.git.tommyhebb@gmail.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f1280904
  4. 30 Mar, 2020 2 commits
    • Takashi Iwai's avatar
      Merge tag 'asoc-v5.7' of... · 3c22baea
      Takashi Iwai authored
      Merge tag 'asoc-v5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
      
      ASoC: Updates for v5.7
      
      This is a very big update for the core since Morimoto-san has been
      rather busy continuing his refactorings to clean up a lot of the cruft
      that we have accumilated over the years.  We've also gained several new
      drivers, including initial (but still not complete) parts of the Intel
      SoundWire support.
      
       - Lots of refactorings to modernize the code from Morimoto-san.
       - Conversion of SND_SOC_ALL_CODECS to use imply from Geert Uytterhoeven.
       - Continued refactoring and fixing of the Intel support.
       - Soundwire and more advanced clocking support for Realtek RT5682.
       - Support for amlogic GX, Meson 8, Meson 8B and T9015 DAC, Broadcom
         DSL/PON, Ingenic JZ4760 and JZ4770, Realtek RL6231, and TI TAS2563 and
         TLV320ADCX140.
      3c22baea
    • Takashi Iwai's avatar
      Merge branch 'for-next' into for-linus · aa21c3d4
      Takashi Iwai authored
      aa21c3d4
  5. 29 Mar, 2020 2 commits
  6. 27 Mar, 2020 28 commits