导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页

    播放音频会有很响的 “啵” 的一声

    MR Series
    3
    6
    2598
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • C
      chenlinfei LV 5 最后由 编辑

      使用命令 aplay test.wav播放一个音频文件,当文件播完后会发出很响的“啵”的一声。
      跟踪发现是调用snd_pcm_close("hw:audiocodec")时发出的。

      不知有什么好的解决方案?

      1 条回复 最后回复 回复 引用 分享 0
      • tigger
        tigger LV 7 最后由 编辑

        V3s也有这个声音

        whycan 1 条回复 最后回复 回复 引用 分享 0
        • whycan
          whycan晕哥 LV 9 @tigger 最后由 编辑

          @tigger
          好象是soc内部功放开关的声音,V3s我通过一个骚操作避免的,没有正常语音播放的时候,就一直播放一个静默音,这样内部功放就不会动作,就不会啵啵啵。。。

          C 1 条回复 最后回复 回复 引用 分享 0
          • C
            chenlinfei LV 5 @whycan 最后由 编辑

            @whycan 在 播放音频会有很响的 “啵” 的一声 中说:

            正常语音播放的时候,就一直播放一个静默音,这样内部功放就不会动作,就不会啵啵啵。。。

            这个操作有点骚。

            1 条回复 最后回复 回复 引用 分享 0
            • whycan
              whycan晕哥 LV 9 最后由 编辑


              V3s 主线Linux 停止播放后,功放自动关闭也会有啵啵啵音

              C 1 条回复 最后回复 回复 引用 分享 0
              • C
                chenlinfei LV 5 @whycan 最后由 编辑

                @whycan

                在初始化的时候开启codec,后面不关,可以避免,估计功耗会高点,另外就是断电这个“啵”还是会有

                diff --git a/sound/soc/sunxi/sun20iw1-codec.c b/sound/soc/sunxi/sun20iw1-codec.c
                index 1dcccdafd..3591e5d17 100644
                --- a/sound/soc/sunxi/sun20iw1-codec.c
                +++ b/sound/soc/sunxi/sun20iw1-codec.c
                @@ -679,8 +679,8 @@ static int sunxi_codec_headphone_event(struct snd_soc_dapm_widget *w,
                (0x1 << HP_DRVEN), (0x1 << HP_DRVEN));
                break;
                case SND_SOC_DAPM_PRE_PMD:

                •           snd_soc_component_update_bits(component, SUNXI_HP2_REG,
                  
                •                           (0x1 << HP_DRVEN), (0x0 << HP_DRVEN));
                  

                +// snd_soc_component_update_bits(component, SUNXI_HP2_REG,
                +// (0x1 << HP_DRVEN), (0x0 << HP_DRVEN));
                /* A version of the chip cannot be disable HPLDO and RMC_EN */
                if (sunxi_get_soc_ver() & 0x7) {
                snd_soc_component_update_bits(component, SUNXI_POWER_REG,
                @@ -693,10 +693,10 @@ static int sunxi_codec_headphone_event(struct snd_soc_dapm_widget *w,
                snd_soc_component_update_bits(component, SUNXI_RAMP_REG,
                (0x1 << RMC_EN), (0x1 << RMC_EN));
                }

                •           snd_soc_component_update_bits(component, SUNXI_HP2_REG,
                  
                •                           (0x1 << HP_DRVOUTEN), (0x0 << HP_DRVOUTEN));
                  
                •           snd_soc_component_update_bits(component, SUNXI_HP2_REG,
                  
                •                           (0x1 << RAMP_OUT_EN), (0x0 << RAMP_OUT_EN));
                  

                +// snd_soc_component_update_bits(component, SUNXI_HP2_REG,
                +// (0x1 << HP_DRVOUTEN), (0x0 << HP_DRVOUTEN));
                +// snd_soc_component_update_bits(component, SUNXI_HP2_REG,
                +// (0x1 << RAMP_OUT_EN), (0x0 << RAMP_OUT_EN));
                #ifdef SUNXI_CODEC_DAP_ENABLE
                if (hw_cfg->dacdrc_cfg & DAP_HP_EN)
                dacdrc_enable(component, 0);
                @@ -1261,6 +1261,15 @@ static void sunxi_codec_init(struct snd_soc_component *component)
                if (sunxi_codec->hw_config.dachpf_cfg)
                dachpf_config(component);
                #endif
                +

                •   snd_soc_component_update_bits(component, SUNXI_HP2_REG,
                  
                •                   (0x1 << HP_DRVEN), (0x1 << HP_DRVEN));
                  
                •   snd_soc_component_update_bits(component, SUNXI_HP2_REG,
                  
                •                   (0x1 << HP_DRVOUTEN), (0x1 << HP_DRVOUTEN));
                  
                •   snd_soc_component_update_bits(component, SUNXI_HP2_REG,
                  
                •                   (0x1 << RAMP_OUT_EN), (0x1 << RAMP_OUT_EN));
                  

                }

                static int sunxi_codec_startup(struct snd_pcm_substream *substream,

                1 条回复 最后回复 回复 引用 分享 0
                • 1 / 1
                • First post
                  Last post

                Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

                行为准则 | 用户协议 | 隐私权政策