dietpi 系统安装alsa工具

安装依赖

  1.  sudo apt-get install python-dateutil
  2.  sudo apt-get install gir1.2-gstreamer-1.0
  3.  sudo apt-get install python-pyaudio
  4.  sudo apt-get install libatlas-base-dev
  5.  sudo apt-get install python-dev 
    apt-get install python-pip    
  6.  sudo pip install tornado
  7.  sudo pip install hyper
    pip install requests
    pip install gi
  8.  
  9. 安装tornado时会报错 error: invalid command 'bdist_wheel',需要升级pip setuptools
    pip install setuptools --upgrade
    pip install pip --upgrade
  10.  
  11. 升级完pip后,pip执行报错ImportError: cannot import name main,原因是hash缓存了旧的pip,需要清下缓存
    hash -d pip
  12.  
  13. 使用pyaudio测试,
    1.pip install pyaudio ,提示  ImportError: No module named setuptools
    2. 使用pip install setuptools
    3. 重试安装,报错

unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-Ym4Ons/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-UrQ3g3/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-Ym4Ons/pyaudio/

4. 执行 apt-get install gcc-arm-linux-gnueabihf, 报错 E: Unable to locate package gcc-arm-linux-gnueabihf

后来,失败 直接执行 apt-get install python-audio安装

  1.  
  2. 下载 dueros client sdk
  1. git clone https://github.com/MyDuerOS/DuerOS-Python-Client.git
  2.  cd DuerOS-Python-Client
  3.  git checkout raspberry-dev
  4.  
  5. 修改 DuerOS-Python-Client/sdk/auth.py CLIENT_ID CLIENT_SECRET 改为自己开放平台内设备配置信息。
    dietpi内没有桌面,需要外界浏览器调用login,改webbrower.open("http://pi.local:3000"),并在内外系统内配置 pi.local hosts指向树莓派ip
  6.  
  7. 执行 enter_trigger_start.sh
    报错

Traceback (most recent call last):
File "./app/enter_trigger_main.py", line 9, in <module>
from app.framework.player import Player
File "/root/Dueros/DuerOS-Python-Client/app/framework/player.py", line 10, in <module>
from gi.repository import Gst
ImportError: No module named repository

需要安装 apt-get install python-gobject-2-dev python-gi-dev

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

解决 : pulseaudio --start

Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started

解决: 启动jackd  -d dummy

但之后程序会hang住

最终 在X环境下执行 jack_control start   pulseaudio --start

成功启动

Could not read result type = 22
Client name = PortAudio conflits with another running client
Cannot connect to the server

ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred

The underun is likely caused because pulseaudio is already accessing the card - you can pause it using http://linux.die.net/man/1/pasuspender. In general to avoid such deadlock, you need a soundserver like jackd https://help.ubuntu.com/community/What%20is%20JACK, but you already figured this out from the following log entries in your trace ;-) (apt-get install jackd)

ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave"

You need to change "pcm.front cards.pcm.front" to "pcm.front cards.pcm.default" in /usr/share/alsa/alsa.conf.

The rest of the errors are not meaningful, for instance, "bt_audio_service_open: connect() failed: Connection refused (111)" refers to your bluetooth device - you are likely missing some bluethooth packages, but you can simply ignore it.

This should get you moving forward and debug further.

  1. import pyaudio
  2. p = pyaudio.PyAudio()
  3. for i in range(p.get_device_count()):
  4. dev = p.get_device_info_by_index(i)
  5. print((i,dev['name'],dev['maxInputChannels']))

一些解决alsa的办法  https://blog.csdn.net/u013372900/article/details/72784823

https://github.com/Uberi/speech_recognition#user-content-on-ubuntudebian-i-get-errors-like-jack-server-is-not-running-or-cannot-be-started-or-cannot-lock-down--byte-memory-area-cannot-allocate-memory

  1. alsa 相关
    模块 卡索引设置 /etc/modprobe.d/alsa-base.conf
    主路径 /usr/share/alsa
    设备路径 /proc/asound
  2.  
  3. pulseaudio 配置 https://wiki.archlinux.org/index.php/PulseAudio_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)

