一区二区三区三上|欧美在线视频五区|国产午夜无码在线观看视频|亚洲国产裸体网站|无码成年人影视|亚洲AV亚洲AV|成人开心激情五月|欧美性爱内射视频|超碰人人干人人上|一区二区无码三区亚洲人区久久精品

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內(nèi)不再提示

飛凌OK113i-C全志T113-i開發(fā)板rtl8723du WIFI功能測試及藍牙驅(qū)動移植

冬至子 ? 來源:丨budboool ? 作者:丨budboool ? 2023-12-11 13:52 ? 次閱讀

飛凌 OK113i-C 全志T113-i開發(fā)板板載一個RTL8723du wifi/藍牙二合一模塊,板子出廠已經(jīng)移植好了WIFI驅(qū)動但是藍牙驅(qū)動沒有,所以這篇文章我們主要做藍牙驅(qū)動的移植和功能驗證。

./build.sh menuconfig

Device Drivers > Network device support > Wireless LAN下找到Realtek 8723D USB WiFi選項。

默認是開啟的。

默認WIFI驅(qū)動聯(lián)網(wǎng)嘗試

wpa_supplicant -Dnl80211 -iwlan0 -c /etc/wpa_supplicant.conf -B
udhcpc -i wlan0
udhcpc: started, v1.29.3                                                                                           
udhcpc: sending discover                                                                                           
udhcpc: sending select for 192.168.0.111                                                                           
udhcpc: lease of 192.168.0.111 obtained, lease time 7200                                                           
deleting routers                                                                                                   
adding dns 192.168.1.1                                                                                             
adding dns 192.168.0.1

wpa_supplicant.conf 文件

network={
        ssid="TP-LINK_142C"
        psk="123445678"
}
update_config=1
ctrl_interface=DIR=/var/run/wpa_supplicant

打印網(wǎng)卡信息:

ifconfig                                                                                         
eth0      Link encap:Ethernet  HWaddr BA:E9:F2:1C:9D:87                                                            
          inet addr:192.168.0.232  Bcast:0.0.0.0  Mask:255.255.255.0                                               
          UP BROADCAST MULTICAST  MTU:1500  Metric:1                                                               
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0                                                       
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0                                                     
          collisions:0 txqueuelen:1000                                                                             
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)                                                                   
          Interrupt:39                                                                                             
                                                                                                                   
lo        Link encap:Local Loopback                                                                                
          inet addr:127.0.0.1  Mask:255.0.0.0                                                                      
          inet6 addr: ::1/128 Scope:Host                                                                           
          UP LOOPBACK RUNNING  MTU:65536  Metric:1                                                                 
          RX packets:41 errors:0 dropped:0 overruns:0 frame:0                                                      
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0                                                    
          collisions:0 txqueuelen:1000                                                                             
          RX bytes:3936 (3.8 KiB)  TX bytes:3936 (3.8 KiB)                                                         
                                                                                                                   
wlan0     Link encap:Ethernet  HWaddr 2C:C3:E6:67:4D:3B                                                            
          inet addr:192.168.0.111  Bcast:192.168.0.255  Mask:255.255.255.0                                         
          inet6 addr: fe80::2ec3:e6ff:fe67:4d3b/64 Scope:Link                                                      
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                                                       
          RX packets:86 errors:0 dropped:0 overruns:0 frame:0                                                      
          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0                                                    
          collisions:0 txqueuelen:1000                                                                             
          RX bytes:17189 (16.7 KiB)  TX bytes:3763 (3.6 KiB)

至此,wifi連接路由器成功,可以ping 百度驗證是否聯(lián)網(wǎng)成功。

藍牙功能

首先打印設備上的藍牙設備

hciconfig -a

輸出為空,應該是沒有藍牙驅(qū)動??磥沓鰪S并沒有帶藍牙驅(qū)動,下一步自行移植藍牙驅(qū)動,板上的無線芯片模組使用的是rtl8723du是一款bt4.2和 wifi 2.4G芯片。

藍牙驅(qū)動移植

  1. 修改kernel config
    修改OK113i-linux-sdk/kernel/linux-5.4/arch/arm/configs/OK113I_linux_defconfig文件添加如下一行
CONFIG_BT_HCIBTUSB_RTLBTUSB=m
  1. 修改Kconfig
    添加如下:
config BT_HCIBTUSB_RTLBTUSB
        tristate "Realtek HCI USB driver support"
        depends on USB
        help
          Realtek Bluetooth HCI USB driver.
          This driver is required if you want to use Realtek Bluetooth
          device with USB interface.
          Say Y here to compile support for Bluetooth USB devices into the
          kernel or say M to compile it as module (rtk_btusb).
  1. 修改Makefile
    在文檔最后添加:
