19 Dec, 2011

1 commit

  • module_param(bool) used to counter-intuitively take an int. In
    fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
    trick.

    It's time to remove the int/unsigned int option. For this version
    it'll simply give a warning, but it'll break next kernel version.

    Signed-off-by: Rusty Russell
    Signed-off-by: Takashi Iwai

    Rusty Russell
     

01 Nov, 2011

2 commits


04 Oct, 2011

1 commit

  • This is mostly a static checker fix more than anything else. We're
    copying from a 64 char buffer into a 44 char buffer.

    The 64 character buffer is str[] in snd_mixer_oss_build_test_all().
    The call tree is:
    snd_mixer_oss_build_test_all()
    -> snd_mixer_oss_build_test()
    -> snd_mixer_oss_build_test().

    We never actually do fill str[] buffer all the way to 64 characters.
    The longest string is:
    sprintf(str, "%s Playback Switch", ptr->name);
    ptr->name is a 32 character buffer so 32 plus 16 characters for
    " Playback Switch" still puts us over the 44 limit from "id.name".

    Most likely ptr->name never gets filled to the limit, but we can't
    really change the size of that buffer so lets just use strlcpy() here
    and be safe.

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

    Dan Carpenter
     

26 May, 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
     

10 Jan, 2011

1 commit


30 Nov, 2010

1 commit


11 Oct, 2010

2 commits


07 Sep, 2010

1 commit


13 Apr, 2010

1 commit

  • Set no_llseek to llseek file ops of each sound component (but for hwdep).
    This avoids the implicit BKL invocation via generic_file_llseek() used
    as default when fops.llseek is NULL.

    Also call nonseekable_open() at each open ops to ensure the file flags
    have no seek bit.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

27 Jan, 2010

1 commit

  • Clemens Ladisch noted for hw_ptr_removal in "cleanup & merge hw_ptr
    update functions" commit:

    "It is possible for the status/delay ioctls to be called when the sound
    card's pointer register alreay shows a position at the beginning of the
    new period, but immediately before the interrupt is actually executed.
    (This happens regularly on a SMP machine with mplayer.) When that
    happens, the code thinks that the position must be at least one period
    ahead of the current position and drops an entire buffer of data."

    Return back the hw_ptr_interrupt variable. The last interrupt pointer
    is always computed from the latest hw_ptr instead of tracking it
    separately (in this case all hw_ptr checks and modifications might
    influence also hw_ptr_interrupt and it is difficult to keep it
    consistent).

    Signed-off-by: Jaroslav Kysela

    Jaroslav Kysela
     

07 Jan, 2010

1 commit

  • Do general cleanup in snd_pcm_update_hw_ptr*() routines and merge them.
    The main change is hw_ptr_interrupt variable removal to simplify code
    logic. This variable can be computed directly from hw_ptr.

    Ensure that updated hw_ptr is not lower than previous one (it was possible
    with old code in some obscure situations when interrupt was delayed or
    the lowlevel driver returns wrong ring buffer position value).

    Signed-off-by: Jaroslav Kysela

    Jaroslav Kysela
     

05 Nov, 2009

2 commits


10 Sep, 2009

1 commit


08 Sep, 2009

1 commit


31 Aug, 2009

1 commit


05 Jun, 2009

1 commit


07 Apr, 2009

1 commit

  • Added an else part to check
    SNDRV_MIXER_OSS_PRESENT_CVOLUME for MIC (slot 7)
    in commit 36c7b833e5d2501142a371e4e75281d3a29fbd6b

    Similarly, checks and volume control is required for
    SNDRV_MIXER_OSS_PRESENT_CSWITCH and SNDRV_MIXER_OSS_PRESENT_CROUTE
    as well.

    Signed-off-by: Deepika Makhija
    Signed-off-by: Viral Mehta
    Signed-off-by: Takashi Iwai

    Deepika Makhija
     

27 Mar, 2009

1 commit


24 Mar, 2009

1 commit


18 Mar, 2009

2 commits

  • s/mutex_lock/mutex_unlock/ on 2 fail paths in snd_pcm_oss_proc_write.
    Probably a typo, lock should be unlocked when leaving the function.

    Signed-off-by: Jiri Slaby
    Cc:
    Signed-off-by: Takashi Iwai

    Jiri Slaby
     
  • At the time of initialization, SNDRV_MIXER_OSS_PRESENT_PVOLUME bit is not
    set for MIC (slot 7).
    So, the same should not be checked when an application tries to do gain
    control for audio recording devices.

    Just check slot->present for SNDRV_MIXER_OSS_PRESENT_CVOLUME independently.
    Verified with a simple application which opens /dev/dsp for recording and
    /dev/mixer for volume control.

    Have tested two usb audio mic devices.

    Signed-off-by: Viral Mehta
    Signed-off-by: Takashi Iwai

    Viral Mehta
     

16 Mar, 2009

1 commit

  • Traditionally, changes to struct file->f_flags have been done under BKL
    protection, or with no protection at all. This patch causes all f_flags
    changes after file open/creation time to be done under protection of
    f_lock. This allows the removal of some BKL usage and fixes a number of
    longstanding (if microscopic) races.

    Reviewed-by: Christoph Hellwig
    Cc: Al Viro
    Signed-off-by: Jonathan Corbet

    Jonathan Corbet
     

23 Feb, 2009

1 commit


05 Feb, 2009

2 commits


21 Oct, 2008

1 commit


13 Aug, 2008

1 commit


01 Aug, 2008

1 commit


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
     

24 Apr, 2008

1 commit


01 Feb, 2008

4 commits

  • The PCM OSS emulation can cause Oops at sync operation due to the wrong
    data size calculation. Typically happening on Sparc64:
    http://lkml.org/lkml/2008/1/24/426

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

    Takashi Iwai
     
  • 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
     

09 Jan, 2008

1 commit