本文转载自:http://blog.csdn.net/kris_fei/article/details/70052413

Platform: ROCKCHIP
OS: Android 6.0
Kernel: 3.10.92

这个问题蛮奇怪的,现象是:
1. 默认系统按键音是打开的,然后去录音,是正常的.
2. 当把按键音关闭之后再去录音,虽然录音有在工作,但是不能录制到声音.

理论上说播放和录音是两条不相干的通路,可以同时工作,也可以独立工作,
可事实上播放的配置影响到了录音. 

有通过系统自带的tinyplay以及tinycap工具去测试,现象也是一样,
说明是驱动层的问题.

最终发现是和codec rt5631硬件有关,root cause么有深究.

解决方法
diff --git a/sound/soc/rockchip/rk_i2s.c b/sound/soc/rockchip/rk_i2s.c
index 6b2e91d..2b1f5ee 100644
--- a/sound/soc/rockchip/rk_i2s.c
+++ b/sound/soc/rockchip/rk_i2s.c
@@ -722,7 +722,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
                                   I2S_RXCR_TFS_PCM);
        }
 
-       rockchip_snd_txctrl(i2s, 0);
+       rockchip_snd_txctrl(i2s, 1);
        rockchip_snd_rxctrl(i2s, 0);
 
        return 0;      
     
rockchip_snd_txctrl函数.

    1. static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
    2. {
    3. unsigned long flags;
    4. unsigned int val = 0;
    5. int retry = 10;
    6. spin_lock_irqsave(&lock, flags);
    7. dev_dbg(i2s->dev, "%s: %d: on: %d\n", __func__, __LINE__, on);
    8. if (on) {
    9. regmap_update_bits(i2s->regmap, I2S_DMACR,
    10. I2S_DMACR_TDE_MASK, I2S_DMACR_TDE_ENABLE);
    11. regmap_update_bits(i2s->regmap, I2S_XFER,
    12. I2S_XFER_TXS_MASK | I2S_XFER_RXS_MASK,
    13. I2S_XFER_TXS_START | I2S_XFER_RXS_START);
    14. i2s->tx_start = true;
    15. } else {
    16. i2s->tx_start = false;
    17. regmap_update_bits(i2s->regmap, I2S_DMACR,
    18. I2S_DMACR_TDE_MASK, I2S_DMACR_TDE_DISABLE);
    19. if (!i2s->rx_start) {
    20. regmap_update_bits(i2s->regmap, I2S_XFER,
    21. I2S_XFER_TXS_MASK |
    22. I2S_XFER_RXS_MASK,
    23. I2S_XFER_TXS_STOP |
    24. I2S_XFER_RXS_STOP);
    25. regmap_update_bits(i2s->regmap, I2S_CLR,
    26. I2S_CLR_TXC_MASK | I2S_CLR_RXC_MASK,
    27. I2S_CLR_TXC | I2S_CLR_RXC);
    28. regmap_read(i2s->regmap, I2S_CLR, &val);
    29. /* Should wait for clear operation to finish */
    30. while (val) {
    31. regmap_read(i2s->regmap, I2S_CLR, &val);
    32. retry--;
    33. if (!retry) {
    34. dev_warn(i2s->dev, "fail to clear\n");
    35. break;
    36. }
    37. }
    38. dev_dbg(i2s->dev, "%s: %d: stop xfer\n",
    39. __func__, __LINE__);
    40. }
    41. }
    42. spin_unlock_irqrestore(&lock, flags);
    43. }

