1. 09 Jun, 2017 26 commits
  2. 08 Jun, 2017 9 commits
  3. 07 Jun, 2017 5 commits
    • Takashi Sakamoto's avatar
      ALSA: pcm: obsolete RULES_DEBUG local macro · c6706de0
      Takashi Sakamoto authored
      Added tracepoints obsoleted RULES_DEBUG local macro and relevant codes.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c6706de0
    • Takashi Sakamoto's avatar
      ALSA: pcm: enable parameter tracepoints only when CONFIG_SND_DEBUG is enabled · 37567c55
      Takashi Sakamoto authored
      In a previous commit, tracepoints are added for PCM parameter processing.
      As long as I know, this implementation increases size of relocatable
      object by 35%. For vendors who are conscious of memory footprint, it
      brings apparent disadvantage.
      
      This commit utilizes CONFIG_SND_DEBUG configuration to enable/disable the
      tracepoints.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      37567c55
    • Takashi Sakamoto's avatar
      ALSA: pcm: tracepoints for refining PCM parameters · be4e31da
      Takashi Sakamoto authored
      When working for devices which support configurable modes for its data
      transmission or which consists of several components, developers are
      likely to use rules of parameters of PCM substream. However, there's no
      infrastructure to assist their work.
      
      In old days, ALSA PCM core got a local 'RULES_DEBUG' macro to debug
      refinement of parameters for PCM substream. Although this is merely a
      makeshift. With some modifications, we get the infrastructure.
      
      This commit is for the purpose. Refinement of mask/interval type of
      PCM parameters is probed as tracepoint events as 'hw_mask_param' and
      'hw_interval_param' on existent 'snd_pcm' subsystem.
      Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      be4e31da
    • Takashi Iwai's avatar
      ALSA: timer: Wrap with spinlock for queue access · d7f910bf
      Takashi Iwai authored
      For accessing the snd_timer_user queue indices, we take tu->qlock.
      But it's forgotten in a couple of places.
      
      The one in snd_timer_user_params() should be safe without the
      spinlock as the timer is already stopped.  But it's better for
      consistency.
      
      The one in poll is just a read-out, so it's not inevitably needed, but
      it'd be good to make the result consistent, too.
      Tested-by: default avatarAlexander Potapenko <glider@google.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d7f910bf
    • Takashi Iwai's avatar
      ALSA: timer: Improve user queue reallocation · 890e2cb5
      Takashi Iwai authored
      ALSA timer may reallocate the user queue upon request, and it happens
      at three places for now: at opening, at SNDRV_TIMER_IOCTL_PARAMS, and
      at SNDRV_TIMER_IOCTL_SELECT.  However, the last one,
      snd_timer_user_tselect(), doesn't need to reallocate the buffer since
      it doesn't change the queue size.  It does just because tu->tread
      might have been changed before starting the timer.
      
      Instead of *_SELECT ioctl, we should reallocate the queue at
      SNDRV_TIMER_IOCTL_TREAD; then the timer is guaranteed to be stopped,
      thus we can reassign the buffer more safely.
      
      This patch implements that with a slight code refactoring.
      Essentially, the patch achieves:
      - Introduce realloc_user_queue() for (re-)allocating the ring buffer,
        and call it from all places.  Also, realloc_user_queue() uses
        kcalloc() for avoiding possible leaks.
      - Add the buffer reallocation at SNDRV_TIMER_IOCTL_TREAD.  When it
        fails, tu->tread is restored to the old value, too.
      - Drop the buffer reallocation at snd_timer_user_tselect().
      Tested-by: default avatarAlexander Potapenko <glider@google.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      890e2cb5