obj-$(CONFIG_BT_HCIBTUSB_RTLBTUSB)    := rtk_btusb.o
rtk_btusb-objs                        := rtk_bt.o rtk_misc.o rtk_coex.o
  1. 將驅(qū)動文件中如下文件復制到內(nèi)核目錄OK113i-linux-sdk/kernel/linux-5.4/drivers/bluetooth下:
    rtk_bt.c
    rtk_bt.h
    rtk_coex.c
    rtk_coex.h
    rtk_misc.c
    rtk_misc.h
  2. 編譯內(nèi)核驅(qū)動
    ./build.sh kernel

編譯完成后會在OK113i-linux-sdk/out/t113_i/ok113i/longan/dist目錄下生成rtk_btusb.ko驅(qū)動文件,將該驅(qū)動文件和驅(qū)動文件對應的固件文件(rtl8723du_fw.bin和rtl8723du_config.bin)放在板子/lib/firmware/

為了方便查看驅(qū)動加載過程報錯信息,打開內(nèi)核打印信息:

echo 8 4 1 7 > /proc/sys/kernel/printk

將編譯好的驅(qū)動文件和固件文件上傳到板卡上,并將估計文件存放在板卡/lib/firmware目錄下。

scp out/t113_i/ok113i/longan/dist/rtk_btusb.ko root@192.168.0.105:/home/forlinx/
scp /home/luoyang/Documents/Dev/Bluetooth/V4-8761藍牙_Linux驅(qū)動/20210819_LINUX_BT_DRIVER/rtkbt-firmware/lib/firmware/rtl8723du* root@192.168.0.105:/home/forlinx/
cp rtl8723du_config /lib/firmware/rtl8723du_config.bin
cp rtl8723du_fw /lib/firmware/rtl8723du_fw.bin

加載驅(qū)動試試,報錯:

insmod rtk_btusb.ko 
[ 4832.222554] rtk_btusb: module uses symbol (kernel_read) from namespace VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver, but does not import it.
[ 4832.238042] rtk_btusb: Unknown symbol kernel_read (err -22)
[ 4832.298908] rtk_btusb: module uses symbol (kernel_read) from namespace VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver, but does not import it.
[ 4832.314387] rtk_btusb: Unknown symbol kernel_read (err -22)
insmod: can't insert 'rtk_btusb.ko': Invalid argument

在rtk_bt.c文件最后一行添加:

MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);

重新編譯驅(qū)動,然后上傳并加載試試。

