日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

Linux蓝牙耳机软件,Linux下蓝牙耳机的配置与测试

發布時間:2023/12/10 linux 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Linux蓝牙耳机软件,Linux下蓝牙耳机的配置与测试 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、在kernel中啟動藍牙支持

在kernel中使用.config作kernel setting

Device Driver -> Networking Support -> (M) Bluetooth Sub system Support

二、安裝軟件包

yum -y install bluez bluez-libs bluez-utils

在rpm.pbone.net下載btsco軟件包,并安裝:

sudo rpm -ivh btsco-0.5-39.i486.rpm

三、安裝

yum -y install gnome-bluetooth

四、修改藍牙配置文件

進入/etc/bluetooth,修改hcid.conf如下:

#HCId options

options {

# Automatically initialize new devices

autoinit yes;

# Security Manager mode

# none – Security manager disabled

# auto – use local PIN for incoming connections

# user – Always ask user for a PIN

security user;

# 這里使用user,連接時輸入PIN碼,一般默認為0000或者1234

# Pairing mode

# none? – Pairing disabled

# multi – Allow pairing with already paired devices

# once – Pair once and deny successive attempts

pairing multi;

# PIN helper

# pin_helper /usr/bin/bluez-pin;

pin_helper /usr/lib/

#D-Bus PIN helper

#dbus_pin_helper;

}

# Defalut settings for HCI devices

device {

# Local device name

# %d – device id

# %h – host name

name “%h-%d”;

# Local device class

class 0xff0100

# 0xff0100 指接收任何種類的藍牙設備的連接;

# 0×200404 指只接收audio/video device類型的設備連接。

# Default packet type

# pkt_type DH1, DM1, HV1;

# Inquiry and Page scan

iscan enable; pscan enable;

# Defalut link mode

# none – no specific policy

# accept – always accept incoming connections

# master – become master on incoming connections,

# ?? ??? ??? ?deny role switch on outgoing connections

lm accept;

# Default link policy

# none – no specific policy

# rswitch – allow role switch

# hold – allow hold mode

# sniff- allow sniff mode

# park – allow park mode

lp rswitch, hold, sniff, park;

# Authentication and Encryption (Security Mode 3)

auth enable;

#encrypt enable;

}

完成之后,重啟藍牙服務:

service bluetooth stop

service bluetooth start

五、掛載藍牙相關模塊并啟動藍牙

1.掛載sco模塊

cd /lib/modules/`uname -r`/kernel/net/bluetooth/

modprobe sco.ko

2.增加聲音的SDP宣告

hciconfig hci0 up #這部分不做,下邊的掃描無法運行

hciconfig hci0 voice 0×0060

3.掃描藍牙并獲取MAC地址

hcitool scan

4.藍牙配對

hcitool cc 00:21:19:A4:E0:F1

5.將藍牙耳機綁定到相應地址上

btsco bdaddress

bdaddress是藍牙的MAC地址

連接后輸入PIN碼。此時,藍牙耳機的音頻設備會被映射到/dev/dsp1,可以通過ls -l /dev/dsp1查看。

六、測試與使用藍牙耳機

1.用alsaplayer播放向藍牙耳機播放音樂

aplay -D plughw:Headset sound.wav

按藍牙耳機接聽鍵

2.arecord錄音

arecord -d 10 -f cd -t wav -D plughw:Headset record.wav plughw:Headset指明是從耳機播放,只是單聲道的聲音非常差。

總結

以上是生活随笔為你收集整理的Linux蓝牙耳机软件,Linux下蓝牙耳机的配置与测试的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。