03 Apr, 2014

1 commit

  • After change the pointer, ALSA lib would re-copy the initial data to
    DMA buffer because the pointer is pointing the zero position at the
    beginning, which results an audiable duplicated playback at the first
    eight periods.

    Even though dropping this patch would cause pointer being incorrectly
    estimated. But to maintain the sanity of basic playback, we revert
    the previous patch.

    This reverts commit 5d0d4e1558fa0c235691436e1c5d26d9c8950775.

    Acked-by: Wang Shengjiu
    Signed-off-by: Nicolin Chen

    Nicolin Chen
     

27 Mar, 2014

2 commits


25 Mar, 2014

1 commit

  • The HDMI IP in i.MX6DQ has a bug that it limits the dma period size within 8K.

    Patch 'ENGR00300188-1 ASoC: imx-hdmi-dma: Double the buffer and period sizes'
    doubled the period size which works great with Dual Lite but broke the HDMI
    audio function on DQ. Thus fix it for 6DQ case.

    Acked-by: Wang Shengjiu
    Signed-off-by: Nicolin Chen

    Nicolin Chen
     

11 Mar, 2014

2 commits

  • The offset reflects the current position of DMA access in the ALSA ring buffer.
    So we should clear it before re-start DMA engine becasue the DMA access should
    re-start its job from the 0 position. If we don't do this, the driver might get
    a wrong idea about current position of DMA access. Thus fix it.

    Acked-by: Wang Shengjiu
    Signed-off-by: Nicolin Chen
    (cherry picked from commit 8f265543ffda0a19e3f469967a7d61d8b344f080)

    Nicolin Chen
     
  • We found HDMI Audio has a performance issue when playback 8 channels 192KHz
    files, CPU might lag its interrupt responsing while SDMA continues updating
    HDMI internal AHB DMA's address and restarting AHB DMA, which resulted the
    noise when AHB DMA access overlaps with the data copy procedures in this
    driver.

    Thus we here double the buffer size and period size of HDMI Audio to chop
    the CPU interrupt to its half in the same span of time so that we can keep
    the data copy procedures safe and provent it from overlapping access with
    AHB DMA.

    Acked-by: Wang Shengjiu
    Signed-off-by: Nicolin Chen
    (cherry picked from commit 04af1a351e016f52276ae002fd9f64b6b2962168)

    Nicolin Chen
     

19 Feb, 2014

3 commits


16 Jan, 2014

