18 Apr, 2019

3 commits


13 Feb, 2019

1 commit

  • commit 4f2ab5e1d13d6aa77c55f4914659784efd776eb4 upstream.

    It is normal user behaviour to start, stop, then start a stream
    again without closing it. Currently this works for compressed
    playback streams but not capture ones.

    The states on a compressed capture stream go directly from OPEN to
    PREPARED, unlike a playback stream which moves to SETUP and waits
    for a write of data before moving to PREPARED. Currently however,
    when a stop is sent the state is set to SETUP for both types of
    streams. This leaves a capture stream in the situation where a new
    start can't be sent as that requires the state to be PREPARED and
    a new set_params can't be sent as that requires the state to be
    OPEN. The only option being to close the stream, and then reopen.

    Correct this issues by allowing snd_compr_drain_notify to set the
    state depending on the stream direction, as we already do in
    set_params.

    Fixes: 49bb6402f1aa ("ALSA: compress_core: Add support for capture streams")
    Signed-off-by: Charles Keepax
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Charles Keepax
     

13 Dec, 2018

1 commit

  • commit 5363857b916c1f48027e9b96ee8be8376bf20811 upstream.

    As addressed in alsa-lib (commit b420056604f0), we need to fix the
    case where the evaluation of PCM interval "(x x+1]" leading to
    -EINVAL. After applying rules, such an interval may be translated as
    "(x x+1)".

    Fixes: ff2d6acdf6f1 ("ALSA: pcm: Fix snd_interval_refine first/last with open min/max")
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

18 Sep, 2018

1 commit


12 Sep, 2018

1 commit

  • Internally, skl_init_chip() calls snd_hdac_bus_init_chip() which
    1) sets bus->chip_init to prevent multiple entrances before device
    is stopped; 2) enables interrupt.

    We shouldn't use it for the purpose of resetting device only because
    1) when we really want to initialize device, we won't be able to do
    so; 2) we are ready to handle interrupt yet, and kernel crashes when
    interrupt comes in.

    Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset
    device properly.

    Fixes: 60767abcea3d ("ASoC: Intel: Skylake: Reset the controller in probe")
    Reviewed-by: Takashi Iwai
    Signed-off-by: Yu Zhao
    Signed-off-by: Mark Brown

    Yu Zhao
     

15 Aug, 2018

