Skip to content
  1. Jan 26, 2021
  2. Jan 25, 2021
  3. Jan 24, 2021
  4. Jan 21, 2021
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix "RANGE setting not yet supported" errors · 85db1cfb
      Takashi Iwai authored
      
      
      At probing a UAC2/UAC3 device like NUX MG-300 USB interface, we get
      error messages "RANGE setting not yet supported".  It comes the place
      where the driver tries to determine the resolution of mixer volumes
      via SET_CUR_RES and GET_CUR_RES verbs.  Those verbs aren't supported
      on UAC2 and UAC3, hence the driver warns like the above.  Although the
      driver handles this error and works as expected, it's still ugly to
      show such errors unnecessarily.
      
      This patch papers over the errors by applying the resolution detection
      only for UAC1 and skipping it for UAC2/UAC3.
      
      Reported-by: default avatarMike Oliphant <oliphant@nostatic.org>
      Link: https://lore.kernel.org/r/20210120213932.1971-2-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      85db1cfb
    • Takashi Iwai's avatar
      ALSA: usb-audio: Skip the clock selector inquiry for single connections · 086b957c
      Takashi Iwai authored
      
      
      The current USB-audio driver gets an error at probing NUX MG-300 about
      parsing the clocks.  This is because the firmware doesn't return the
      proper connection of the clock selector that is connected to a single
      clock; it's likely that the firmware was lazy^w optimized and the
      inquiry wasn't handled.  Actually it makes little sense to inquire and
      set up the single connection explicitly.
      
      This patch fixes the issue by simply skipping the clock selector
      inquiry if it's a single connection.
      
      Reported-by: default avatarMike Oliphant <oliphant@nostatic.org>
      Link: https://lore.kernel.org/r/20210120213932.1971-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      086b957c
  5. Jan 19, 2021
  6. Jan 18, 2021
    • Takashi Iwai's avatar
      ALSA: usb-audio: Avoid implicit feedback on Pioneer devices · 532a208a
      Takashi Iwai authored
      For addressing the regression on Pioneer devices, we recently
      corrected the quirk code to enable the implicit feedback mode on those
      devices properly.  However, the devices still showed problems with the
      full duplex operations with JACK, and after debug sessions, we figured
      out that the older kernels that had worked with JACK also didn't use
      the implicit feedback mode at all although they had the quirk code to
      enable it; instead, the old code worked just to skip the normal sync
      endpoint setup that would have been detected without it.  IOW, what
      broke without the implicit-fb quirk in the past was the application of
      the normal sync endpoint that is actually the capture data endpoint on
      these devices.
      
      This patch covers the overseen piece: it modifies the quirk code again
      not to enable the implicit feedback mode but just to make the driver
      skipping the sync endpoint detection.  This made the driver working
      with JACK full-duplex mode again.
      
      Still it's not quite clear why the implicit feedback doesn't work on
      those devices yet; maybe it's about some issues in the URB setup.  But
      at least, with this patch, the driver should work in the level of the
      older kernels again.
      
      Fixes: 167c9dc8
      
       ("ALSA: usb-audio: Fix implicit feedback sync setup for Pioneer devices")
      Link: https://lore.kernel.org/r/20210118075816.25068-4-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      532a208a
    • Takashi Iwai's avatar
      ALSA: usb-audio: Set sample rate for all sharing EPs on UAC1 · 3784d449
      Takashi Iwai authored
      The UAC2/3 sample rate setup is based on the clock node, which is
      usually shared in the interface, and can't be re-setup without
      deselecting the interface once, and that's how the current code
      behaves.  OTOH, the sample rate setup of UAC1 is per endpoint, hence
      we basically need to call for each endpoint usage even if those share
      the same interface.
      
      This patch fixes the behavior of UAC1 to call always
      snd_usb_init_sample_rate() in snd_usb_endpoint_configure().
      
      Fixes: bf6313a0
      
       ("ALSA: usb-audio: Refactor endpoint management")
      Link: https://lore.kernel.org/r/20210118075816.25068-3-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      3784d449
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix UAC1 rate setup for secondary endpoints · 87cb9af9
      Takashi Iwai authored
      
      
      The current sample rate setup function for UAC1 assumes only the first
      endpoint retrieved from the interface:altset pair, but the rate set up
      may be needed also for the secondary endpoint.  Also, retrieving the
      endpoint number from the interface descriptor is redundant; we have
      already the target endpoint in the given audioformat object.
      
      This patch simplifies the code and corrects the target endpoint as
      described in the above.  It simply refers to fmt->endpoint directly.
      
      Also, this patch drops the pioneer_djm_set_format_quirk() that is
      caleld from snd_usb_set_format_quirk(); this function does the sample
      rate setup but for the capture endpoint (0x82), and that's exactly
      what the change above fixes.
      
      Link: https://lore.kernel.org/r/20210118075816.25068-2-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      87cb9af9
  7. Jan 15, 2021
    • Takashi Iwai's avatar
      ALSA: x86: Simplify with dma_set_mask_and_coherent() · 915183b6
      Takashi Iwai authored
      
      
      LPE driver still has explicit calls of dma_set_mask() and
      dma_set_coherent_mask().
      
      Let's simplify with dma_set_mask_and_coherent().
      
      Link: https://lore.kernel.org/r/20210114125412.993-3-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      915183b6
    • Takashi Iwai's avatar
      ALSA: pci: Simplify with dma_set_mask_and_coherent() · 669f65ea
      Takashi Iwai authored
      
      
      Many PCI drivers still have two explicit calls of dma_set_mask() and
      dma_set_coherent_mask().
      
      Let's simplify with dma_set_mask_and_coherent().
      
      Link: https://lore.kernel.org/r/20210114125412.993-2-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      669f65ea
    • Kai-Chuan Hsieh's avatar
      ALSA: hda: Add Cometlake-R PCI ID · f84d3a1e
      Kai-Chuan Hsieh authored
      
      
      Add HD Audio Device PCI ID for the Intel Cometlake-R platform
      
      Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Signed-off-by: default avatarKai-Chuan Hsieh <kaichuan.hsieh@canonical.com>
      Link: https://lore.kernel.org/r/20210115031515.13100-1-kaichuan.hsieh@canonical.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f84d3a1e
    • Takashi Sakamoto's avatar
      ALSA: dice: add support for Lexicon I-ONIX FW810s · 9a08676f
      Takashi Sakamoto authored
      
      
      I-ONIX FW810s was shipped in Lexicon brand of HARMAN International
      industries, Inc 2009. The model uses TCD2220 ASIC as its communication
      engine. TCAT general protocol is supported, its extension isn't.
      
      This patch adds support for the model with hard-coded stream formats.
      
      $ python3 ~/git/linux-firewire-utils/src/crpp < /sys/bus/firewire/devices/fw1/config_rom
                     ROM header and bus information block
                     -----------------------------------------------------------------
      400  04042b91  bus_info_length 4, crc_length 4, crc 11153
      404  31333934  bus_name "1394"
      408  e0008102  irmc 1, cmc 1, isc 1, bmc 0, cyc_clk_acc 0, max_rec 8 (512)
      40c  000fd720  company_id 000fd7     |
      410  007d7ecf  device_id 20007d7ecf  | EUI-64 000fd720007d7ecf
      
                     root directory
                     -----------------------------------------------------------------
      414  00064c2d  directory_length 6, crc 19501
      418  03000fd7  vendor
      41c  8100000a  --> descriptor leaf at 444
      420  17000001  model
      424  8100000d  --> descriptor leaf at 458
      428  0c0087c0  node capabilities per IEEE 1394
      42c  d1000001  --> unit directory at 430
      
                     unit directory at 430
                     -----------------------------------------------------------------
      430  000438f2  directory_length 4, crc 14578
      434  12000fd7  specifier id
      438  13000001  version
      43c  17000001  model
      440  8100000d  --> descriptor leaf at 474
      
                     descriptor leaf at 444
                     -----------------------------------------------------------------
      444  000489d5  leaf_length 4, crc 35285
      448  00000000  textual descriptor
      44c  00000000  minimal ASCII
      450  4c657869  "Lexi"
      454  636f6e00  "con"
      
                     descriptor leaf at 458
                     -----------------------------------------------------------------
      458  0006594b  leaf_length 6, crc 22859
      45c  00000000  textual descriptor
      460  00000000  minimal ASCII
      464  492d4f4e  "I-ON"
      468  49585f46  "IX_F"
      46c  57383130  "W810"
      470  53000000  "S"
      
                     descriptor leaf at 474
                     -----------------------------------------------------------------
      474  0006594b  leaf_length 6, crc 22859
      478  00000000  textual descriptor
      47c  00000000  minimal ASCII
      480  492d4f4e  "I-ON"
      484  49585f46  "IX_F"
      488  57383130  "W810"
      48c  53000000  "S"
      
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Link: https://lore.kernel.org/r/20210115035623.148580-1-o-takashi@sakamocchi.jp
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      9a08676f
    • Takashi Iwai's avatar
      ALSA: usb-audio: Convert the last strlcpy() usage · 42ef170d
      Takashi Iwai authored
      
      
      The last remaining usage of strlcpy() in USB-audio driver is the setup
      of the card longname string.  Basically we need to know whether any
      non-empty string is set or not, and no real length is needed.
      Refactor the code and use strscpy() instead.  After this change,
      strlcpy() is gone from all sound/* code.
      
      Link: https://lore.kernel.org/r/20210115100437.20906-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      42ef170d
    • Takashi Iwai's avatar
      ALSA: usb-audio: Convert remaining strlcpy() to strscpy() · e8afdfdc
      Takashi Iwai authored
      
      
      USB-audio driver still contains two calls of strlcpy() because the
      return size is evaluated.  Basically it just checks whether the string
      is copied or not, but since strcpy() may return a negative error code,
      we should check the negative value and treat as filled.
      
      Link: https://lore.kernel.org/r/20210115095758.19707-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e8afdfdc
    • Takashi Iwai's avatar
      ALSA: seq: oss: Fix missing error check in snd_seq_oss_synth_make_info() · 217bfbb8
      Takashi Iwai authored
      
      
      snd_seq_oss_synth_make_info() didn't check the error code from
      snd_seq_oss_midi_make_info(), and this leads to the call of strlcpy()
      with the uninitialized string as the source, which may lead to the
      access over the limit.
      
      Add the proper error check for avoiding the failure.
      
      Reported-by: default avatar <syzbot+e42504ff21cff05a595f@syzkaller.appspotmail.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20210115093428.15882-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      217bfbb8
  8. Jan 14, 2021
    • Takashi Iwai's avatar
      ALSA: hda/via: Add minimum mute flag · 67ea698c
      Takashi Iwai authored
      
      
      It turned out that VIA codecs also mute the sound in the lowest mixer
      level.  Turn on the dac_min_mute flag to indicate the mute-as-minimum
      in TLV like already done in Conexant and IDT codecs.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210559
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20210114072453.11379-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      67ea698c
    • Chris Chiu's avatar
      ALSA: hda/realtek - Limit int mic boost on Acer Aspire E5-575T · 495dc763
      Chris Chiu authored
      
      
      The Acer Apire E5-575T laptop with codec ALC255 has a terrible
      background noise comes from internal mic capture. And the jack
      sensing dose not work for headset like some other Acer laptops.
      
      This patch limits the internal mic boost on top of the existing
      ALC255_FIXUP_ACER_MIC_NO_PRESENCE quirk for Acer Aspire E5-575T.
      
      Signed-off-by: default avatarChris Chiu <chiu@endlessos.org>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20210114082728.74729-1-chiu@endlessos.org
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      495dc763
    • Takashi Iwai's avatar
      ALSA: usb-audio: Always apply the hw constraints for implicit fb sync · e4ea77f8
      Takashi Iwai authored
      Since the commit 5a6c3e11 ("ALSA: usb-audio: Add hw constraint for
      implicit fb sync"), we apply the hw constraints for the implicit
      feedback sync to make the secondary open aligned with the already
      opened stream setup.  This change assumed that the secondary open is
      performed after the first stream has been already set up, and adds the
      hw constraints to sync with the first stream's parameters only when
      the EP setup for the first stream was confirmed at the open time.
      However, most of applications handling the full-duplex operations do
      open both playback and capture streams at first, then set up both
      streams.  This results in skipping the additional hw constraints since
      the counter-part stream hasn't been set up yet at the open of the
      second stream, and it eventually leads to "incompatible EP" error in
      the end.
      
      This patch corrects the behavior by always applying the hw constraints
      for the implicit fb sync.  The hw constraint rules are defined so that
      they check the sync EP dynamically at each invocation, instead.  This
      covers the concurrent stream setups better and lets the hw refine
      calls resolving to the right configuration.
      
      Also this patch corrects a minor error that has existed in the debug
      print that isn't built as default.
      
      Fixes: 5a6c3e11
      
       ("ALSA: usb-audio: Add hw constraint for implicit fb sync")
      Link: https://lore.kernel.org/r/20210111081611.12790-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e4ea77f8
    • Kai Vehmanen's avatar
      ALSA: hda: Add AlderLake-P PCI ID and HDMI codec vid · 5e941fc0
      Kai Vehmanen authored
      
      
      Add HD Audio PCI ID and HDMI codec vendor ID for Intel AlderLake-P.
      
      Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
      Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
      Link: https://lore.kernel.org/r/20210113155629.4097057-1-kai.vehmanen@linux.intel.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      5e941fc0
  9. Jan 12, 2021
  10. Jan 09, 2021
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix implicit feedback sync setup for Pioneer devices · 167c9dc8
      Takashi Iwai authored
      Pioneer devices have both playback and capture streams sharing the
      same iface/altsetting, and those need to be paired as implicit
      feedback.  Instead of a half-baked (and broken) static quirk entry,
      set up more generically for those devices by checking the number of
      endpoints and the attribute of the secondary EP.
      
      Fixes: bf6313a0
      
       ("ALSA: usb-audio: Refactor endpoint management")
      Reported-by: default avatarFrantišek Kučera <konference@frantovo.cz>
      Link: https://lore.kernel.org/r/20210108075219.21463-6-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      167c9dc8
    • Takashi Iwai's avatar
      ALSA: usb-audio: Annotate the endpoint index in audioformat · eae4d054
      Takashi Iwai authored
      There are devices that have multiple endpoints sharing the same
      iface/altset not only for sync but also for the actual streams, and
      the audioformat for such an endpoint needs to be handled with the
      proper endpoint index; otherwise it confuses the endpoint management.
      
      This patch extends the audioformat to annotate the endpoint index, and
      put the proper ep_idx=1 to Pioneer device quirk entries accordingly.
      
      Fixes: bf6313a0
      
       ("ALSA: usb-audio: Refactor endpoint management")
      Link: https://lore.kernel.org/r/20210108075219.21463-5-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      eae4d054
    • Takashi Iwai's avatar
      ALSA: usb-audio: Avoid unnecessary interface re-setup · 00272c61
      Takashi Iwai authored
      The current endpoint handling assumed (more or less) a unique 1:1
      relation between the endpoint and the iface/altset.  The exception was
      the sync EP without the implicit feedback which has usually the
      secondary EP of the same altset.  This works fine for most devices,
      but it turned out that some unusual devices like Pinoeer's ones have
      both playback and capture endpoints in the same iface/altsetting and
      use both for the implicit feedback mode.  For handling such a case, we
      need to extend the endpoint management to take the shared interface
      into account.
      
      This patch does that: it adds a new object snd_usb_iface_ref for
      managing the reference counts of the each USB interface that is used
      by each endpoint.  The interface setup is performed only once for the
      (sharing) endpoints, and the doubly initialization is avoided.
      
      Along with this, the resource release of endpoints and interface
      refcounts are put into a single function, snd_usb_endpoint_free_all()
      instead of looping in the caller side.
      
      Fixes: bf6313a0
      
       ("ALSA: usb-audio: Refactor endpoint management")
      Link: https://lore.kernel.org/r/20210108075219.21463-4-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      00272c61
    • Takashi Iwai's avatar
      ALSA: usb-audio: Choose audioformat of a counter-part substream · 5d15f1eb
      Takashi Iwai authored
      The implicit feedback mode needs to handle two endpoints and the
      choice of the audioformat object for the sync EP is important since
      this determines the compatibility of the hw_params.  The current code
      uses the same audioformat object if both the main EP and the sync EP
      point to the same iface/altsetting.  This was done in consideration of
      the non-implicit-fb sync EP handling, and it doesn't match well with
      the cases where actually to endpoints are defined in the sameiface /
      altsetting like a few Pioneer devices.
      
      Modify snd_usb_find_implicit_fb_sync_format() to pick up the
      audioformat that is assigned in the counter-part substreams primarily,
      so that the actual capture stream can be opened properly.  We keep the
      same audioformat object only as a fallback in case nothing found,
      though.
      
      Fixes: 9fddc15e
      
       ("ALSA: usb-audio: Factor out the implicit feedback quirk code")
      Link: https://lore.kernel.org/r/20210108075219.21463-3-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      5d15f1eb
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix the missing endpoints creations for quirks · b2345a8a
      Takashi Iwai authored
      The recent change in the endpoint management moved the endpoint object
      creation from the stream open time to the parser of the audio
      descriptor.  It works fine for the standard audio, but it overlooked
      the other places that create audio streams via quirks
      (QUIRK_AUDIO_FIXED_ENDPOINT) like the reported a few Pioneer devices;
      those call snd_usb_add_audio_stream() manually, hence they miss the
      endpoints, eventually resulting in the error at opening streams.
      Moreover, now the sync EP setup was moved to the explicit call of
      snd_usb_audioformat_set_sync_ep(), and this needs to be added for
      those places, too.
      
      This patch addresses those regressions for quirks.  It adds a local
      helper function add_audio_stream_from_fixed_fmt(), which does the all
      needed tasks, and replaces the calls of snd_usb_add_audio_stream()
      with this new function.
      
      Fixes: 54cb3190
      
       ("ALSA: usb-audio: Create endpoint objects at parsing phase")
      Reported-by: default avatarFrantišek Kučera <konference@frantovo.cz>
      Link: https://lore.kernel.org/r/20210108075219.21463-2-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      b2345a8a
  11. Jan 08, 2021
    • Joe Perches's avatar
      ALSA: Convert strlcpy to strscpy when return value is unused · 75b1a8f9
      Joe Perches authored
      
      
      strlcpy is deprecated.  see: Documentation/process/deprecated.rst
      
      Change the calls that do not use the strlcpy return value to the
      preferred strscpy.
      
      Done with cocci script:
      
      @@
      expression e1, e2, e3;
      @@
      
      -	strlcpy(
      +	strscpy(
      	e1, e2, e3);
      
      This cocci script leaves the instances where the return value is
      used unchanged.
      
      After this patch, sound/ has 3 uses of strlcpy() that need to be
      manually inspected for conversion and changed one day.
      
      $ git grep -w strlcpy sound/
      sound/usb/card.c:               len = strlcpy(card->longname, s, sizeof(card->longname));
      sound/usb/mixer.c:      return strlcpy(buf, p->name, buflen);
      sound/usb/mixer.c:                      return strlcpy(buf, p->names[index], buflen);
      
      Miscellenea:
      
      o Remove trailing whitespace in conversion of sound/core/hwdep.c
      
      Link: https://lore.kernel.org/lkml/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
      
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      Link: https://lore.kernel.org/r/22b393d1790bb268769d0bab7bacf0866dcb0c14.camel@perches.com
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      75b1a8f9
    • Takashi Iwai's avatar
      Merge branch 'for-linus' into for-next · 6dcb8bf9
      Takashi Iwai authored
      
      
      Back-merge of 5.11-devel branch for syncing the result changes.
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      6dcb8bf9
    • Takashi Iwai's avatar
      Merge tag 'asoc-fix-v5.11-rc2' of... · 7b622755
      Takashi Iwai authored
      Merge tag 'asoc-fix-v5.11-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
      
      ASoC: Fixes for v5.11
      
      A collection of mostly driver specific fixes, plus a maintainership
      update for TI and a fix for DAPM driver removal paths.
      7b622755