1. Apr 17, 2019
    • Takashi Iwai's avatar
      ALSA: core: Don't refer to snd_cards array directly · f4fa9689
      Takashi Iwai authored
      
      
      The snd_cards[] array holds the card pointers that have been currently
      registered, and it's exported for the external modules that may need
      to refer a card object.  But accessing to this array can be racy
      against the driver probe or removal, as the card registration or free
      may happen concurrently.
      
      This patch gets rid of the direct access to snd_cards[] array and
      provides a helper function to give the card object from the index
      number with a refcount management.  Then the caller can access to the
      given card object safely, and releases it via snd_card_unref().
      
      While we're at it, add a proper comment to snd_card_unref() and make
      it an inlined function for type-safety, too.
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f4fa9689
    • Takashi Iwai's avatar
      ALSA: emu10k1: Drop superfluous id-uniquification behavior · c9899549
      Takashi Iwai authored
      
      
      The emu10k1 driver tries to create a unique id string by itself when
      it's copied from the card list, but it's rather superfluous, as the
      same thing will be done in ALSA core side at the card registration.
      Let's drop the code.  This allows us removing snd_cards export.
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c9899549
  2. Apr 15, 2019
    • Takashi Iwai's avatar
      ALSA: seq: Correct unlock sequence at snd_seq_client_ioctl_unlock() · b5fd12d6
      Takashi Iwai authored
      The doubly unlock sequence at snd_seq_client_ioctl_unlock() is tricky.
      I took a direct unref call since I thought it would avoid
      misunderstanding, but rather this seems more confusing.  Let's use
      snd_seq_client_unlock() consistently even if they look strange to be
      called twice, and add more comments for avoiding reader's confusion.
      
      Fixes: 6b580f52
      
       ("ALSA: seq: Protect racy pool manipulation from OSS sequencer")
      Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      b5fd12d6
    • Roope Salmi's avatar
      ALSA: usb-audio: Add quirk for Focusrite Scarlett Solo · 46f5710f
      Roope Salmi authored
      
      
      The device reports Synch: Synchronous on the playback interface.
      This causes regular audible napping on sample rates that are not multiples
      of 1 kHz. Fix to Synch: Asynchronous.
      
      Specifically observed on Focusrite Scarlett Solo 2nd generation. I assume
      the first generation model has a different device ID. A first generation
      Scarlett 2i2 I was able to test advertised Synch: Asynchronous by default.
      
      For example, with a sample rate of 44100 Hz, a silent sample is played
      every 40.96 seconds (likely 44.0 samples instead of 44.1 transmitted per
      USB frame on average, 4096 being the size of some internal buffer).
      There may be some other bug at play here since this doesn't happen
      on other platforms. However, a feedback endpoint is listed and using it
      fixes the issue. That is the only change in the quirk,
      but I didn't find a way to declare only it.
      
      Tested on two units and on two different computers.
      
      Signed-off-by: default avatarRoope Salmi <rpsalmi@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      46f5710f
  3. Apr 13, 2019
  4. Apr 12, 2019
  5. Apr 11, 2019
  6. Apr 10, 2019
  7. Apr 09, 2019
    • Takashi Iwai's avatar
      ALSA: seq: Remove superfluous irqsave flags · f823b8a7
      Takashi Iwai authored
      
      
      spin_lock_irqsave() is used unnecessarily in various places in
      sequencer core code although it's pretty obvious that the context is
      sleepable.  Remove irqsave and use the plain spin_lock_irq() in such
      places for simplicity.
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f823b8a7
    • Takashi Iwai's avatar
      ALSA: seq: Align temporary re-locking with irqsave version · 4b24b960
      Takashi Iwai authored
      
      
      In a few places in sequencer core, we temporarily unlock / re-lock the
      pool spin lock while waiting for the allocation in the blocking mode.
      There spin_unlock_irq() / spin_lock_irq() pairs are called while
      initially spin_lock_irqsave() is used (and spin_lock_irqrestore() at
      the end of the function again).  This is likely OK for now, but it's a
      bit confusing and error-prone.
      
      This patch replaces these temporary relocking lines with the irqsave
      variant to make the lock/unlock sequence more consistently.
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4b24b960
    • Takashi Iwai's avatar
      ALSA: seq: Use kvmalloc() for cell pools · fd7ae83d
      Takashi Iwai authored
      
      
      Use kvmalloc() for allocating cell pools since the pool size can be
      relatively small that may be covered better by slab.
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      fd7ae83d
    • Takashi Iwai's avatar
      ALSA: timer: Revert active callback sync check at close · df55531b
      Takashi Iwai authored
      This is essentially a revert of the commit a7588c89 ("ALSA: timer:
      Check ack_list emptiness instead of bit flag").  The intended change
      by the commit turns out to be insufficient, as snd_timer_close*()
      always calls snd_timer_stop() that deletes the ack_list beforehand.
      
      In theory, we can change the behavior of snd_timer_stop() to sync the
      pending ack_list, but this will become a deadlock for the callback
      like sequencer that calls again snd_timer_stop() from itself.  So,
      reverting the change is a more straightforward solution.
      
      Fixes: a7588c89
      
       ("ALSA: timer: Check ack_list emptiness instead of bit flag")
      Reported-by: default avatar <syzbot+58813d77154713f4de15@syzkaller.appspotmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      df55531b
  8. Apr 08, 2019
  9. Apr 05, 2019
  10. Apr 04, 2019
  11. Apr 03, 2019