RK3288][Android6.0] 调试笔记 --- 关闭按键音后无法录音问题【转】的更多相关文章

  1. [RK3288][Android6.0] 调试笔记 --- Goodix GT9和GT9F区别【转】

    本文转载自:http://blog.csdn.net/kris_fei/article/details/78341425 Platform: RK3288 OS: Android 6.0 Kernel ...

  2. [RK3288][Android6.0] 调试笔记 --- 软硬键盘同时使用【转】

    本文转载自:http://blog.csdn.net/kris_fei/article/details/78748313 Platform: RK3288 OS: Android 6.0 Kernel ...

  3. [RK3288][Android6.0] 调试笔记 --- 普通串口的添加 【转】

    本文转载自:http://blog.csdn.net/kris_fei/article/details/54574073   标签: rk3288 串口添加 2017-01-16 14:52 1079 ...

  4. [RK3288][Android6.0] 调试笔记 --- 替换系统签名【转】

    本文转载自:http://blog.csdn.net/kris_fei/article/details/55100299 Platform: RK3288OS: Android 6.0Kernel: ...

  5. [RK3288][Android6.0] 调试笔记 --- eMMC分区号和名字的对应【转】

    本文转载自:http://blog.csdn.net/kris_fei/article/details/77318410 Platform: Rockchip OS: Android 6.0 Kern ...

  6. [RK3288][Android6.0] 调试笔记 --- 移除uboot和kernel开机logo【转】

    本文转载自:http://blog.csdn.net/kris_fei/article/details/71600690 Platform: RockchipOS: Android 6.0Kernel ...

  7. [RK3288][Android6.0] 调试笔记 --- 通用GPIO驱动控制LED【转】

    本文转载自:http://m.blog.csdn.net/kris_fei/article/details/69553422 Platform: ROCKCHIPOS: Android 6.0Kern ...

  8. [RK3288][Android6.0] 调试笔记 --- 测试I2C设备正常传输方法【转】

    本文转载自:http://blog.csdn.net/kris_fei/article/details/71515020 Platform: RockchipOS: Android 6.0Kernel ...

  9. [RK3288][Android6.0] 调试笔记 --- 如何确认声卡是否注册成功【转】

    本文转载自:http://blog.csdn.net/kris_fei/article/details/78399875 Platform: RK3288 OS: Android 6.0 Kernel ...

随机推荐

  1. 牛客网 nowcoder TG test-172

    # solution-nowcoder-172 # A-中位数 $30\%:n\le 200$ 直接枚举 $n-len+1$ 个区间,将这段里的数重新排序直接找到中位数 $60\%:n\le 2000 ...

  2. 关于C/C++的一些思考(1)

    C++的前世今生: C的结构化思想: Ada的模版思想: Fortran的运算符重载思想: Simula的OO思想:封装,继承,多态: C++类型描述了变量的三个特征: 该类型在内存中占用物理空间的大 ...

  3. [笔记] APIO 2018 Day1

    计算折纸 computaional origami 全息算法(???) margulis napkin problem 素数里有任意长的等差数列 xor gate Σxi or gate(exact ...

  4. vsftp虚拟用户方式访问

    需求:外部人员需要对公司服务器上某个文件夹内容进行读写操作 文件目录信息:/opt/abc drwxr-xr-x 9 www  www       4096 12月  4 13:02 abc   #注 ...

  5. PHP实现QQ第三方登录的方法

    前言: PHP实现QQ快速登录,罗列了三种方法 方法一:面向过程,回调地址和首次触发登录写到了一个方法页面[因为有了if做判断], 方法二,三:面向对象 1.先调用登录方法,向腾讯发送请求,2.腾讯携 ...

  6. 集训第六周 M题

    Description   During the early stages of the Manhattan Project, the dangers of the new radioctive ma ...

  7. 【small项目】MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:

    MySQL第二天早上第一次连接超时报错,解决方法com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link ...

  8. 找宝箱 (bfs)

    Problem Description 作为一个强迫症患者,小 Y 在走游戏里的迷宫时一定要把所有的宝箱收集齐才肯罢休.现在给你一个 N *M 的迷宫,里面有障碍.空地和宝箱,小 Y 在某个起始点,每 ...

  9. Remove Duplicates from Sorted Array(参考)

    Given a sorted array, remove the duplicates in place such that each element appear only once and ret ...

  10. 携程Apollo(阿波罗)配置中心的Java样例客户端启动和调试

    参考:https://github.com/ctripcorp/apollo/wiki/Apollo%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97#23-java%E6%A0 ...