1. 26 3月, 2021 2 次提交
  2. 02 3月, 2021 4 次提交
  3. 01 3月, 2021 4 次提交
  4. 28 2月, 2021 1 次提交
    • T
      ALSA: usb-audio: Allow modifying parameters with succeeding hw_params calls · 5f5e6a3e
      Takashi Iwai 提交于
      The recent fix for the hw constraints for implicit feedback streams
      via commit e4ea77f8 ("ALSA: usb-audio: Always apply the hw
      constraints for implicit fb sync") added the check of the matching
      endpoints and whether those EPs are already opened.  This is needed
      and correct, per se, even for the normal streams without the implicit
      feedback, as the endpoint setup is exclusive.
      
      However, it's reported that there seem applications that behave in
      unexpected ways to update the hw_params without clearing the previous
      setup via hw_free, and those hit a problem now: then hw_params is
      called with still the previous EP setup kept, hence it's restricted
      with the previous own setup.  Although the obvious fix is to call
      snd_pcm_hw_free() API in the application side, it's a kind of
      unwelcome change.
      
      This patch tries to ease the situation: in the endpoint check, we add
      a couple of more conditions and now skip the endpoint that is being
      used only by the stream in question itself.  That is, in addition to
      the presence check of ep (ep->cur_audiofmt is non-NULL), when the
      following conditions are met, we skip such an ep:
      - ep->opened == 1, and
      - ep->cur_audiofmt == subs->cur_audiofmt.
      
      subs->cur_audiofmt is non-NULL only if it's a re-setup of hw_params,
      and ep->cur_audiofmt points to the currently set up parameters.  So if
      those match, it must be this stream itself.
      
      Fixes: e4ea77f8 ("ALSA: usb-audio: Always apply the hw constraints for implicit fb sync")
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=211941
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20210228080138.9936-1-tiwai@suse.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      5f5e6a3e
  5. 27 2月, 2021 2 次提交
  6. 14 2月, 2021 1 次提交
  7. 08 2月, 2021 3 次提交
  8. 06 2月, 2021 3 次提交
  9. 05 2月, 2021 1 次提交
  10. 03 2月, 2021 2 次提交
  11. 23 1月, 2021 1 次提交
  12. 21 1月, 2021 3 次提交
    • T
      ALSA: usb-audio: Fix "RANGE setting not yet supported" errors · 85db1cfb
      Takashi Iwai 提交于
      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: NMike Oliphant <oliphant@nostatic.org>
      Link: https://lore.kernel.org/r/20210120213932.1971-2-tiwai@suse.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      85db1cfb
    • T
      ALSA: usb-audio: Skip the clock selector inquiry for single connections · 086b957c
      Takashi Iwai 提交于
      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: NMike Oliphant <oliphant@nostatic.org>
      Link: https://lore.kernel.org/r/20210120213932.1971-1-tiwai@suse.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      086b957c
    • T
      ALSA: usb-audio: Fix hw constraints dependencies · 506c203c
      Takashi Iwai 提交于
      Since the recent refactoring, it's been reported that some USB-audio
      devices (typically webcams) are no longer detected properly by
      PulseAudio.  The debug session revealed that it's failing at probing
      by PA to try the sample rate 44.1kHz while the device has discrete
      sample rates other than 44.1kHz.  But the puzzle was that arecord
      works as is, and some other devices with the discrete rates work,
      either.
      
      After all, this turned out to be the lack of the dependencies in a few
      hw constraint rules: snd_pcm_hw_rule_add() has the (variable)
      arguments specifying the dependent parameters, and some functions
      didn't set the target parameter itself as the dependencies.  This
      resulted in an invalid parameter that could be generated only in a
      certain call pattern.  This bug itself has been present in the code,
      but it didn't trigger errors just because the rules were casually
      avoiding such a corner case.  After the recent refactoring and
      cleanup, however, the hw constraints work "as expected", and the
      problem surfaced now.
      
      For fixing the problem above, this patch adds the missing dependent
      parameters to each snd_pcm_hw_rule() call.
      
      Fixes: bc4e94aa ("ALSA: usb-audio: Handle discrete rates properly in hw constraints")
      BugLink: http://bugzilla.opensuse.org/show_bug.cgi?id=1181014
      Link: https://lore.kernel.org/r/20210120204554.30177-1-tiwai@suse.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      506c203c
  13. 19 1月, 2021 1 次提交
  14. 18 1月, 2021 3 次提交
    • T
      ALSA: usb-audio: Avoid implicit feedback on Pioneer devices · 532a208a
      Takashi Iwai 提交于
      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.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      532a208a
    • T
      ALSA: usb-audio: Set sample rate for all sharing EPs on UAC1 · 3784d449
      Takashi Iwai 提交于
      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.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      3784d449
    • T
      ALSA: usb-audio: Fix UAC1 rate setup for secondary endpoints · 87cb9af9
      Takashi Iwai 提交于
      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.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      87cb9af9
  15. 15 1月, 2021 2 次提交
  16. 14 1月, 2021 1 次提交
    • T
      ALSA: usb-audio: Always apply the hw constraints for implicit fb sync · e4ea77f8
      Takashi Iwai 提交于
      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.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      e4ea77f8
  17. 09 1月, 2021 5 次提交
    • T
      ALSA: usb-audio: Fix implicit feedback sync setup for Pioneer devices · 167c9dc8
      Takashi Iwai 提交于
      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: NFrantišek Kučera <konference@frantovo.cz>
      Link: https://lore.kernel.org/r/20210108075219.21463-6-tiwai@suse.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      167c9dc8
    • T
      ALSA: usb-audio: Annotate the endpoint index in audioformat · eae4d054
      Takashi Iwai 提交于
      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.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      eae4d054
    • T
      ALSA: usb-audio: Avoid unnecessary interface re-setup · 00272c61
      Takashi Iwai 提交于
      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.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      00272c61
    • T
      ALSA: usb-audio: Choose audioformat of a counter-part substream · 5d15f1eb
      Takashi Iwai 提交于
      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.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      5d15f1eb
    • T
      ALSA: usb-audio: Fix the missing endpoints creations for quirks · b2345a8a
      Takashi Iwai 提交于
      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: NFrantišek Kučera <konference@frantovo.cz>
      Link: https://lore.kernel.org/r/20210108075219.21463-2-tiwai@suse.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      b2345a8a
  18. 08 1月, 2021 1 次提交