{"action":"opened","issue":{"url":"https://api.github.com/repos/EHfive/pulseaudio-modules-bt/issues/14","repository_url":"https://api.github.com/repos/EHfive/pulseaudio-modules-bt","labels_url":"https://api.github.com/repos/EHfive/pulseaudio-modules-bt/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/EHfive/pulseaudio-modules-bt/issues/14/comments","events_url":"https://api.github.com/repos/EHfive/pulseaudio-modules-bt/issues/14/events","html_url":"https://github.com/EHfive/pulseaudio-modules-bt/issues/14","id":378178227,"node_id":"MDU6SXNzdWUzNzgxNzgyMjc=","number":14,"title":"Autoconnected device won't switch to LDAC","user":{"login":"shouya","id":526598,"node_id":"MDQ6VXNlcjUyNjU5OA==","avatar_url":"https://avatars0.githubusercontent.com/u/526598?v=4","gravatar_id":"","url":"https://api.github.com/users/shouya","html_url":"https://github.com/shouya","followers_url":"https://api.github.com/users/shouya/followers","following_url":"https://api.github.com/users/shouya/following{/other_user}","gists_url":"https://api.github.com/users/shouya/gists{/gist_id}","starred_url":"https://api.github.com/users/shouya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shouya/subscriptions","organizations_url":"https://api.github.com/users/shouya/orgs","repos_url":"https://api.github.com/users/shouya/repos","events_url":"https://api.github.com/users/shouya/events{/privacy}","received_events_url":"https://api.github.com/users/shouya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-07T07:58:54Z","updated_at":"2018-11-07T07:58:54Z","closed_at":null,"author_association":"NONE","body":"Thank you for this fantastic project first of all! It works great! However there's a small issue with bluetooth auto connect.\r\n\r\nTo be more elaborative, if I turn off my headphone while connected to a computer, and then turn the headphone back on again, the headphone will automatically reconnect, but in a low quality mono channel 8kHz mode. However, this can be easily fixed by simply disconnect and reconnect again (from the computer using commands like 'echo disconnect <MAC> | bluetoothctl; echo connect <MAC> | bluetoothctl'). After the reconnection it will be in LDAC mode as expected.\r\n\r\nI'm not familiar with details of pulseaudio or bluetooth, so it could be a trivial question. I searched the Internet and find no useful information to this situation.\r\n\r\nHere's some basic info:\r\n\r\n```\r\nOS: Gentoo x64 with Linux kernel 4.18.6\r\nWireless adapter: 03:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)\r\nHeadphone: MDR-1000X\r\npulseaudio --version: pulseaudio 12.2\r\nbluetoothctl --version: bluetoothctl: 5.50\r\n```\r\n\r\n<details>\r\n  <summary>Here's some outputs from `pactl list sinks` (Click to expand)</summary>\r\n\r\n```\r\n# after bluetooth autoconnect\r\nSink #25\r\n\tState: SUSPENDED\r\n\tName: bluez_sink.<MASKED>.headset_head_unit\r\n\tDescription: MDR-1000X\r\n\tDriver: module-bluez5-device.c\r\n\tSample Specification: s16le 1ch 8000Hz\r\n\tChannel Map: mono\r\n\tOwner Module: 48\r\n\tMute: no\r\n\tVolume: mono: 38610 /  59%\r\n\t        balance 0.00\r\n\tBase Volume: 65536 / 100%\r\n\tMonitor Source: bluez_sink.<MASKED>.headset_head_unit.monitor\r\n\tLatency: 0 usec, configured 0 usec\r\n\tFlags: HARDWARE HW_VOLUME_CTRL LATENCY \r\n\tProperties:\r\n\t\tbluetooth.protocol = \"headset_head_unit\"\r\n\t\tdevice.intended_roles = \"phone\"\r\n\t\tdevice.description = \"MDR-1000X\"\r\n\t\tdevice.string = \"<MASKED>\"\r\n\t\tdevice.api = \"bluez\"\r\n\t\tdevice.class = \"sound\"\r\n\t\tdevice.bus = \"bluetooth\"\r\n\t\tdevice.form_factor = \"headset\"\r\n\t\tbluez.path = \"/org/bluez/hci0/dev_<MASKED>\"\r\n\t\tbluez.class = \"0x240404\"\r\n\t\tbluez.alias = \"MDR-1000X\"\r\n\t\tdevice.icon_name = \"audio-headset-bluetooth\"\r\n\tPorts:\r\n\t\theadset-output: Headset (priority: 0)\r\n\tActive Port: headset-output\r\n\tFormats:\r\n\t\tpcm\r\n\r\n\r\n# after reconnection\r\nSink #27\r\n\tState: SUSPENDED\r\n\tName: bluez_sink.<MASKED>.a2dp_sink\r\n\tDescription: MDR-1000X\r\n\tDriver: module-bluez5-device.c\r\n\tSample Specification: s32le 2ch 44100Hz\r\n\tChannel Map: front-left,front-right\r\n\tOwner Module: 50\r\n\tMute: no\r\n\tVolume: front-left: 32717 /  50% / -18.10 dB,   front-right: 32717 /  50% / -18.10 dB\r\n\t        balance 0.00\r\n\tBase Volume: 65536 / 100% / 0.00 dB\r\n\tMonitor Source: bluez_sink.<MASKED>.a2dp_sink.monitor\r\n\tLatency: 0 usec, configured 0 usec\r\n\tFlags: HARDWARE DECIBEL_VOLUME LATENCY \r\n\tProperties:\r\n\t\tbluetooth.protocol = \"a2dp_sink\"\r\n\t\tbluetooth.a2dp_codec = \"LDAC\"\r\n\t\tdevice.description = \"MDR-1000X\"\r\n\t\tdevice.string = \"<MASKED>\"\r\n\t\tdevice.api = \"bluez\"\r\n\t\tdevice.class = \"sound\"\r\n\t\tdevice.bus = \"bluetooth\"\r\n\t\tdevice.form_factor = \"headset\"\r\n\t\tbluez.path = \"/org/bluez/hci0/dev_<MASKED>\"\r\n\t\tbluez.class = \"0x240404\"\r\n\t\tbluez.alias = \"MDR-1000X\"\r\n\t\tdevice.icon_name = \"audio-headset-bluetooth\"\r\n\t\tdevice.intended_roles = \"phone\"\r\n\tPorts:\r\n\t\theadset-output: Headset (priority: 0)\r\n\tActive Port: headset-output\r\n\tFormats:\r\n\t\tpcm\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n  <summary>And my `/etc/pulse/default.pa` config (Click to expand)</summary>\r\n\r\n```config\r\n#!/usr/bin/pulseaudio -nF\r\n#\r\n# This file is part of PulseAudio.\r\n#\r\n# PulseAudio is free software; you can redistribute it and/or modify it\r\n# under the terms of the GNU Lesser General Public License as published by\r\n# the Free Software Foundation; either version 2 of the License, or\r\n# (at your option) any later version.\r\n#\r\n# PulseAudio is distributed in the hope that it will be useful, but\r\n# WITHOUT ANY WARRANTY; without even the implied warranty of\r\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r\n# General Public License for more details.\r\n#\r\n# You should have received a copy of the GNU Lesser General Public License\r\n# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.\r\n\r\n# This startup script is used only if PulseAudio is started per-user\r\n# (i.e. not in system mode)\r\n\r\n.fail\r\n\r\n### Automatically restore the volume of streams and devices\r\nload-module module-device-restore\r\nload-module module-stream-restore\r\nload-module module-card-restore\r\n\r\n### Automatically augment property information from .desktop files\r\n### stored in /usr/share/application\r\nload-module module-augment-properties\r\n\r\n### Should be after module-*-restore but before module-*-detect\r\nload-module module-switch-on-port-available\r\n\r\n### Load audio drivers statically\r\n### (it's probably better to not load these drivers manually, but instead\r\n### use module-udev-detect -- see below -- for doing this automatically)\r\n#load-module module-alsa-sink\r\n#load-module module-alsa-source device=hw:1,0\r\n#load-module module-null-sink\r\n#load-module module-pipe-sink\r\n\r\n### Automatically load driver modules depending on the hardware available\r\n.ifexists module-udev-detect.so\r\nload-module module-udev-detect\r\n.else\r\n### Use the static hardware detection module (for systems that lack udev support)\r\nload-module module-detect\r\n.endif\r\n\r\n### Automatically connect sink and source if JACK server is present\r\n.ifexists module-jackdbus-detect.so\r\n.nofail\r\nload-module module-jackdbus-detect channels=2\r\n.fail\r\n.endif\r\n\r\n### Automatically load driver modules for Bluetooth hardware\r\n.ifexists module-bluetooth-policy.so\r\nload-module module-bluetooth-policy\r\n.endif\r\n\r\n.ifexists module-bluetooth-discover.so\r\n# load-module module-bluetooth-discover\r\nload-module module-bluetooth-discover a2dp_config=\"ldac_eqmid=abr ldac_fmt=s32\"\r\n.endif\r\n\r\n\r\n\r\n### Load several protocols\r\n.ifexists module-esound-protocol-unix.so\r\nload-module module-esound-protocol-unix\r\n.endif\r\nload-module module-native-protocol-unix\r\n\r\n### Network access (may be configured with paprefs, so leave this commented\r\n### here if you plan to use paprefs)\r\n#load-module module-esound-protocol-tcp\r\n#load-module module-native-protocol-tcp\r\n\r\n### Load the RTP receiver module (also configured via paprefs, see above)\r\n#load-module module-rtp-recv\r\n\r\n### Load the RTP sender module (also configured via paprefs, see above)\r\n#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties=\"device.description='RTP Multicast Sink'\"\r\n#load-module module-rtp-send source=rtp.monitor\r\n\r\n### Load additional modules from GSettings. This can be configured with the paprefs tool.\r\n### Please keep in mind that the modules configured by paprefs might conflict with manually\r\n### loaded modules.\r\n.ifexists module-gsettings.so\r\n.nofail\r\nload-module module-gsettings\r\n.fail\r\n.endif\r\n\r\n\r\n### Automatically restore the default sink/source when changed by the user\r\n### during runtime\r\n### NOTE: This should be loaded as early as possible so that subsequent modules\r\n### that look up the default sink/source get the right value\r\nload-module module-default-device-restore\r\n\r\n### Automatically move streams to the default sink if the sink they are\r\n### connected to dies, similar for sources\r\nload-module module-rescue-streams\r\n\r\n### Make sure we always have a sink around, even if it is a null sink.\r\nload-module module-always-sink\r\n\r\n### Honour intended role device property\r\nload-module module-intended-roles\r\n\r\n### Automatically suspend sinks/sources that become idle for too long\r\nload-module module-suspend-on-idle\r\n\r\n### If autoexit on idle is enabled we want to make sure we only quit\r\n### when no local session needs us anymore.\r\n.ifexists module-console-kit.so\r\nload-module module-console-kit\r\n.endif\r\n.ifexists module-systemd-login.so\r\nload-module module-systemd-login\r\n.endif\r\n\r\n### Enable positioned event sounds\r\nload-module module-position-event-sounds\r\n\r\n### Cork music/video streams when a phone stream is active\r\nload-module module-role-cork\r\n\r\n### Modules to allow autoloading of filters (such as echo cancellation)\r\n### on demand. module-filter-heuristics tries to determine what filters\r\n### make sense, and module-filter-apply does the heavy-lifting of\r\n### loading modules and rerouting streams.\r\nload-module module-filter-heuristics\r\nload-module module-filter-apply\r\n\r\n### Make some devices default\r\n#set-default-sink output\r\n#set-default-source input\r\n```\r\n</details>\r\n"}}
{"actor":{"display_login":"shouya"}}