23 Jul, 2019

1 commit

  • A previous fix to the stop handling on compressed capture streams causes
    some knock on issues. The previous fix updated snd_compr_drain_notify to
    set the state back to PREPARED for capture streams. This causes some
    issues however as the handling for snd_compr_poll differs between the
    two states and some user-space applications were relying on the poll
    failing after the stream had been stopped.

    To correct this regression whilst still fixing the original problem the
    patch was addressing, update the capture handling to skip the PREPARED
    state rather than skipping the SETUP state as it has done until now.

    Fixes: 4f2ab5e1d13d ("ALSA: compress: Fix stop handling on compressed capture streams")
    Signed-off-by: Charles Keepax
    Acked-by: Vinod Koul
    Signed-off-by: Takashi Iwai

    Charles Keepax
     

06 Feb, 2019

1 commit

  • 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

    Charles Keepax
     

14 Dec, 2018

1 commit

  • Existing compress offload code allocates data buffers using simple kmalloc,
    however there are situations where these buffers have to be mapped
    in smmu. So provide a way to set the runtime buffer by the driver itself,
    simillar to what we do with pcm.

    This patch adds support to set runtime dma buffer on compressed stream.

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

    Srinivas Kandagatla
     

02 Jul, 2018

1 commit


15 Nov, 2016

1 commit

  • Some fields in struct snd_compr have no corresponding comments, and
    the kernel-doc complains like:

    ./include/sound/compress_driver.h:162: warning: No description found for parameter 'id[64]'
    ./include/sound/compress_driver.h:162: warning: No description found for parameter 'proc_root'
    ./include/sound/compress_driver.h:162: warning: No description found for parameter 'proc_info_entry'

    Actually all these are internal elements, just put "private:" comment
    so that they will be ignored.

    Acked-by: Vinod Koul
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

13 Jun, 2016

1 commit

  • Currently, the avail IOCTL doesn't pass any error status, which
    means typically on error it simply shows no data available. This
    can lead to situations where user-space is waiting indefinitely
    for data that will never come as the DSP has suffered an
    unrecoverable error.

    Add snd_compr_stop_error which end drivers can call to indicate
    the stream has suffered an unrecoverable error and stop it. The
    avail and poll IOCTLs are then updated to report if the stream is
    in an error state to user-space. Allowing the error to propagate
    out. Processing of the actual snd_compr_stop needs to be deferred
    to a worker thread as the end driver may detect the errors during
    an existing operation callback.

    Signed-off-by: Charles Keepax
    Acked-by: Vinod Koul
    Signed-off-by: Mark Brown

    Charles Keepax
     

30 Nov, 2015

2 commits


04 Mar, 2015

1 commit


04 Feb, 2015

1 commit


02 Feb, 2015

1 commit


13 Jan, 2015

1 commit

  • Fixes the following compilation error:

    include/sound/compress_driver.h: In function ‘snd_compr_drain_notify’:
    include/sound/compress_driver.h:177:2: error: implicit declaration of function ‘snd_BUG_ON’ [-Werror=implicit-function-declaration]
    if (snd_BUG_ON(!stream))

    snd_BUG_ON() is defined in sound/core.h but the file is not included explicitly,
    so include it.

    Signed-off-by: Qais Yousef
    Acked-by: Vinod Koul
    Signed-off-by: Takashi Iwai

    Qais Yousef
     

29 Oct, 2014

1 commit


07 Nov, 2013

1 commit

  • The drain and drain_notify callback were blocked by low level driver
    until the draining was complete. Due to this being invoked with big
    fat mutex held, others ops like reading timestamp, calling pause, drop
    were blocked.

    So to fix this we add a new snd_compr_drain_notify() API. This would
    be required to be invoked by low level driver when drain or partial
    drain has been completed by the DSP. Thus we make the drain and
    partial_drain callback as non blocking and driver returns immediately
    after notifying DSP. The waiting is done while releasing the lock so
    that other ops can go ahead.

    [ The commit 917f4b5cba78 was wrongly applied from the preliminary
    patch. This commit corrects to the final version.
    Sorry for inconvenience! -- tiwai ]

    Signed-off-by: Vinod Koul
    CC: stable@vger.kernel.org
    Signed-off-by: Takashi Iwai

    Vinod Koul
     

24 Oct, 2013

1 commit

  • The drain and drain_notify callback were blocked by low level driver untill the
    draining was complete. Due to this being invoked with big fat mutex held, others
    ops like reading timestamp, calling pause, drop were blocked.

    So to fix this we add a new snd_compr_drain_notify() API. This would be required
    to be invoked by low level driver when drain or partial drain has been completed
    by the DSP. Thus we make the drain and partial_drain callback as non blocking
    and driver returns immediately after notifying DSP.
    The waiting is done while relasing the lock so that other ops can go ahead.

    Signed-off-by: Vinod Koul
    CC: stable@vger.kernel.org
    Signed-off-by: Takashi Iwai

    Vinod Koul
     

21 Apr, 2013

3 commits


14 Feb, 2013

1 commit

  • this add new API for sound compress to support gapless playback.
    As noted in Documentation change, we add API to send metadata of encoder and
    padding delay to DSP. Also add API for indicating EOF and switching to
    subsequent track

    Also bump the compress API version

    Signed-off-by: Jeeja KP
    Signed-off-by: Vinod Koul
    Signed-off-by: Takashi Iwai

    Jeeja KP
     

21 Aug, 2012

1 commit

  • Here we update the asoc structures to add compress stream definations
    First the struct snd_soc_dai_driver adds a new member to indicate if the dai is
    compressed or pcm. Next we add a new structre the struct snd_soc_compr_ops in
    the struct snd_soc_dai_link. This is to be used for machine driver to perform
    any opertaions required for setting up compressed audio streams

    next is the compressed data operations, they are added using struct
    snd_compr_ops in the struct snd_soc_platform_driver.

    Signed-off-by: Namarta Kohli
    Signed-off-by: Ramesh Babu K V
    Signed-off-by: Vinod Koul
    Signed-off-by: Mark Brown

    Vinod Koul
     

23 Dec, 2011

1 commit