root@ok113i:/home/forlinx# insmod rtk_btusb.ko 
[ 7964.303169] rtk_btusb: Realtek Bluetooth USB driver ver 3.1.32e1d0b.20210819-170430
[ 7964.311850] rtk_btcoex: rtk_btcoex_init: version: 1.2
[ 7964.317513] rtk_btcoex: create workqueue
[ 7964.322343] rtk_btcoex: alloc buffers 1408, 2240 for ev and l2
[ 7964.329075] rtk_btusb: btusb_probe intf- >cur_altsetting- >desc.bInterfaceNumber 0
[ 7964.337365] rtk_btusb: btusb_probe can_wakeup 1, may wakeup 0
[ 7964.343827] rtk_btusb: patch_add
[ 7964.347451] rtk_btusb: auto suspend is disabled
[ 7964.352568] rtk_btusb: pid = 0xd723
[ 7964.356478] rtk_btusb: patch_add: Reset gEVersion to 0xff
[ 7964.362590] rtk_btusb: set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev- >quirks);
[ 7964.370965] rtk_btusb: btusb_probe: done
[ 7964.375679] usbcore: registered new interface driver rtk_btusb
[ 7964.377514] rtk_btusb: btusb_open start
[ 7964.386578] rtk_btusb: btusb_open hdev- >promisc ==0
[ 7964.392129] rtk_btusb: download_patch start
root@ok113i:/home/forlinx# [ 7964.396839] rtk_btusb: chip type value: 0x71
[ 7964.403997] rtk_btusb: HCI reset.
[ 7964.416814] rtk_btusb: read_ver_rsp- >lmp_subver = 0x8723
[ 7964.423054] rtk_btusb: read_ver_rsp- >hci_rev = 0xd
[ 7964.428449] rtk_btusb: patch_entry- >lmp_sub = 0x8723
[ 7964.434017] rtk_btusb: load_firmware start
[ 7964.438638] rtk_btusb: lmp_version = 0x8723
[ 7964.443325] rtk_btusb: config filename rtl8723du_config
[ 7964.449952] rtk_btusb: no bdaddr file /opt/bdaddr
[ 7964.455252] rtk_btusb: Origin cfg len 22
[ 7964.459688] rtk_btusb: 55 ab 23 87 10 00 d9 00 01 0f e4 00 01 08 8d 00
[ 7964.467005] rtk_btusb: 01 fa 8f 00 01 bf
[ 7964.471497] rtk_btusb: New cfg len 22
[ 7964.475600] rtk_btusb: 55 ab 23 87 10 00 d9 00 01 0f e4 00 01 08 8d 00
[ 7964.482969] rtk_btusb: 01 fa 8f 00 01 bf
[ 7964.487399] rtk_btusb: fw name is  rtl8723du_fw
[ 7964.492801] rtk_btusb: This is not 8723a, use new patch style!
[ 7964.499374] rtk_btusb: rtk_get_eversion: gEVersion 255
[ 7964.505815] rtk_btusb: eversion- >status = 0x0, eversion- >version = 0x2
[ 7964.513566] rtk_btusb: load_firmware: New gEVersion 2
[ 7964.519331] rtk_btusb: rtk_get_fw_project_id: opcode 0, len 1, data 9
[ 7964.526565] rtk_btusb: lmp_version is 8723, project_id is 8723, match!
[ 7964.533909] rtk_btusb: fw_version = 0x82a8a133
[ 7964.538921] rtk_btusb: number_of_total_patch = 3
[ 7964.544092] rtk_btusb: chipID 3
[ 7964.547606] rtk_btusb: patch_length 0x889c
[ 7964.552220] rtk_btusb: start_offset 0x00004940
[ 7964.557198] rtk_btusb: Svn version: -1433992835
[ 7964.562301] rtk_btusb: Coexistence: BTCOEX_20210106-3b3b
[ 7964.568274] rtk_btusb: buf_len = 0x88b2
[ 7964.572647] rtk_btusb: fw: exists, config file: exists
[ 7964.578430] rtk_btusb: load_firmware done
[ 7964.582960] rtk_btusb: download_data start
[ 7964.855824] rtk_btusb: download_data done
[ 7964.860346] rtk_btusb: HCI reset.
[ 7964.873812] rtk_btusb: read_ver_rsp- >lmp_subver = 0xa133
[ 7964.880054] rtk_btusb: read_ver_rsp- >hci_rev = 0x82a8
[ 7964.885730] rtk_btusb: patch_entry- >lmp_sub = 0x8723
[ 7964.891337] rtk_btusb: Rtk patch end 0
[ 7964.895538] rtk_btusb: btusb_open set HCI_RUNNING
[ 7964.900945] rtk_btcoex: Open BTCOEX
[ 7964.904856] rtk_btusb: btusb_open end
[ 7964.911832] rtk_btcoex: BTCOEX hci_rev 0x82a8
[ 7964.916883] rtk_btcoex: BTCOEX lmp_subver 0xa133
[ 7964.943829] rtk_btusb: btusb_notify: hci0 evt 3
[ 7967.007992] rtk_btusb: btusb_flush add delay 
[ 7967.022915] rtk_btusb: btusb_close
[ 7967.045574] rtk_btcoex: Close BTCOEX
[ 7967.049615] rtk_btcoex: -x

以上信息說明藍牙驅(qū)動加載成功。
此時,再一次查看系統(tǒng)的藍牙設備信息會打印如下:

root@ok113i:/home/forlinx# hciconfig -a
hci0:   Type: Primary  Bus: USB
        BD Address: 2C:C3:E6:67:4D:3C  ACL MTU: 1021:8  SCO MTU: 255:12
        DOWN 
        RX bytes:584 acl:0 sco:0 events:30 errors:0
        TX bytes:369 acl:0 sco:0 commands:30 errors:0
        Features: 0xff 0xff 0xff 0xfa 0xdb 0xbd 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH HOLD SNIFF PARK 
        Link mode: SLAVE ACCEPT

藍牙工具軟件使用