1 commit

  • Commit a655de808cbde ("ASoC: core: Allow topology to override
    machine driver FE DAI link config.") caused soc_dai_hw_params to
    be come dependent on the substream private_data being set with
    a pointer to the snd_soc_pcm_runtime. Currently, CODEC to CODEC
    links don't set this, which causes a NULL pointer dereference:

    [] (soc_dai_hw_params) from
    [] (snd_soc_dai_link_event+0x1a0/0x380)

    Since the ASoC core in general assumes that the substream
    private_data will be set to a pointer to the snd_soc_pcm_runtime,
    update the CODEC to CODEC links to respect this.

    Signed-off-by: Charles Keepax
    Signed-off-by: Mark Brown

    Charles Keepax
     

13 Aug, 2018

1 commit

  • …e/sound into for-linus

    ASoC: Updates for v4.19

    A fairly big update, including quite a bit of core activity this time
    around (which is good to see) along with a fairly large set of new
    drivers.

    - A new snd_pcm_stop_xrun() helper which is now used in several
    drivers.
    - Support for providing name prefixes to generic component nodes.
    - Quite a few fixes for DPCM as it gains a bit wider use and more
    robust testing.
    - Generalization of the DIO2125 support to a simple amplifier driver.
    - Accessory detection support for the audio graph card.
    - DT support for PXA AC'97 devices.
    - Quirks for a number of new x86 systems.
    - Support for AM Logic Meson, Everest ES7154, Intel systems with
    RT5682, Qualcomm QDSP6 and WCD9335, Realtek RT5682 and TI TAS5707.

    Takashi Iwai
     

03 Aug, 2018

1 commit

  • DRM based audio components get registered inside the component framework
    bind callback. However component framework has a big mutex lock taken for
    every call to component_add, component_del and bind, unbind callbacks.

    This can lead to deadlock situation if we are trying to add new/remove
    component within a bind/unbind callbacks. Which is what was happening
    with bcm2837 rpi 3.

    Revert this change till we sort out the mutex issue.

    Reported-by: Guillaume Tucker
    Reported-by: Stefan Wahren
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Mark Brown

    Srinivas Kandagatla
     

02 Aug, 2018

2 commits


01 Aug, 2018

1 commit


30 Jul, 2018

3 commits

  • The trigger flag in vmidi object can be referred in different contexts
    concurrently, hence it's better to be put with READ_ONCE() and
    WRITE_ONCE() macros to assure the accesses.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The virmidi sequencer stuff tries to translate the rawmidi bytes to
    sequencer events and deliver the packets at trigger callback. The
    amount of the whole process of these translations and deliveries
    depends on the incoming rawmidi bytes, and we have no limit for that;
    this was the cause of a CPU soft lockup that had been reported and
    fixed recently.

    Although we've fixed the soft lockup by putting the temporary unlock
    and cond_resched(), it's rather a quick band aid. In this patch,
    meanwhile, the event parsing and delivery process is offloaded to a
    dedicated work, and the trigger callback just kicks it off. It has
    three merits, at least:

    - The processing is always done in a sleepable context, which can
    assure the event delivery with non-atomic flag without hackish
    is_atomic() usage.

    - Other relevant codes can be simplified, reducing the lines

    - It makes me happier

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The recent fix moved the inline snd_sgbuf_aligned_pages() outside the
    ifdef, and this triggered a build error on some architectures due to
    the undefined PAGE_SIZE, as spotted by 0day bot.
    Fix it by adding the missing header inclusion.

    Fixes: 4cae99d9b530 ("ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally")
    Reported-by: kbuild test robot
    Cc: Pierre-Louis Bossart
    Signed-off-by: Takashi Iwai
    Signed-off-by: Mark Brown

    Takashi Iwai
     

27 Jul, 2018

5 commits

  • The PCM format type is with __bitwise, and it can't be converted from
    integer implicitly. Instead of an ugly cast, declare the function
    argument of snd_sb_csp_autoload() with the proper snd_pcm_format_t
    type.

    This fixes the sparse warnings like:
    sound/isa/sb/sb16_csp.c:743:22: warning: restricted snd_pcm_format_t degrades to integer

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The PCM format type is defined with __bitwise, hence it can't be
    passed as integer but needs an explicit cast. In this patch, instead
    of the messy cast flood, define the format argument of
    snd_hdac_calc_stream_format() to be the proper snd_pcm_format_t type.

    This fixes sparse warnings like:
    sound/hda/hdac_device.c:760:38: warning: incorrect type in argument 1 (different base types)

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Many drivers calling snd_mask_set() need to do ugly cast with __force
    for shutting up the sparse warnings. Actually almost all of them are
    about setting the format, so it's far better to provide a common
    helper snd_mask_set_format() to pass SNDRV_PCM_FORMAT_* directly
    without the cast.

    There are a few other calls of snd_mask_set(), but they are in the PCM
    core code, so we leave them for now.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Mark Brown

    Takashi Iwai
     
  • …inux/kernel/git/broonie/sound into asoc-4.19

    ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally

    Make this helper inline function available for all platforms. This
    helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not
    defined.

    Mark Brown
     
  • Make this helper inline function available for all platforms. This
    helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not
    defined.

    Reported-by: kbuild test robot
    Signed-off-by: Pierre-Louis Bossart
    Reviewed-by: Takashi Iwai
    Signed-off-by: Mark Brown

    Pierre-Louis Bossart
     

26 Jul, 2018

1 commit

  • The snd_pcm_lib_read() and snd_pcm_lib_write() inline functions have
    the explicit cast from a user pointer to a kernel pointer, but they
    lacks of __force prefix.

    This fixes sparse warnings like:
    ./include/sound/pcm.h:1093:47: warning: cast removes address space of expression

    Fixes: 68541213720d ("ALSA: pcm: Direct in-kernel read/write support")
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

24 Jul, 2018

1 commit


21 Jul, 2018

1 commit

  • Amlogic's axg card driver can't use snd_soc_of_parse_tdm_slot()
    directly because it needs to handle 4 mask for each direction.
    Yet the parsing of each mask is the same, so export
    snd_soc_of_get_slot_mask() to reuse the the existing code.

    Signed-off-by: Jerome Brunet
    Signed-off-by: Mark Brown

    Jerome Brunet
     

20 Jul, 2018

1 commit


18 Jul, 2018

5 commits

  • This patch aims at achieving dynamic behaviour of audio card when
    the dependent components disappear and reappear.

    With this patch the card is removed if any of the dependent component
    is removed and card is added back if the dependent component comes back.
    All this is done using component framework and matching based on
    component name.

    Signed-off-by: Srinivas Kandagatla
    Reviewed-by: Vinod Koul
    Signed-off-by: Mark Brown

    Srinivas Kandagatla
     
  • snd_pcm_lib_mmap_vmalloc() was supposed to be implemented with
    somewhat special for vmalloc handling, but in the end, this turned to
    just the default handler, i.e. NULL. As the situation has never
    changed over decades, let's rip it off.

    Reviewed-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • This is the final step for more generic support of DRM audio
    component. The generic audio component code is now moved to its own
    file, and the symbols are renamed from snd_hac_i915_* to
    snd_hdac_acomp_*, respectively. The generic code is enabled via the
    new kconfig, CONFIG_SND_HDA_COMPONENT, while CONFIG_SND_HDA_I915 is
    kept as the super-class.

    Along with the split, three new callbacks are added to audio_ops:
    pin2port is for providing the conversion between the pin number and
    the widget id, and master_bind/master_unbin are called at binding /
    unbinding the master component, respectively. All these are optional,
    but used in i915 implementation and also other later implementations.

    A note about the new snd_hdac_acomp_init() function: there is a slight
    difference between this and the old snd_hdac_i915_init(). The latter
    (still) synchronizes with the master component binding, i.e. it
    assures that the relevant DRM component gets bound when it returns, or
    gives a negative error. Meanwhile the new function doesn't
    synchronize but just leaves as is. It's the responsibility by the
    caller's side to synchronize, or the caller may accept the
    asynchronous binding on the fly.

    v1->v2: Fix missing NULL check in master_bind/unbind

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The HD-audio i915 binding code contains a single pointer, hdac_acomp,
    for allowing the access to audio component from the master bind/unbind
    callbacks. This was needed because the callbacks pass only the device
    pointer and we can't guarantee the object type assigned to the drvdata
    (which is free for each controller driver implementation).
    And this implementation will be a problem if we support multiple
    components for different DRM drivers, not only i915.

    As a solution, allocate the audio component object via devres and
    associate it with the given device, so that the component callbacks
    can refer to it via devres_find().

    The removal of the object is still done half-manually via
    devres_destroy() to make the code consistent (although it may work
    without the explicit call).

    Also, the snd_hda_i915_register_notifier() had the reference to
    hdac_acomp as well. In this patch, the corresponding code is removed
    by passing hdac_bus object to the function, too.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • For allowing other drivers to use the DRM audio component, rename the
    i915_audio_component_* with drm_audio_component_*, and split the
    generic part into drm_audio_component.h. The i915 specific stuff
    remains in struct i915_audio_component, which contains
    drm_audio_component as the base.

    The license of drm_audio_component.h is kept to MIT as same as the the
    original i915_component.h.

    This is a preliminary change for further development, and no
    functional changes by this patch itself, merely code-split and
    renames.

    v1->v2: Use SPDX for drm_audio_component.h, fix remaining i915
    argument in drm_audio_component.h

    Reviewed-by: Rodrigo Vivi
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

11 Jul, 2018

1 commit

  • As done for format and channels, add the possibility to merge
    the backend rates on the frontend rates.

    This useful if the backend does not support all rates supported by the
    frontend, or if several backends (cpu and codecs) with different
    capabilities are connected to the same frontend.

    Signed-off-by: Jerome Brunet
    Signed-off-by: Mark Brown

    Jerome Brunet
     

06 Jul, 2018

1 commit

  • Currently ALSA core blocks userspace for about 10 seconds for PCM R/W IO.
    This needs to be configurable for modern hardware like DSPs where no
    pointer update in milliseconds can indicate terminal DSP errors.

    Add a substream variable to set the wait time in ms. This allows userspace
    and drivers to recover more quickly from terminal DSP errors.

    Signed-off-by: Liam Girdwood
    Signed-off-by: Takashi Iwai

    Liam Girdwood
     

03 Jul, 2018

2 commits

  • Machine drivers statically define a number of DAI links that currently
    cannot be changed or removed by topology. This means PCMs and platform
    components cannot be changed by topology at runtime AND machine drivers
    are tightly coupled to topology.

    This patch allows topology to override the machine driver DAI link config
    in order to reuse machine drivers with different topologies and platform
    components. The patch supports :-

    1) create new FE PCMs with a topology defined PCM ID.
    2) destroy existing static FE PCMs
    3) change the platform component driver.
    4) assign any new HW params fixups.
    5) assign a new card name prefix to differentiate this topology to userspace.

    The patch requires no changes to the machine drivers, but does add some
    platform component flags that the platform component driver can assign
    before loading topologies.

    Signed-off-by: Liam Girdwood
    Signed-off-by: Mark Brown

    Liam Girdwood
     
  • Merge the development branch for HD-audio ext bus refactoring.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

02 Jul, 2018

6 commits