9 commits

  • The root cause of playback slow issue should be trying to get DSPCLK_DIV
    before enabling SYSCLK of WM8962. Since we have a patch fixed it, we can
    revert this work round.
    This reverts commit 49a3ca545a88cdf4aa597c4dd7d904b4faaea555.

    Signed-off-by: Nicolin Chen
    (cherry picked from commit a4d253a8ab038661f515d72a175eb11688774874)

    Nicolin Chen
     
  • Set a default slot number in startup() so that those who use I2S or other
    2-channel DAI format would not need to call set_dai_tdm_slot() in their
    machine drivers.

    Signed-off-by: Nicolin Chen
    (cherry picked from commit eb22fac84c62cccb98dc4503bc9a537c435d216b)

    Nicolin Chen
     
  • If disabling SSI when SSI is already in the working state, the whole running
    substream would be broken. Thus we here replace it to a safer way -- saving
    the current SSIEN value and restore it afterward.

    This patch also adds a slot number checking code before setting slot number.

    Signed-off-by: Nicolin Chen
    (cherry picked from commit 2f71335a5b39afec4cf976b45683e5de1baed31d)

    Nicolin Chen
     
  • Leaving clk_set_rate() in hw_params() is a bit dangerous when handling two
    substreams. So we let set_sysclk() finish the clk_set_rate() directly.

    This patch also adds spinlock to protect the baud clock configuration so
    that it won't be broken during race.

    Signed-off-by: Nicolin Chen
    (cherry picked from commit d3818ba35e4cbb6a3fa769eb83ceb7335b7c19e6)

    Nicolin Chen
     
  • Since we introduced symmetric_channels and symmetric_samplebits, we can
    implement these new feature to SSI synchronous mode and drop the useless
    code accordingly.

    Signed-off-by: Nicolin Chen
    (cherry picked from commit 63a818ebd8fa88d8a91faa491c4f7909e7c8bdd5)

    Nicolin Chen
     
  • DSPCLK_DIV can be only generated correctly after enabling SYSCLK. But if the
    current bias_level hasn't reached SND_SOC_BIAS_ON, DAPM won't enable SYSCLK,
    which would cause the calculation result from DSPCLK_DIV invalid since bit
    DSPCLK_DIV will be finally turned to its true value after DAPM enables SYSCLK
    while the driver won't calculate it again for the current instance. In this
    circumstance, a playback which needs non-zero DSPCLK_DIV would be distorted
    due to unexpected clock frequency resulted from an invalid DSPCLK_DIV value.

    So this patch provisionally enables the SYSCLK to get a valid DSPCLK_DIV for
    calculation and then disables it afterward.

    Signed-off-by: Nicolin Chen
    Acked-by: Charles Keepax
    Signed-off-by: Mark Brown
    (cherry picked from commit 75704ecfbb4124139b78b71dd603f05d61abe689)
    (cherry picked from commit 46ff60a75d0db92848913435bc345def2a2ccc5e)

    Nicolin Chen
     
  • The snd_soc_dai_digital_mute() here will be never executed because we only
    decrease codec->active in snd_soc_close(). Thus correct it.

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit 7f62b6ee767586ee7e5d12787dbaaaf47a91979a)
    (cherry picked from commit 7ff4bd4a786d049cd4bc7306920e01f348acdaca)

    Nicolin Chen
     
  • We're now applying soc_hw_params_symmetry() to reject unmatched parameters
    while we clear parameters in soc_pcm_close(). So here's a use case might be
    broken by this mechanism: aplay -Dhw:0 44100.wav 48000.wav 32000.wav

    In this case, we call soc_pcm_open()->soc_pcm_hw_params()->soc_pcm_hw_free()
    ->soc_pcm_hw_params()->soc_pcm_hw_free()->soc_pcm_close() in order. As we
    only clear parameters in soc_pcm_close(). The parameters would be remained
    in the system even if the playback of 44100.wav is finished.

    Thus, this patch is trying to move parameters cleaning into hw_free() so that
    the system can continue to serve this kind of use case.

    Also, since we set them in hw_params(), it should be better to clear them in
    hw_free() for symmetry.

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit d3383420c969c25deffd33270ebe321e8401191a)
    (cherry picked from commit eb745901177ab907ee2ec2ab8c8ca9b4deb0e35a)

    Nicolin Chen
     
  • Some SoCs can only work in mono or stereo mode at one time. So if
    we let them capture a mono stream while playing a stereo stream,
    there might be a problem occur to one of these two streams: double
    paced or slowed down.

    In soc-pcm.c, we have soc_pcm_apply_symmetry() to apply the rate
    symmetry. But we don't have one for channels.

    Likewise, we can treat symmetric_rate as a solution for those SoCs
    or CODECs which can not handle asymmetrical LRCLK. But it's also
    impossible for them to handle asymmetrical BCLK. And accodring to
    BCLK = LRCLK * channel number * slot size(fixed or sample bits),
    sample bits might also be a problem if they are not using a fixed
    slot size.

    Thus, this patch applys symmetry for channels and sample bits.

    Meanwhile, there might be a race between two substreams if starting
    simultaneously. Previously, we only added warning to compalin but
    still using conservative way to let it carry on. However, this patch
    rejects the second stream with any unmatched parameter to make sure
    the first existing stream won't be broken.

    Signed-off-by: Nicolin Chen
    Signed-off-by: Mark Brown
    (cherry picked from commit 3635bf09a89cf92b80ac44198c5c8f0989624ea6)
    (cherry picked from commit bb3317659966b170d9481fad887df8808774c696)

    Nicolin Chen
     

29 Nov, 2013

1 commit

  • As DAPM would do the sync() for us, we don't need to handle it by ourselves.
    And leaving snd_soc_dapm_sync() here is dangerous because it would disable
    the clock from WM8962 during the short period of the output route changing
    since we don't leave the alternative route's enanbling to this machine driver
    but to DAPM core.

    Acked-by: Wang Shengjiu
    Signed-off-by: Nicolin Chen

    Nicolin Chen
     

27 Nov, 2013

1 commit


21 Nov, 2013

1 commit


19 Nov, 2013

3 commits


13 Nov, 2013

4 commits


08 Nov, 2013

1 commit

  • When allocating memory space for DMA buffer, use on-chip internal SRAM
    as default choice to save power. Since the core would allocate memory
    from traditional external memory if iram allocation failed, we don't
    need to worry about any side effect.

    Signed-off-by: Nicolin Chen
    Acked-by: Lars-Peter Clausen
    Acked-by: Mark Brown
    Signed-off-by: Takashi Iwai
    (cherry picked from commit ca2b029515b4a81bbedcffc69a5d9574bb5ba475)

    Nicolin Chen
     

05 Nov, 2013

3 commits


30 Oct, 2013

8 commits