藍牙驅(qū)動安裝成功后就可以對藍牙設備進行配對連接并進行播放音頻操作了,此處我們選擇通過藍牙連接家里的智能音箱天貓精靈作為藍牙音頻輸出設備,涉及的藍牙工具軟件開發(fā)板上出廠移植好了,所以此處省去了移植這些工具軟件的步驟。

  1. 啟動系統(tǒng)藍牙服務bluetoothd,使其在后臺運行
    bluetoothd -d -n &
    root@ok113i:/# bluetoothd[1516]: Bluetooth daemon 5.50
    bluetoothd[1516]: src/adapter.c:adapter_init() sending read version command
    bluetoothd[1516]: Starting SDP server
    bluetoothd[1516]: src/sdpd-service.c:register_device_id() Adding device id record for 0002:1d6b:0246:0532
    bluetoothd[1516]: src/plugin.c:plugin_init() Loading builtin plugins
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading hostname plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading wiimote plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading autopair plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading policy plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading neard plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading sap plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading a2dp plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading avrcp plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading network plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading input plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading hog plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading health plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading gap plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading scanparam plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading deviceinfo plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading midi plugin
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading battery plugin
    bluetoothd[1516]: src/plugin.c:plugin_init() Loading plugins /usr/lib/bluetooth/plugins
    bluetoothd[1516]: src/plugin.c:add_plugin() Loading sixaxis plugin
    bluetoothd[1516]: profiles/health/hdp.c:hdp_manager_start() Starting Health manager
    bluetoothd[1516]: profiles/input/suspend-none.c:suspend_init()
    bluetoothd[1516]: profiles/network/manager.c:read_config() Config options: Security=true
    bluetoothd[1516]: kernel lacks bnep-protocol support
    bluetoothd[1516]: System does not support network plugin
    bluetoothd[1516]: plugins/neard.c:neard_init() Setup neard plugin
    bluetoothd[1516]: plugins/sixaxis.c:sixaxis_init()
    bluetoothd[1516]: src/main.c:main() Entering main loop
    bluetoothd[1516]: src/rfkill.c:rfkill_event() RFKILL event idx 0 type 1 op 0 soft 0 hard 0
    bluetoothd[1516]: Bluetooth management interface 1.14 initialized
    bluetoothd[1516]: src/adapter.c:read_version_complete() sending read supported commands command
    bluetoothd[1516]: src/adapter.c:read_version_complete() sending read index list command
    bluetoothd[1516]: src/adapter.c:read_commands_complete() Number of commands: 65
    bluetoothd[1516]: src/adapter.c:read_commands_complete() Number of events: 35
    bluetoothd[1516]: src/adapter.c:read_commands_complete() enabling kernel-side connection control
    bluetoothd[1516]: src/adapter.c:read_index_list_complete() Number of controllers: 0
    root@ok113i:/#

  2. 通過bluetoothctl對藍牙設備操作,主要包括:藍牙設備信息打印查看,藍牙設備開啟和關閉、藍牙外設掃描、查看掃描到的藍牙外設設備、配對連接等,下面實例命令行中##開頭的行是注釋

    進入bluetoothctl

    root@ok113i:/# bluetoothctl
    bluetoothd[1516]: src/agent.c:agent_ref() 0x8c9338: ref=1
    bluetoothd[1516]: src/agent.c:register_agent() agent :1.1
    Agent registered

    藍牙設備信息打印查看

    [bluetooth]#show
    Controller 2C:C3:E6:67:4D:3C (public)

    Name: BlueZ 5.50
        Alias: BlueZ 5.50
        Class: 0x00000000
        Powered: no
        Discoverable: no
        Pairable: yes
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        Modalias: usb:v1D6Bp0246d0532
        Discovering: no
    

    藍牙設備開啟和關閉

    [bluetooth]#power on
    [bluetooth]# [ 417.686414] rtk_btusb: btusb_open start
    bluetoothd[1516]: src/adapter.c:[ 417.691880] rtk_btusb: btusb_open hdev->promisc ==0
    property_set_mode() sending Set [ 417.700202] rtk_btusb: download_patch start
    Powered command for index 0
    [ 417.707637] rtk_btusb: chip type value: 0x71
    [ 417.714939] rtk_btusb: HCI reset.
    [ 417.727699] rtk_btusb: read_ver_rsp->lmp_subver = 0xa133
    [ 417.733654] rtk_btusb: read_ver_rsp->hci_rev = 0x82a8
    [ 417.739344] rtk_btusb: patch_entry->lmp_sub = 0x8723
    [ 417.744905] rtk_btusb: Firmware already exists
    [ 417.749914] rtk_btusb: Rtk patch end 1
    [ 417.754125] rtk_btusb: btusb_open set HCI_RUNNING
    [ 417.759504] rtk_btcoex: Open BTCOEX
    [ 417.763412] rtk_btusb: btusb_open end
    [ 417.769720] rtk_btcoex: BTCOEX hci_rev 0x82a8
    [ 417.774656] rtk_btcoex: BTCOEX lmp_subver 0xa133
    bluetoothd[1516]: src/adapter.c:property_set_mode_complete() Success (0x00)
    bluetoothd[1516]: src/adapter.c:new_settings_callback() Settings: 0x00000ad1
    bluetoothd[1516]: src/adapter.c:settings_changed() Changed settings: 0x00000001
    bluetoothd[1516]: src/adapter.c:adapter_start() adapter /org/bluez/hci0 has been enabled
    bluetoothd[1516]: src/adapter.c:trigger_passive_scanning()
    Changing power on succeeded
    [CHG] Controller 2C:C3:E6:67:4D:3C Powered: yes

    藍牙設備開啟和關閉

    [bluetooth]#scan on
    [bluetooth]#scan off

    查看掃描到的藍牙外設設備

    [bluetooth]#devices
    Device F1:22:33:1A:48:9B F1-22-33-1A-48-9B
    Device C4:DE:E2:DF:E8:22 Keep_CC_50200973
    Device 34:29:EF:5B:D2:D3 34-29-EF-5B-D2-D3
    Device E8:F5:63:87:03:9D Mi Band 3
    Device B8:8C:29:87:72:C9 midea
    Device 04:7F:0E:40:4A:BD BEIJING-EU5
    Device CC:B5:D1:FB:45:3A SMI-M14
    Device 45:B8:CC:87:53:F8 45-B8-CC-87-53-F8
    Device 84:7C:9B:6D:FF:11 midea_db_2943
    Device 10:9E:3A:92:2E:DA ?方?糖(80:7A)

    配對連接

    [bluetooth]#connect 10:9E:3A:92:2E:DA
    Attempting to connect to 10:9E:3A:92:2E:DA
    bluetoothd[1516]: src/device.c:connect_profiles() /org/bluez/hci0/dev_10_9E_3A_92_2E_DA (all), client :1.2
    bluetoothd[1516]: profiles/audio/a2dp.c:a2dp_sink_connect() path /org/bluez/hci0/dev_10_9E_3A_92_2E_DA
    bluetoothd[1516]: a2dp-sink profile connect failed for 10:9E:3A:92:2E:DA: Protocol not available
    Failed to connect: org.bluez.Error.Failed

