{"id":1344,"date":"2019-10-28T10:01:54","date_gmt":"2019-10-28T02:01:54","guid":{"rendered":"http:\/\/lovewut.pw\/?p=1344"},"modified":"2019-10-28T11:09:51","modified_gmt":"2019-10-28T03:09:51","slug":"ubuntu%e6%a0%91%e8%8e%93%e6%b4%be%e4%bd%bf%e7%94%a8%e8%93%9d%e7%89%99%e9%9f%b3%e5%93%8d","status":"publish","type":"post","link":"https:\/\/bloo.heing.fun\/?p=1344","title":{"rendered":"ubuntu\u6811\u8393\u6d3e\u4f7f\u7528\u84dd\u7259\u97f3\u54cd"},"content":{"rendered":"<p>\u8f93\u5165\u547d\u4ee4bluetoothctl\u8fdb\u5165\u84dd\u7259\u4ea4\u4e92\u754c\u9762\u3002<\/p>\n<p>\u4ea4\u4e92\u754c\u9762\u91cc\uff1a<\/p>\n<p>1. scan on \u5f00\u59cb\u626b\u63cf\uff0c scan off \u7ed3\u675f\u626b\u63cf<\/p>\n<p>2. pair AB:CD&#8230; \u8fdb\u884c\u914d\u5bf9<\/p>\n<p>3. connect AB:CD&#8230; \u8fdb\u884c\u8fde\u63a5\u3002<\/p>\n<p>\u5982\u679cconnect\u65f6<\/p>\n<pre><code> org.bluez.Error.Failed<\/code><\/pre>\n<hr \/>\n<p>\u8fd9\u53ef\u80fd\u662f\u7531\u4e8e\u672a\u5b89\u88c5<code>pulseaudio-module-bluetooth<\/code>\u8f6f\u4ef6\u5305\u3002\u5982\u679c\u4e22\u5931\u5219\u5b89\u88c5\u5b83\uff0c\u7136\u540e\u91cd\u65b0\u542f\u52a8pulseaudio\u3002<\/p>\n<pre><code>sudo apt install pulseaudio-module-bluetooth \r\npulseaudio -k\r\npulseaudio --start\r\n<\/code><\/pre>\n<p>\u5982\u679c\u95ee\u9898\u4e0d\u662f\u7531\u4e8e\u7f3a\u5c11\u5305\uff0c\u90a3\u4e48\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u7684\u95ee\u9898\u662fPulseAudio\u6ca1\u6709\u8d76\u4e0a\u3002\u6b64\u95ee\u9898\u7684\u5e38\u89c1\u89e3\u51b3\u65b9\u6848\u662f\u91cd\u65b0\u542f\u52a8PulseAudio\u3002\u8bf7\u6ce8\u610f\uff0c\u5728PulseAudio\u4ee5\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u65f6\uff0c\u4ee5root\u8eab\u4efd\u8fd0\u884cbluetoothctl\u662f\u5b8c\u5168\u6b63\u5e38\u7684\u3002\u91cd\u65b0\u542f\u52a8PulseAudio\u540e\uff0c\u91cd\u8bd5\u8fde\u63a5\u3002\u6ca1\u6709\u5fc5\u8981\u91cd\u590d\u914d\u5bf9\u3002<\/p>\n<p><strong>\u4ec5\u5f53\u4e0a\u8ff0\u5185\u5bb9\u4e0d\u9002\u5408\u60a8\u65f6\uff0c\u7ee7\u7eed\u5c1d\u8bd5\u7b2c\u4e8c\u90e8\u5206\uff1a<\/strong><\/p>\n<p>\u5982\u679c\u91cd\u542fPulseAudio\u4e0d\u8d77\u4f5c\u7528\uff0c\u5219\u9700\u8981\u52a0\u8f7dmodule-bluetooth-discover\u3002<\/p>\n<pre><code>sudo pactl load-module module-bluetooth-discover\r\n<\/code><\/pre>\n<p>\u53ef\u4ee5\u5c06\u76f8\u540c\u7684load-module\u547d\u4ee4\u6dfb\u52a0\u5230<code>\/etc\/pulse\/default.pa<\/code>\u3002<br \/>\n\u5982\u679c\u4ecd\u7136\u65e0\u6548\uff0c\u6216\u8005\u60a8\u6b63\u5728\u4f7f\u7528PulseAudio\u7684\u7cfb\u7edf\u8303\u56f4\u6a21\u5f0f\uff0c\u8fd8\u8981\u52a0\u8f7d\u4ee5\u4e0bPulseAudio\u6a21\u5757\uff08\u540c\u6837\u53ef\u4ee5\u901a\u8fc7default.pa\u6216system.pa\u52a0\u8f7d\u8fd9\u4e9b\u6a21\u5757\uff09\uff1a<\/p>\n<p><code>module-bluetooth-policy module-bluez5-device module-bluez5-discover<\/code><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u63a5\u7740\u5982\u679c\u8fd8\u662f\u4f7f\u7528\u9ed8\u8ba4\u7684\u8bbe\u5907\u64ad\u653e\uff0c\u800c\u4e0d\u662f\u84dd\u7259\u64ad\u653e\u7684\u8bdd<\/p>\n<p>\u7f16\u8f91 \/etc\/pulse\/default.pa\uff0c\u6dfb\u52a0\u4e0b\u97622\u884c<\/p>\n<div class=\"codebox\">\n<pre><code class=\"sql\"># automatically switch to newly-connected devices\r\n<span class=\"operator\"><span class=\"keyword\">load<\/span>-<span class=\"keyword\">module<\/span> <span class=\"keyword\">module<\/span>-switch-<span class=\"keyword\">on<\/span>-<span class=\"keyword\">connect<\/span><\/span><\/code><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u8f93\u5165\u547d\u4ee4bluetoothctl\u8fdb\u5165\u84dd\u7259\u4ea4\u4e92\u754c\u9762\u3002 \u4ea4\u4e92\u754c\u9762\u91cc\uff1a 1. scan on \u5f00\u59cb\u626b\u63cf\uff0c scan  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[51,68],"class_list":["post-1344","post","type-post","status-publish","format-standard","hentry","category-36","tag-ubuntu","tag-68"],"_links":{"self":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts\/1344","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1344"}],"version-history":[{"count":2,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts\/1344\/revisions"}],"predecessor-version":[{"id":1346,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts\/1344\/revisions\/1346"}],"wp:attachment":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}