01 Nov, 2011

1 commit


15 Feb, 2011

1 commit

  • Change the core code where sparse complains. In most cases, this means
    just adding annotations to confirm that we indeed want to do the dirty
    things we're doing.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

11 Oct, 2010

1 commit


17 Sep, 2010

1 commit


07 Sep, 2010

1 commit


28 Aug, 2010

1 commit

  • There were some new formats added in commit 15c0cee6c809 "ALSA: pcm:
    Define G723 3-bit and 5-bit formats". That commit increased
    SNDRV_PCM_FORMAT_LAST as well. My concern is that there are a couple
    places which do:

    for (i = 0; i < SNDRV_PCM_FORMAT_LAST; i++) {
    if (dummy->pcm_hw.formats & (1ULL << i))
    snd_iprintf(buffer, " %s", snd_pcm_format_name(i));
    }

    I haven't tested these but it looks like if "i" were equal to
    SNDRV_PCM_FORMAT_G723_24 or higher then we might read past the end of
    the array.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Takashi Iwai

    Dan Carpenter
     

11 May, 2010

1 commit

  • This patch changes the string based list management to a handle base
    implementation to help with the hot path use of pm-qos, it also renames
    much of the API to use "request" as opposed to "requirement" that was
    used in the initial implementation. I did this because request more
    accurately represents what it actually does.

    Also, I added a string based ABI for users wanting to use a string
    interface. So if the user writes 0xDDDDDDDD formatted hex it will be
    accepted by the interface. (someone asked me for it and I don't think
    it hurts anything.)

    This patch updates some documentation input I got from Randy.

    Signed-off-by: markgross
    Signed-off-by: Rafael J. Wysocki

    Mark Gross
     

21 Jan, 2010

1 commit


07 Jan, 2010

1 commit


10 Nov, 2009

1 commit


06 Nov, 2009

1 commit

  • Instead of storing the PID number, take a reference to the task's pid
    structure. This protects against duplicates due to PID overflows, and
    using pid_vnr() ensures that the PID returned by snd_ctl_elem_info() is
    correct as seen from the current namespace.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

30 Oct, 2009