報錯了,因為沒有提前運行bluealsa這個程序,運行如下:

bluealsa -p a2dp-source &
[2] 1537
root@ok113i:/home/forlinx# bluetoothd[1516]: profiles/audio/avdtp.c:avdtp_register_sep() SEP 0x8cc378 registered: type:0 codec:2 seid:1
bluetoothd[1516]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[1516]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10003
bluetoothd[1516]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000019-0000-1000-8000-00805f9
bluetoothd[1516]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[1516]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[1516]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110a-0000-1000-8000-00805f9
bluetoothd[1516]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110d-0000-1000-8000-00805f9
bluetoothd[1516]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[1516]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[1516]: Endpoint registered: sender=:1.3 path=/A2DP/MPEG24/Source/1
bluetoothd[1516]: src/adapter.c:dev_class_changed_callback() Class: 0x080000
bluetoothd[1516]: profiles/audio/avdtp.c:avdtp_register_sep() SEP 0x8c63f0 registered: type:0 codec:0 seid:2
bluetoothd[1516]: Endpoint registered: sender=:1.3 path=/A2DP/SBC/Source/1

至此,再進入bluetoothctl 連接天貓精靈試試,首先輸入devices命令打印出掃描到的設備信息,然后使用connect xx:xx:xx:xx:xx:xx連接上想要連接的藍牙設備,連接成功后提示符會變成[連接的設備]樣式,具體如下:

[bluetooth]#devices
Device F1:22:33:1A:48:9B F1-22-33-1A-48-9B
Device C4:DE:E2:DF:E8:22 Keep_CC_50200973
Device 34:29:EF:5B:D2:D3 34-29-EF-5B-D2-D3
Device E8:F5:63:87:03:9D Mi Band 3
Device B8:8C:29:87:72:C9 midea
Device 04:7F:0E:40:4A:BD BEIJING-EU5
Device CC:B5:D1:FB:45:3A SMI-M14
Device 45:B8:CC:87:53:F8 45-B8-CC-87-53-F8
Device 84:7C:9B:6D:FF:11 midea_db_2943
Device 10:9E:3A:92:2E:DA ?方?糖(80:7A)
[bluetooth]#connect 10:9E:3A:92:2E:DA
...
[?方?糖(80:7A)]# list
Controller 2C:C3:E6:67:4D:3C BlueZ 5.50 [default]
## 退出bluetoothctl程序
[?方?糖(80:7A)]# exit
  1. 藍牙音頻播放
    因為此處我們使用alsa-utils工具集中的 aplay 進行音頻播放測試,所以僅僅支持PCMWAV等音頻格式,要是想直接播放 mp3 或者 mp4 等格式音頻文件需要借助MPD或者FFmpeg等軟件。
    上一步我們在bluetoothctl中打印掃描并連接了藍牙音箱,藍牙音箱的設備地址如下:
