xiongyihui / notes

Notes
https://xiongyihui.github.io/notes/
3 stars 0 forks source link

respeaker v2上手 #7

Open xiongyihui opened 7 years ago

xiongyihui commented 7 years ago
  1. 使用 screen /dev/ttyACM0 115200minicom -D /dev/ttyACM0 -b 115200 通过串口登录系统
  2. 用Network Manager命令行工具nmtui联网 sudo nmtui
  3. (可选)为tmux设置locales,运行sudo dpkg-reconfigure locales,选择en_US.UTF-8
  4. 设置ALSA,添加配置文件/etc/asound.conf

    pcm.!default {
       type asym
       playback.pcm "dmixed"
       capture.pcm "plughw:0,0"
    }
    
    pcm.dmixed {
       type dmix
       slave.pcm "hw:0,2"
       ipc_key 1024
    }
  5. 修复一个PulseAudio配置问题,修改/etc/pulse/default.pa,禁用module-udev-detect和module-detect,静态加载alsa sink和source,修改之后用respeaker用户重启pulseaudio,运行pulseaudio -k || pulseaudio -D

    ### Load audio drivers statically                                                                                                       
    ### (it's probably better to not load these drivers manually, but instead
    ### use module-udev-detect -- see below -- for doing this automatically) 
    load-module module-alsa-sink device=hw:0,2   
    load-module module-alsa-source device=hw:0,0            
    #load-module module-oss device="/dev/dsp" sink_name=output source_name=input  
    #load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input 
    #load-module module-null-sink           
    #load-module module-pipe-sink           
    
    ### Automatically load driver modules depending on the hardware available      
    #.ifexists module-udev-detect.so        
    #load-module module-udev-detect   
    #.else                  
    ### Use the static hardware detection module (for systems that lack udev support)    
    #load-module module-detect    
    #.endif
  6. (可选,仅在SEEED局域网可用)使用apt缓存
    echo "Acquire::http { Proxy \"http://192.168.4.48:3142\"; };" | sudo tee  /etc/apt/apt.conf.d/02proxy
  7. 通过sudo ip addrsudo ifconfig获取设备IP地址,用VNC登录系统,VNC地址是IP加端口号5901,比如192.168.9.9:5901,VNC客户端推荐使用 VNC Viewer for Google Chrome
  8. (可选)使用virtualenv建立一个虚拟的python环境
    sudo apt update && sudo apt install python-virtualenv
    python -m virtualenv --with-site-packages ~/env
    source ~/env/bin/activate
  9. 安装 avs 库 pip install avs
  10. 获取alexa或dueros的授权,在VNC中(因为需要在网页登录Amazon或百度),打开terminal,运行alexa-auth 或 dueros-auth,在弹出的浏览器网页登录
  11. 运行 alexa,然后可以按Enter键开始语音交互
  12. 用Pulseaudio录8通道音频有问题,先关掉Pulseaudio

    su repseaker
    echo “autospawn = no" > ~/.config/pulse/client.conf
    pulseaudio -k