1 commit

  • In pcm.c, if the NULL test on pcm is needed, then the dereference should be
    after the NULL test.

    In dummy.c and ali5451.c, the context of the calls to
    snd_card_dummy_new_mixer and snd_ali_free_voice show that dummy and pvoice,
    respectively cannot be NULL.

    A simplified version of the semantic match that detects this problem is as
    follows (http://coccinelle.lip6.fr/):

    //
    @match exists@
    expression x, E;
    identifier fld;
    @@

    * x->fld
    ... when != \(x = E\|&x\)
    * x == NULL
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Takashi Iwai

    Julia Lawall
     

08 Sep, 2009

1 commit


24 Mar, 2009

1 commit


09 Mar, 2009

1 commit


05 Feb, 2009

1 commit


25 Sep, 2008

1 commit

  • The PCM and rawmidi open callbacks have a lock against card->controls_list
    but it takes a wrong one, card->controls_rwsem, instead of a right one
    card->ctl_files_rwlock. This patch fixes them.

    This change also fixes automatically the potential deadlocks due to
    mm->mmap_sem in munmap and copy_from/to_user, reported by Sitsofe
    Wheeler:

    A: snd_ctl_elem_user_tlv(): card->controls_rwsem => mm->mmap_sem
    B: snd_pcm_open(): card->open_mutex => card->controls_rwsem
    C: munmap: mm->mmap_sem => snd_pcm_release(): card->open_mutex

    The patch breaks the chain.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

13 Aug, 2008

1 commit


01 Aug, 2008

2 commits

  • When compiled with CONFIG_SND_DYNAMIC_MINORS the ALSA core is fine
    to have more than 8 PCM devices per card, except one place - the
    SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE ioctl, which will not enumerate
    devices > 7. This patch fixes the issue, changing the devices list
    organisation.

    Instead of adding new device to the tail, the list is now kept always
    ordered (by card number, then device number). Thus, during enumeration,
    it is easy to discover the fact that there is no more given card's
    devices.

    Additionally the device field of struct snd_pcm had to be changed to int,
    as its "unsignednity" caused a lot of problems when comparing it to
    potentially negative signed values. (-1 is 0xffffffff or even more then ;-)

    Signed-off-by: Pawel Moll
    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Pawel MOLL
     
  • This reverts commit fb3d6f2b77bdec75d45aa9d4464287ed87927866.

    New, updated patch with same subject replaces this commit.

    Signed-off-by: Jaroslav Kysela

    Jaroslav Kysela
     

30 Jul, 2008

1 commit

  • When compiled with CONFIG_SND_DYNAMIC_MINORS the ALSA core is fine
    to have more than 8 PCM devices per card, except one place - the
    SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE ioctl, which will not enumerate
    devices > 7. This patch fixes the issue, changing the devices list
    organisation.

    Instead of adding new device to the tail, the list is now kept always
    ordered (by card number, then device number). Thus, during enumeration,
    it is easy to discover the fact that there is no more given card's
    devices. The same limit was present in OSS emulation code. It has
    been fixed as well.

    Additionally the device field of struct snd_pcm is now int, instead of
    unsigned int, as there is no obvious reason for keeping it unsigned.
    This caused a lot of problems with comparing this value with other
    (almost always signed) variables. There is just one more place where
    device number is unsigned - in struct snd_pcm_info, which should be
    also sorted out in future.

    Signed-off-by: Pawel MOLL
    Signed-off-by: Jaroslav Kysela

    Pawel MOLL
     

01 Feb, 2008

4 commits

  • Change semantics for SNDRV_PCM_TSTAMP_MMAP. Doing timestamping only in
    the interrupt handler might cause that hw_ptr is not related to actual
    timestamp. With this change, grab timestamp at every hw_ptr update to
    have always valid timestamp + ring buffer position pair.
    With this change, SNDRV_PCM_TSTAMP_MMAP was renamed to
    SNDRV_PCM_TSTAMP_ENABLE. It's no regression (I think).

    Signed-off-by: Jaroslav Kysela

    Jaroslav Kysela
     
  • This header file exists only for some hacks to adapt alsa-driver
    tree. It's useless for building in the kernel. Let's move a few
    lines in it to sound/core.h and remove it.
    With this patch, sound/driver.h isn't removed but has just a single
    compile warning to include it. This should be really killed in
    future.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Takashi Iwai
     
  • The 'tick' in PCM is set (again) via sw_params. And, nobody uses
    this feature at all except for a command line option of aplay.
    (This is literally 'nobody', as I checked alsa-lib API calls in all
    programs in major distros.)
    Above all, if we need finer wake-ups for the position update, it's
    basically an issue that the driver should solve, not tuned by each
    application.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Takashi Iwai
     
  • The xfer_align sw_params parameter has never been used in a sane manner,
    and no one understands what this does exactly. The current
    implementation looks also buggy because it allows write of shorter size
    than xfer_align. So, if you do partial writes, the write isn't actually
    aligned at all.
    Removing this parameter will make some pcm_lib_* code more readable
    (and less buggy).

    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Takashi Iwai
     

16 Oct, 2007

1 commit


09 Feb, 2007

3 commits


20 Dec, 2006

1 commit

  • If snd_pcm_new_stream() fails to initalize a substream (if
    snd_pcm_substream_proc_init() returns error), snd_pcm_new_stream()
    immediately return without unlinking that kfree()d substram.
    It causes oops when snd_pcm_free() iterates the list of substream to
    free them by invalid reference.

    Signed-off-by: Akinobu Mita
    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Akinobu Mita
     

02 Dec, 2006

1 commit

  • Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.

    It also makes the struct sound_card to show up as a "real" device
    where all the different sound class devices are placed as childs
    and different card attribute files can hang off of. /sys/class/sound is
    still a flat directory, but the symlink targets of all devices belonging
    to the same card, point the the /sys/devices tree below the new card
    device object.

    Thanks to Kay for the updates to this patch.

    Signed-off-by: Kay Sievers
    Acked-by: Jaroslav Kysela
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

01 Oct, 2006

1 commit

  • Add maximum latency tracking to the ALSA subsystem for PCM playback. In
    ALSA, the playback application controls the buffer size and thus indirectly
    the period of latency that it can deal with. This patch uses 75% of the
    total available latency as threshold to announce to the latency subsystem;
    While 75% is a crude heuristic it's a quite reasonable one; the remaining
    25% can be used for all driver processing for the next samples which is
    also proportional to the size of the buffer.

    With ogg123 a latency setting of about 4msec was seen (at 44Khz), while
    with the "play" command a much longer maximum tolerable latency was seen.
    Other, more multimedia oriented players as well as games, will have a lot
    smaller buffers to allow better synchronization and those will actually get
    into the latency domains where there is impact on the power management
    rules.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Takashi Iwai
     

23 Sep, 2006

4 commits

  • This patch adds a new attribute, pcm_class, to each PCM sysfs entry.
    It's useful to detect what kind of PCM stream is, for example, HAL
    can check whether it's a modem or not.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Takashi Iwai
     
  • The PCM and rawmidi substreams can be selected explicitly by opening
    control handle and set via *_PREFER_SUBDEVICE ioctl. But, when
    multiple controls are opened, the driver gets confused.
    The patch fixes the initialization of prefer_*_subdevice and the
    check of multiple controls. The first set subdevice is picked up
    as the valid one.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Takashi Iwai
     
  • Orignally proposed by Sam Revitch .
    Unregister device files at disconnection to avoid the futher accesses.
    Also, the dev_unregister callback is removed and replaced with the
    combination of disconnect + free.
    A new function snd_card_free_when_closed() is introduced, which is
    used in USB disconnect callback.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Takashi Iwai
     
  • - Add the linked list to each proc entry to enable a single-shot
    disconnection (unregister)
    - Deprecate snd_info_unregister(), use snd_info_free_entry()
    - Removed NULL checks of snd_info_free_entry()

    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Takashi Iwai
     

23 Jun, 2006

4 commits