[bluetooth]#devices
Device F1:22:33:1A:48:9B F1-22-33-1A-48-9B
Device C4:DE:E2:DF:E8:22 Keep_CC_50200973
Device 34:29:EF:5B:D2:D3 34-29-EF-5B-D2-D3
Device E8:F5:63:87:03:9D Mi Band 3
Device B8:8C:29:87:72:C9 midea
Device 04:7F:0E:40:4A:BD BEIJING-EU5
Device CC:B5:D1:FB:45:3A SMI-M14
Device 45:B8:CC:87:53:F8 45-B8-CC-87-53-F8
Device 84:7C:9B:6D:FF:11 midea_db_2943
Device 10:9E:3A:92:2E:DA ?方?糖(80:7A)

根據(jù)上面信息我們可以看到天貓精靈方糖的藍牙設備地址是10:9E:3A:92:2E:DA ,所以我們可以使用如下命令進行音頻播放測試:

root@ok113i:/# aplay -D bluealsa:DEV=10:9E:3A:92:2E:DA ./wishforyou.wav

Playing WAVE './wishforyou.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
bluetoothd[1516]: profiles/audio/transport.c:media_owner_create() Owner created: sender=:1.3
bluetoothd[1516]: profiles/audio/avdtp.c:avdtp_ref() 0x8cf3c0: ref=2
bluetoothd[1516]: profiles/audio/a2dp.c:a2dp_sep_lock() SEP 0x8c63f0 locked
bluetoothd[1516]: profiles/audio/avdtp.c:avdtp_ref() 0x8cf3c0: ref=3
bluetoothd[1516]: profiles/audio/a2dp.c:setup_ref() 0x8ccad0: ref=1
bluetoothd[1516]: profiles/audio/transport.c:transport_set_state() State changed /org/bluez/hci0/dev_10_9E_3A_92_2E_DA/fd0: TRANSPORT_STATE_IDLE - > TRANSPORT_STATE_REQUESTING
bluetoothd[1516]: profiles/audio/transport.c:media_request_create() Request created: method=Acquire id=4
bluetoothd[1516]: profiles/audio/transport.c:media_owner_add() Owner :1.3 Request Acquire
bluetoothd[1516]: profiles/audio/transport.c:media_transport_set_owner() Transport /org/bluez/hci0/dev_10_9E_3A[ 1901.267056] rtk_btcoex: update_profile_state: btrtl_coex.prof4
_92_2E_DA/fd0 Owner :1.3
blueto[ 1901.276315] rtk_btcoex: update_profile_state: btrtl_coex.profile_status = 4
othd[1516]: profiles/audio/avdtp[ 1901.287222] rtk_btcoex: rtk_notify_profileinfo_to_fw: BufferSize 5
.c:session_cb() 
bluetoothd[151[ 1901.296656] rtk_btcoex: rtk_notify_profileinfo_to_fw: NumberOfHandles 1
6]: profiles/audio/avdtp.c:avdtp[ 1901.307101] rtk_btcoex: rtk_notify_profileinfo_to_fw: handle 0x0003
_parse_resp() START request succ[ 1901.316801] rtk_btcoex: rtk_notify_profileinfo_to_fw: profile_bitmap 0x04
eeded
bluetoothd[1516]: profile[ 1901.327316] rtk_btcoex: rtk_notify_profileinfo_to_fw: profile_status 0x04
s/audio/a2dp.c:start_cfm() Sourc[ 1901.337472] rtk_btcoex: rtk_vendor_cmd_to_fw: opcode 0xfc19
e 0x8c63f0: Start_Cfm
bluetooth[ 1901.346663] rtk_btcoex: Length 629
d[1516]: /org/bluez/hci0/dev_10_[ 1901.353083] rtk_btcoex: rtp: v 2, cc 0, pt 96
9E_3A_92_2E_DA/fd0: fd(20) ready[ 1901.360767] rtk_btcoex: syncword: 9c

