树莓派Dietpi系统配置Dueros

摘要:
Dietpi系统安装也是一个工具安装依赖于sudoapt getinstallpython dateutilsudoapt getinstallgir1.2-gstream-1.0sudoapt-getinstallython pyaudiosudoapt getinstalllibatlas base devsudoaptgetinstallbython devapt get安装

dietpi 系统安装alsa工具

安装依赖

sudoapt-getinstallpython-dateutil
sudoapt-getinstallgir1.2-gstreamer-1.0
sudoapt-getinstallpython-pyaudio
sudoapt-getinstalllibatlas-base-dev
sudoapt-getinstallpython-dev
apt-get install python-pip sudopipinstalltornado sudopipinstallhyper
pip install requests
pip install gi
安装tornado时会报错 error: invalid command 'bdist_wheel',需要升级pip 和 setuptools
pip install setuptools --upgrade
pip install pip --upgrade
升级完pip后,pip执行报错ImportError: cannot import name main,原因是hash缓存了旧的pip,需要清下缓存
hash -d pip
使用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(' ', ' ');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 installgcc-arm-linux-gnueabihf, 报错E: Unable to locate package gcc-arm-linux-gnueabihf

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


下载 dueros client sdk
gitclonehttps://github.com/MyDuerOS/DuerOS-Python-Client.git
cdDuerOS-Python-Client
gitcheckoutraspberry-dev
修改 DuerOS-Python-Client/sdk/auth.py 将 CLIENT_ID CLIENT_SECRET 改为自己开放平台内设备配置信息。
因dietpi内没有桌面,需要外界浏览器调用login,改webbrower.open("http://pi.local:3000"),并在内外系统内配置 pi.local hosts指向树莓派ip。
执行 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 usinghttp://linux.die.net/man/1/pasuspender. In general to avoid such deadlock, you need a soundserver like jackdhttps://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.

import pyaudio
p = pyaudio.PyAudio()
for i in range(p.get_device_count()):
  dev = p.get_device_info_by_index(i)
  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


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

免责声明:文章转载自《树莓派Dietpi系统配置Dueros》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇layui上传文件前加入确认提示网站日志流量分析系统之(日志埋点)下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

树莓派上传数据错误一例

首先是源码: 1 #-*- utf-8 -*- 2 #env !/usr/bin/python 3 4 importRPi.GPIO as GPIO 5 importtime 6 importjson 7 importdatetime 8 importrequests 9 10 requests.adapters.DEFAULT_RETRIES = 5...

centos 安装和配置 rabbitmq

centos 安装 rabbitmq 1、rabbitmq是erlang语言开发的,安装前首先需要安装erlang# yum install erlang -y // 直接安装可能报错,# yum install ncurses-devel // 安装依赖官方下载erlang包# wget http://erlang.org/download/otp_sr...

linux安装OpenCV以及windows安装numpy、cv2等python2.7模块

OpenCV(Open Source Computer Vision Library) 是一个基于BSD许可(开源)发行的跨平台计算机视觉库,它具有C ++,C,Python和Java接口,可以运行在Linux、Windows、Mac OS和Android操作系统上。OpenCV的设计是为了提高计算效率,并将重点放在实时应用程序上, 用优化的C / C +...

HTMLTestRunner下载生成报告

HTMLTestRunner下载地址:http://tungwaiyip.info/software/HTMLTestRunner.html,选择HTMLTestRunner.py下载 2.打开显示这个样子滴,这里需要注意右击另存为pycharm的Libsite-packages目录下(不然是没有用滴)  3.我使用的是python 3.7(看别人说...

sspanel搭建教程

教程演示环境及工具准备: vultr家的主机 【新用户注册可获取50美金】 CentOS 7X64 【每月5美元,无限流量】 ssh工具:xshell点击下载 1.安装宝塔面板 yum install -y wget && wget -O install.sh http://download.bt.cn/install/instal...

mac everything的替代品——fzf使用,速度还是很快的!!!

fzf模糊搜索神器的安装和使用 fzf是一个通用的命令行模糊查找器, 通过输入模糊的关键词就可以定位文件或文件夹。结合其他工具(比如rg)可以完成非常多的工作,在工作中可以大幅提高你的工作效率。 fzf可以用于文件、命令历史记录、进程、主机名、书签、git提交等。 1. fzf使用 1.1 安装 Using Homebrew You can use...