树莓派声音输出设置_树莓派适配蓝牙,将声音输出到蓝牙音响
插入蓝牙。
###连接蓝牙设备
add nao to group plugdev
> usermod -a -G plugdev nao
sudo hciconfig hci0 up 这一步会报错:
Can’t init device hci0: Operation not possible due to RF-kill (132)
然后可以通过 rfkill list 看soft block状态:
0: hci0: Bluetooth
Soft blocked: yes
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
可以看到 Bluetooth是处于 soft blocked 的状态,可是通过 rfkill unblock all 或 rfkill unblock bluetooth 都没效果。
查资料可能是由于内核模块 acer-wmi 冲突造成的,解决办法:
sudo modprobe -r acer-wmi
cd /etc/modprobe.d
sudo nano blacklist.conf
来自:http://askubuntu.com/questions/62730/cannot-change-soft-block-setting-to-no-for-ar9287-wireless-network
然后naoqi系统里面不存在 acer-wmi模块。
后来发现是 connman 造成的,解决办法:
root@osmc:~$ cat /var/lib/connman/settings
[global]
OfflineMode=false
[Wired]
Enable=true
Tethering=false
[Bluetooth]
Enable=false
Tethering=false
Setting Enabled=true under the Bluetooth tag fixed the soft block。
或直接用命令 connman enable bluetooth
来自:https://discourse.osmc.tv/t/enabling-bluetooth/711
修改后需要重启系统。
之后再 ,hciconfig hci0 up
其中 hci0 是通过 hciconfig -a 拿到的。
再通过命令扫描周围的蓝牙:
hcitool scan
扫描结果可能是:
Scanning …
CLLSPKPCARG
找到目标的 hadware_id后再运行:
simple-agent hci0 或有的命令为 bluez-simple-agent
再运行
hcitool cc && hcitool auth
查看已经认证过的蓝牙列表:
bluez-test-device list
编辑配置文件 /etc/asound.conf ,加入
pcm.bluetooth {
type bluetooth
device }
再编辑 vi /etc/bluetooth/audio.conf,加入:
Disable=Media
Enable=Socket
重启 sudo /etc/init.d/bluetooth restart
然后测试一下:
mpg321 -a bluetooth -g 15 02 Magic.mp3
aplay -D bluetooth bluetooth-music.wav
###修改系统的默认输出设备
使用 pactl list 出现以下报错:
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
或使用pacmd 以下错:
No PulseAudio daemon running, or not running as session daemon.
解决办法: pulseaudio –kill && pulseaudio –start
如果 pactl list sinks short 命令没有出现蓝牙设备的sink,那么运行:pactl load-module module-alsa-sink device=bluetooth
参考:http://askubuntu.com/questions/145733/a2dp-connection-not-shown-in-pulseaudio
当蓝牙断开连接时,需要unload-module,参考 https://gist.github.com/joergschiller/1673341
再设置 pacmd set-default-sink 1
参考如何 动态切换audio输出 sink :
http://askubuntu.com/questions/71863/how-to-change-pulseaudio-sink-with-pacmd-set-default-sink-during-playback
http://unix.stackexchange.com/questions/65246/change-pulseaudio-input-output-from-shell
设置后,naoqi系统需要重启才能生效。
参考 :http://blog.whatgeek.com.pt/2014/04/raspberry-pi-bluetooth-wireless-speaker/
NAO设置参考:https://community.aldebaran.com/en/forum/problem-about-bluetooth-earphone-configuration-nao-3875
参考NAO对接蓝牙视频:https://www.youtube.com/watch?v=57Z4vLBgynI
2 – Create a serial port over BlueTooth:
> bluez-test-serial 00:07:80:51:10:73
Connected /dev/rfcomm0 to 00:07:80:51:10:73
Press CTRL-C to disconnect
Note the serial port name: “/dev/rfcomm0”
13 – Open, read and write using that port, eg using python and pyserial.
We’ve made an example using choregraphe: the simple_serial.py
(the serial port can be changed clicking the small tools at the bottom left of the choregraphe box)
树莓派声音输出设置_树莓派适配蓝牙,将声音输出到蓝牙音响相关推荐
- 树莓派声音输出设置_树莓派3 之 音响配置
播放音乐 说明使用树莓派3来播放音乐,将音响连接到树莓派的AV输出接口即可听到音乐 介绍如何更改树莓派音频输出接口以及调节音量. 准备条件树莓派3 3.5mm耳机或者音响一个 步骤 安装MPlayer ...
- 树莓派声音输出设置_树莓派声音设置
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 config文件是这样设置的,用HDMI直连显示器,播放电影,音乐3.5口没有声音 raspi-config 设置从3.5 输出一样没有声音 有没有 解决 ...
- 树莓派声音输出设置_Raspberry Pi(树莓派)声音输出的设置
Raspberry Pi(树莓派)声音输出可以设置为自动,耳机输出,从HDMI输出三种,默认为自动 pi@aborn ~ $ sudo apt-get install alsa-utils pi@ab ...
- 树莓派蓝屏_树莓派刷写Windows 10 ARM版后成功运行桌面程序
微软在2015年时推出Windows 10 IoT物联网版供树莓派系列以及其他单板电脑安装和部署更多的应用程序. 不过树莓派系列设备本身都是使用博通的ARM处理器,所以也只能运行Windows 10商 ...
- 树莓派 python 入门_树莓派新手入门教程
树莓派(Raspberry Pi)是学习计算机知识.架设服务器的好工具,价格低廉,可玩性高. 本文根据我的亲身经验,介绍如何从零开始,搭建一个树莓派服务器,控制 LED 灯.你会看到,树莓派玩起来实在 ...
- 树莓派环境处理_树莓派开发环境配置
接上篇,准备树莓派开发环境的配置. 买回来的树莓派一般会带一个系统,在这里我建议自己定制系统,以树莓派桌面系统为蓝本搭建开发环境. 你需要准备一张 16G的高速TF卡,用以安装系统. 4B取消了全尺寸 ...
- 树莓派wifi探针_树莓派重新开始|搭建博客、网盘、流媒体与离线下载服务
树莓派重新开始|搭建博客.网盘.流媒体与离线下载服务 在折腾了一段时间的树莓派后,逐渐确定了自己对树莓派的使用有以下需求: 博客服务器 文件同步 流媒体服务器 离线下载 话不多说,重新开始. 准备工作 ...
- 树莓派 小屏幕_树莓派无屏上手指南
学习 Linux 的童鞋如果想买个玩具,树莓派肯定是不二之选.对于树莓派的介绍,良许就先不赘述了,百度一搜一大把.简而言之,树莓派就是一个小电脑,我们可以用它来学习 Linux ,也可以扩展做出很多好 ...
- 树莓派4bwlan驱动_树莓派4到手,你了解它所使用的新版Debian系统吗?
选自Raspberrypi.org 作者:Simon Long 机器之心编译 参与:韩放.路 前不久,树莓派 4 上线,它基于即将发布的 Debian 10 Buster 发行版系统.树莓派高级软件工 ...
最新文章
- 样式集(二) 信息填写样式模板
- linux 系统管理(二) 磁盘分区
- 感觉没睡好就..-shenmedoumeixie....
- (Joomla)字符串截取
- 【转】ABP源码分析三十九:ABP.Hangfire
- WPF自定义控件与样式(4)-CheckBox/RadioButton自定义样式
- StyleGAN2 解释
- xposed框架安装使用步骤
- 拉里 埃里森_拉里·沃尔(Larry Wall)的“程序员的三个美德”是胡说八道
- rhel6.5搭建mantis时报错
- 李沐动手学深度学习V2-NLP文本预处理和代码实现
- 揭密win7pe制作全过程
- 包中校中辉盛业集团荣获“中国优秀诚信品牌”奖项
- Silvaco TCAD——二维工艺仿真
- KSO-vue创建项目以及安装npm与node
- RayScan漏扫工具
- cmd命令行进入D盘的方法
- Wamp环境安装redis扩展
- SpringSecurity详细介绍RememberMe源码流程
- 《人人都是项目经理》之立项与启动(二)