bluetoothd[1516]: profiles/aud[ 1901.367663] rtk_btcoex: freq 48kHz
io/transport.c:media_owner_remov[ 1901.374144] rtk_btcoex: blocks 16
e() Owner :1.3 Request Acquire
[ 1901.380646] rtk_btcoex: channel mode JOINT_STEREO
bluetoothd[1516]: profiles/audio[ 1901.388829] rtk_btcoex: allocation method LOUDNESS
/transport.c:transport_set_state[ 1901.396877] rtk_btcoex: subbands 8
() State changed /org/bluez/hci0[ 1901.403488] rtk_btcoex: bitpool 32
/dev_10_9E_3A_92_2E_DA/fd0: TRAN[ 1901.410192] rtk_btcoex: rtk_vendor_cmd_to_fw: opcode 0xfc51
SPORT_STATE_REQUESTING - > TRANSPORT_STATE_ACTIVE
bluetoothd[1516]: profiles/audio/a2dp.c:setup_unref() 0x8ccad0: ref=0
bluetoothd[1516]: profiles/audio/a2dp.c:setup_free() 0x8ccad0
bluetoothd[1516]: profiles/audio/avdtp.c:avdtp_unref() 0x8cf3c0: ref=2
bluetoothd[1516]: profiles/audio/avdtp.c:avdtp_sep_set_state() stream state changed: OPEN - > STREAMING
bluetoothd[1516]: profiles/audio/sink.c:sink_set_state() State changed /org/bluez/hci0/dev_10_9E_3A_92_2E_DA: SINK_STATE_CONNECTED - > SINK_STATE_PLAYING
bluetoothd[1516]: profiles/audio/transport.c:transport_update_playing() /org/bluez/hci0/dev_10_9E_3A_92_2E_DA/fd0 State=TRANSPORT_STATE_ACTIVE Playing=1
[ 1902.124926] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 20
[ 1903.164933] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 22
[ 1904.204932] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 21
[ 1905.244932] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 14
[ 1906.284931] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 26
[ 1907.324939] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 18
[ 1908.364936] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 18
[ 1909.404933] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 20
[ 1910.444937] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 13
[ 1911.484925] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 16
[ 1912.524927] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 14
[ 1913.564933] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 13
[ 1914.604934] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 10
[ 1915.644932] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 7
[ 1916.684940] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 8
[ 1917.724923] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 9
[ 1918.764925] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 15
[ 1919.804933] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 21
[ 1920.844937] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 21
[ 1921.884941] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 27
[ 1922.924932] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 20
[ 1923.964933] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 16
[ 1925.004927] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 19
[ 1926.044934] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 31
[ 1927.084937] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 22
[ 1928.124936] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 31
[ 1929.164931] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 32
[ 1930.204929] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 18
[ 1931.244931] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 36
[ 1932.284931] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 24
[ 1933.324936] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 21
[ 1934.364932] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 20
[ 1935.404930] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 11
[ 1936.444934] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 15
[ 1937.484928] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 17
[ 1938.524946] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 20
[ 1939.564928] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 13
[ 1940.604935] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 19
[ 1941.644929] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 16
[ 1942.684932] rtk_btcoex: count_a2dp_packet_timeout: a2dp_packet_count 28

不出意外的話可以聽到播放的歌曲聲音了。

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權轉(zhuǎn)載。文章觀點僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學習之用,如有內(nèi)容侵權或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報投訴
  • 路由器
    +關注

    關注

    22

    文章

    3790

    瀏覽量

    115601
  • LAN
    LAN
    +關注

    關注

    0

    文章

    232

    瀏覽量

    37978
  • WPA
    WPA
    +關注

    關注

    0

    文章

    15

    瀏覽量

    12481
  • wifi驅(qū)動
    +關注

    關注

    1

    文章

    2

    瀏覽量

    1119
  • RTL8723DU
    +關注

    關注

    0

    文章

    2

    瀏覽量

    616