树莓派Dietpi系统配置Dueros的更多相关文章

  1. 树莓派系统介绍:DIetPi

    项目主页:http://fuzon.co.uk/phpbb/viewtopic.php?f=8&t=6 当前版本:V34(15年4月16日发布) DietPi是国外一个基于Raspbian的精 ...

  2. 树莓派2系统DietPi简单安装配置使用介绍

    DietPi在Raspberrypi.org上的原帖:http://dwz.cn/HSrmY 版本发布很频繁,给原作者们点个赞.功能会越来越多,而且作者的定制观点很明确,适合树莓派的使用. 之前关于D ...

  3. 树莓派3 之 pi3Robot 控制系统配置

    需求 个人正在用Python写一个控制系统,技术选型是python3 + Flask + Mysql + Bootstrap.需要将这套系统直接部署到树莓派中. 代码地址:https://github ...

  4. 让你少走弯路的搭建树莓派的Net与NodeJS运行环境

      树莓派是当前最火的嵌入计算平台没有之一,树莓派可以给我们无数的想象,树莓派的高性能.低功耗.低成本.可扩展性(最新的树莓派原生支持WIFI和蓝牙,这功能太赞了)深受大家的喜爱.虽然树莓派到目前为止 ...

  5. dietpi请暂时不要升级为jessie

    关于升级到Debian最新稳定版jessie,作者是这样说的:一旦官方Raspbian升级到Jessie,DietPi也会随之切换到Jessie.由于改动较大,很多功能需要修改后才能正常使用,到时候可 ...

  6. 不从SD卡启动树莓派2

    本文你可以学到: berryboot使用,kali安装,开挂的MobaXterm,以及关于通过LABEL和UUID挂载的小技巧. 本文默认你有一定Linux基础,同时针对刚入门的水平,因为这是我的折腾 ...

  7. 树莓派配置文档 config.txt 说明(转)

    原文连接:http://elinux.org/RPi_config.txt 由于树莓派并没有传统意义上的BIOS, 所以现在各种系统配置参数通常被存在"config.txt"这个文 ...

  8. 树莓派2 安装 win10Iot 和 Ubuntu mate

    注册博客账号已经2年多了.一直没写博文现在抽空写写. 写这篇博文是因为我之前在网上找了蛮多有关教程写的都不是很清晰.安装没成功.所以我写一下我根据网上找到的整理一下分享出来. 非专业只是业余玩玩.好了 ...

  9. mschedule 简单linux进程管理(树莓派)

    树莓派是神奇的机器,CPU和内存都少的可怜,但体积小功耗低,在上面搞些动搞些西其实也挺有意思,挺好玩的.装的是pidara,基本服务没有精简多少,先cat一下CPU和RAM. [able@raspi ...

随机推荐

  1. SSM框架笔记

    配置 Project结构 SpringMVC启用 Spring MVC配置 Spring自己主动扫描 getBean的方法 SpringMVC与Struts2的差别 Log4j 拦截器与过滤器 文件U ...

  2. C#代码调用页面javascript函数

    C#代码调用javascript函数   前台<%@ Page Language="C#" AutoEventWireup="true" CodeFile ...

  3. 如何使用RDP跳过网络隔离?

    简介 本文我将向大家演示,如何通过RDP跳转盒进入隔离/受保护的网络.下图是我为该场景制作的拓扑图: 简要说明: LAN是一种扁平的工作站和服务器网络. 一些服务器(包括RDP跳转盒)无法与Inter ...

  4. mini-uboot 启动过程简单分析

    单片机有最小系统,所谓最小系统,就是单片机能正常工作所需要的最少外设.对于Uboot来说,同样有个最小系统,因为Uboot最主要的功能就是引导内核.下面我们通过一个简单的Mini-Uboot来分析Ub ...

  5. 最新的hustoj搭建姿势

    试着照某度上的教程搭了一下hustoj,出了一些问题,之前的搭建姿势很多已经不适用了,重新整理一下思路,方法二简单粗暴: 方法一: 首先虚拟机安装了Elementory OS (基于Ubuntu的衍生 ...

  6. [AngularJS + Unit Testing] Testing a component with requiring ngModel

    The component test: describe('The component test', () => { let component, $componentController, $ ...

  7. Solidworks如何绘制标准螺纹线

    1 绘制螺旋线,螺距为0.5mm,圈数为15,起始角度为0°.   2                

  8. PAT 1003 Sharing (25)

    题目描写叙述 To store English words, one method is to use linked lists and store a word letter by letter. ...

  9. 横跨十年CPU架构回顾

    http://cpu.zol.com.cn/209/2092791_all.html#p2092791 本文导航 第1页:K7架构 打开AMD崛起大门的钥匙 第2页:玩破解 K7时代便已经拥有 第3页 ...

  10. 基本SCTP套接字编程常用函数

    sctp_bindx函数:允许SCTP套接字捆绑一个特定地址子集 #include <netinet/sctp.h> // 若成功返回0,出错返回-1 int sctp_bindx(int ...