收藏 人收藏

    評論

    相關推薦

    技術帖 | 嵌入式T113-i開發(fā)板的休眠及喚醒操作

    嵌入式OK113i-S開發(fā)板支持兩種休眠方式:freeze和mem。本篇內(nèi)容小編會為大家介紹如何讓
    的頭像 發(fā)表于 12-29 08:02 ?1517次閱讀
    技術帖 | <b class='flag-5'>飛</b><b class='flag-5'>凌</b>嵌入式<b class='flag-5'>T113-i</b><b class='flag-5'>開發(fā)板</b>的休眠及喚醒操作

    OK113i-S開發(fā)板試用】開機測評--硬件篇

    OK113i-S開發(fā)板試用】開機測評--硬件篇 一,開箱見圖 包裝精致 注意:上面紅黃的先是本人接上的 配了電源線和一根usb線一根天線 OK
    發(fā)表于 12-24 20:51

    OK113i-C T113-i開發(fā)板】視頻編解碼測試

    前言本文測試OK113i-S開發(fā)板-視頻編解碼的功能OK113i-S開發(fā)板是支持視頻的編解碼的,
    發(fā)表于 12-25 09:41

    OK113i-C T113-i開發(fā)板測試實時系統(tǒng)

    前言 OK113i-S開發(fā)板測試實時linux系統(tǒng)的效果Linux下的實時系統(tǒng)有三種方案:這三種方案各有優(yōu)缺點1.PREEMPT-RT:PREEMPT-RT是一個基于Linux內(nèi)核的實時補丁,也
    發(fā)表于 12-25 09:50

    OK113i-C T113-i開發(fā)板WiFi和以太網(wǎng)絡的使用

    WiFi和以太網(wǎng)絡的使用這塊t113-t開發(fā)板,板載了一塊WiFi+
    發(fā)表于 12-27 09:57

    【米爾-T113-i開發(fā)板試用】米爾-T113-i開發(fā)環(huán)境搭建

    version 5.3.1 20160412 (Linaro GCC 5.3-2016.05) 從上面的log,看出gcc安裝OK。 三、開發(fā)板設置 米爾-
    發(fā)表于 03-01 21:43

    【米爾-T113-i開發(fā)板試用】米爾-T113-i開發(fā)板與modbus設備的連接和操作

    的協(xié)議在此不再接受,網(wǎng)絡上到處都是。 三、功能執(zhí)行 首先根據(jù)線序連接好溫度傳感器和米爾-T113-i開發(fā)板。 編譯好源碼。 root@E
    發(fā)表于 03-21 19:39

    【正點原子】T113-i開發(fā)板資料震撼來襲!異核開發(fā)、工控設計方案!

    【正點原子】T113-i開發(fā)板震撼來襲!異核開發(fā)、工控設計方案!ATK-DLT113IS
    發(fā)表于 03-13 15:37

    OK113i-CT113-i開發(fā)板 rtl8723du WIFI 功能測試藍牙驅(qū)動移植

    OK113i-C T113-i開發(fā)板板載一
    發(fā)表于 12-11 10:30

    OK113i-C T113-i開發(fā)板初體驗

    /TV-Out,上還自帶一個RTL8723du wifi/藍牙二合一模塊,作為一塊主打工業(yè)控制的主控這些接口實屬綽綽有余了。手里的板子是
    發(fā)表于 12-14 15:33

    100%國產(chǎn)物料認證,米爾入門級國產(chǎn)核心T113-i方案

    基于T113-i處理器的核心開發(fā)板,讓廣大工程師有了更多的選擇。接下來看看這款T113-i
    的頭像 發(fā)表于 09-21 08:01 ?1623次閱讀
    100%國產(chǎn)物料認證,米爾入門級國產(chǎn)核心<b class='flag-5'>板</b><b class='flag-5'>全</b><b class='flag-5'>志</b><b class='flag-5'>T113-i</b>方案

    多核異構工業(yè)開發(fā)板:創(chuàng)龍科技T113-i

    概述 本次評測開發(fā)板--創(chuàng)龍T113-i工業(yè)開發(fā)板,這是一款基于科技處T113-i理器, 采
    的頭像 發(fā)表于 10-24 10:26 ?1946次閱讀
    多核異構工業(yè)<b class='flag-5'>開發(fā)板</b>:創(chuàng)龍科技<b class='flag-5'>T113-i</b>

    如何在嵌入式T113-i開發(fā)板的Buildroot中移植MQTT協(xié)議?

    嵌入式OK113i-S開發(fā)板上市一段時間以來收獲了很多關注,也成為了許多客戶項目選型的優(yōu)質(zhì)之選。在實際的項目開發(fā)中,工程師朋友們可能會需
    的頭像 發(fā)表于 01-26 08:02 ?685次閱讀
    如何在<b class='flag-5'>飛</b><b class='flag-5'>凌</b>嵌入式<b class='flag-5'>T113-i</b><b class='flag-5'>開發(fā)板</b>的Buildroot中<b class='flag-5'>移植</b>MQTT協(xié)議?

    嵌入式T113-i開發(fā)板的調(diào)屏方法

    對于飛嵌入式T113-i開發(fā)板的調(diào)屏問題,需要按照以下步驟進行操作
    的頭像 發(fā)表于 01-29 16:25 ?1352次閱讀

    米爾-T113-i開發(fā)板與modbus設備的連接和操作

    本文主要介紹通過米爾-T113-i開發(fā)板實現(xiàn)與modbus設備的連接和操作。
    的頭像 發(fā)表于 03-21 19:42 ?1397次閱讀
    米爾-<b class='flag-5'>全</b><b class='flag-5'>志</b><b class='flag-5'>T113-i</b><b class='flag-5'>開發(fā)板</b>與modbus設備的連接和操作