Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bluetooth telephony HFP profile using bluez5/pulseaudio5
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Sun Feb 28, 2021 6:37 am    Post subject: Reply with quote

garrison wrote:
Please try this instead https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/491
This has been merged to master upstream. Do you know if this will make it into a release any time soon? If so, which one?

Also, if someone tried this patch on top of v13, how is the stability of pulseaudio in general?
Back to top
View user's profile Send private message
garrison
Apprentice
Apprentice


Joined: 18 Mar 2003
Posts: 250

PostPosted: Sun Feb 28, 2021 9:17 am    Post subject: Reply with quote

devsk wrote:
garrison wrote:
Please try this instead https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/491
This has been merged to master upstream. Do you know if this will make it into a release any time soon? If so, which one?

It should be included in pulseaudio-15.0 which is tentatively March/April 2021.

devsk wrote:
Also, if someone tried this patch on top of v13, how is the stability of pulseaudio in general?

Original patchset is 4 top changes here https://git.kernel.org/pub/scm/linux/kernel/git/jejb/pulseaudio.git/log/?h=jejb-v13
It was used for about a year already afaik, via custom opensuse buildservice package applying these changes here https://build.opensuse.org/package/show/home:jejb1:Tumbleweed/pulseaudio
If you just cannot wait you can apply these as patch to 13.0 ebuild and HFP HF should work (pulseaudio merge request received a few fixes on top of that work.) I did not evaluated an option to do a backport of those extra fixes to 13.0
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Sun Feb 28, 2021 4:56 pm    Post subject: Reply with quote

garrison wrote:
devsk wrote:
garrison wrote:
Please try this instead https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/491
This has been merged to master upstream. Do you know if this will make it into a release any time soon? If so, which one?

It should be included in pulseaudio-15.0 which is tentatively March/April 2021.

devsk wrote:
Also, if someone tried this patch on top of v13, how is the stability of pulseaudio in general?

Original patchset is 4 top changes here https://git.kernel.org/pub/scm/linux/kernel/git/jejb/pulseaudio.git/log/?h=jejb-v13
It was used for about a year already afaik, via custom opensuse buildservice package applying these changes here https://build.opensuse.org/package/show/home:jejb1:Tumbleweed/pulseaudio
If you just cannot wait you can apply these as patch to 13.0 ebuild and HFP HF should work (pulseaudio merge request received a few fixes on top of that work.) I did not evaluated an option to do a backport of those extra fixes to 13.0


There are like 7 commits on top of those original 4 commits from Sep 2019 (almost 1.5 years ago) in that merge request.

Code:
bluetooth: clean up rfcomm_write usage
Igor Kovalenko authored 1 week ago
45d896f8
Igor Kovalenko's avatar
bluetooth: rename enable_hs_role to enable_shared_profiles
Igor Kovalenko authored 1 week ago
0a36c154
Igor Kovalenko's avatar
bluetooth: use device flag to prevent assertion failure during shutdown
Igor Kovalenko authored 3 weeks ago
c884ae8c
Igor Kovalenko's avatar
bluetooth: complete bluetooth profile separation
Igor Kovalenko authored 4 weeks ago
698fb3bc
Igor Kovalenko's avatar
bluetooth: prefer headset HFP HF connection with native backend
Igor Kovalenko authored 1 month ago
815dd2d6
Igor Kovalenko's avatar
bluetooth: fix headset=auto ofono handover
Igor Kovalenko authored 1 month ago
70171158
Igor Kovalenko's avatar
bluetooth: enable module-bluez5-discover argument enable_native_hfp_hf
Igor Kovalenko authored 1 month ago
8491477b
Are you sure I only need 1.5 year old code and not the recent fixes?

Why is PA development so slow? 1.5 years and the code is not released in a stable version?

Is it possible to generate a tar of the patches out of the merge request?
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Sun Feb 28, 2021 6:07 pm    Post subject: Reply with quote

hmm...I downloaded all 11 patches (in order they were committed, oldest marked 001) and put them in /etc/portage/patches and it failed to apply the second patch....:-(

Code:
>>> Unpacking source...
>>> Unpacking pulseaudio-13.0.tar.xz to /var/tmp/portage/media-sound/pulseaudio-13.0-r1/work
>>> Source unpacked in /var/tmp/portage/media-sound/pulseaudio-13.0-r1/work
>>> Preparing source in /var/tmp/portage/media-sound/pulseaudio-13.0-r1/work/pulseaudio-13.0 ...
 * Applying pulseaudio-11.1-disable-flat-volumes.patch ...                                                                                                                                                 [ ok ]
 * Applying 001-pulseaudio-hsp_hfp.patch ...
patching file src/modules/bluetooth/backend-native.c
Hunk #1 succeeded at 449 (offset 4 lines).
Hunk #2 succeeded at 476 (offset 4 lines).
Hunk #3 succeeded at 509 (offset 4 lines).
Hunk #4 succeeded at 626 (offset 4 lines).
Hunk #5 succeeded at 647 (offset 4 lines).
Hunk #6 succeeded at 665 (offset 4 lines).
Hunk #7 succeeded at 693 (offset 4 lines).
Hunk #8 succeeded at 705 (offset 4 lines).
patching file src/modules/bluetooth/backend-ofono.c
patching file src/modules/bluetooth/bluez5-util.c
Hunk #1 succeeded at 176 (offset -20 lines).
Hunk #2 succeeded at 1027 with fuzz 1 (offset -420 lines).
Hunk #3 succeeded at 1271 (offset -426 lines).
patching file src/modules/bluetooth/bluez5-util.h
Hunk #1 succeeded at 57 (offset -13 lines).
patching file src/modules/bluetooth/module-bluez5-device.c
Hunk #1 succeeded at 253 (offset -8 lines).
Hunk #2 succeeded at 323 (offset -4 lines).
Hunk #3 succeeded at 736 (offset -31 lines).
Hunk #4 succeeded at 953 (offset -31 lines).
Hunk #5 succeeded at 976 with fuzz 2 (offset -33 lines).
Hunk #6 succeeded at 984 (offset -33 lines).
Hunk #7 succeeded at 1012 (offset -33 lines).
Hunk #8 succeeded at 1137 (offset -33 lines).
Hunk #9 succeeded at 1160 with fuzz 2 (offset -35 lines).
Hunk #10 succeeded at 1197 (offset -35 lines).
Hunk #11 succeeded at 1206 (offset -35 lines).
Hunk #12 succeeded at 1257 (offset -35 lines).
Hunk #13 succeeded at 1275 (offset -35 lines).
Hunk #14 succeeded at 1590 (offset -55 lines).
Hunk #15 succeeded at 1606 (offset -55 lines).
Hunk #16 succeeded at 1857 (offset -72 lines).
Hunk #17 succeeded at 1870 (offset -72 lines).
Hunk #18 succeeded at 1945 (offset -72 lines).
Hunk #19 succeeded at 2158 (offset -77 lines).
Hunk #20 succeeded at 2186 (offset -77 lines).                                                                                                                                                             [ ok ]
 * Applying 002-pulseaudio-hsp_hfp.patch ...
patching file src/modules/bluetooth/backend-native.c
Hunk #1 succeeded at 62 with fuzz 1 (offset 8 lines).
Hunk #2 succeeded at 513 (offset 4 lines).
Hunk #3 succeeded at 592 with fuzz 1 (offset 4 lines).
Hunk #4 succeeded at 638 (offset 4 lines).
Hunk #5 succeeded at 661 (offset 4 lines).
Hunk #6 succeeded at 706 (offset 4 lines).
Hunk #7 succeeded at 720 (offset 4 lines).
patching file src/modules/bluetooth/bluez5-util.c
Hunk #1 succeeded at 94 (offset -20 lines).
Hunk #2 succeeded at 172 (offset -20 lines).
Hunk #3 succeeded at 554 (offset -192 lines).
Hunk #4 succeeded at 1296 (offset -426 lines).
Hunk #5 succeeded at 1613 with fuzz 1 (offset -564 lines).
Hunk #6 succeeded at 1625 (offset -565 lines).
patching file src/modules/bluetooth/bluez5-util.h
Hunk #1 succeeded at 58 (offset -13 lines).
Hunk #2 succeeded at 179 (offset -20 lines).
patching file src/modules/bluetooth/module-bluetooth-policy.c
Hunk #1 succeeded at 157 (offset 1 line).
Hunk #2 succeeded at 192 (offset 1 line).
Hunk #3 succeeded at 204 (offset 1 line).
Hunk #4 succeeded at 359 (offset 1 line).
patching file src/modules/bluetooth/module-bluez5-device.c
Hunk #1 succeeded at 254 (offset -8 lines).
Hunk #2 succeeded at 325 (offset -4 lines).
Hunk #3 succeeded at 738 (offset -31 lines).
Hunk #4 succeeded at 980 with fuzz 2 (offset -33 lines).
Hunk #5 succeeded at 993 (offset -33 lines).
Hunk #6 succeeded at 1018 (offset -33 lines).
Hunk #7 succeeded at 1168 with fuzz 2 (offset -35 lines).
Hunk #8 succeeded at 1180 (offset -35 lines).
Hunk #9 succeeded at 1207 (offset -35 lines).
Hunk #10 succeeded at 1218 (offset -35 lines).
Hunk #11 succeeded at 1290 (offset -35 lines).
Hunk #12 succeeded at 1873 (offset -72 lines).
Hunk #13 succeeded at 1972 (offset -72 lines).
Hunk #14 succeeded at 1994 (offset -72 lines).
Hunk #15 succeeded at 2025 (offset -72 lines).
patching file src/modules/bluetooth/module-bluez5-discover.c
Hunk #1 FAILED at 110.
Hunk #2 succeeded at 126 (offset -7 lines).
Hunk #3 succeeded at 138 with fuzz 1 (offset -14 lines).
1 out of 3 hunks FAILED -- saving rejects to file src/modules/bluetooth/module-bluez5-discover.c.rej                                                                                                       [ !! ]
 * ERROR: media-sound/pulseaudio-13.0-r1::gentoo failed (prepare phase):
 *   patch -p1  failed with /etc/portage/patches/media-sound/pulseaudio/002-pulseaudio-hsp_hfp.patch
 *
 * Call stack:
 *               ebuild.sh, line  125:  Called src_prepare
 *             environment, line 3689:  Called default
 *      phase-functions.sh, line  855:  Called default_src_prepare
 *      phase-functions.sh, line  920:  Called __eapi6_src_prepare
 *             environment, line  432:  Called eapply_user
 *             environment, line 1383:  Called eapply '/etc/portage/patches/media-sound/pulseaudio/002-pulseaudio-hsp_hfp.patch'
 *             environment, line 1353:  Called _eapply_patch '/etc/portage/patches/media-sound/pulseaudio/002-pulseaudio-hsp_hfp.patch'
 *             environment, line 1291:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/media-sound/pulseaudio/002-pulseaudio-hsp_hfp.patch'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *              die "$@"


May be some existing patches in Gentoo are conflicting with these patches?
Back to top
View user's profile Send private message
garrison
Apprentice
Apprentice


Joined: 18 Mar 2003
Posts: 250

PostPosted: Sun Feb 28, 2021 9:30 pm    Post subject: Reply with quote

devsk wrote:
Are you sure I only need 1.5 year old code and not the recent fixes?

Yes to see it working you just need the 4 original commits from jejb repository at kernel.org, there jejb-v13 branch should be pulseaudio-13.0 + these 4 changes.
Changes in 491 are those rebased to master branch at time of submission (so not compatible with 13.0 code base.) Remaining 7 changes are needed to fix obscure problems you probably would not easily reproduce, and to make resulting pulseaudio code maintainable in the long term.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Sun Feb 28, 2021 10:59 pm    Post subject: Reply with quote

garrison wrote:
devsk wrote:
Are you sure I only need 1.5 year old code and not the recent fixes?

Yes to see it working you just need the 4 original commits from jejb repository at kernel.org, there jejb-v13 branch should be pulseaudio-13.0 + these 4 changes.
Changes in 491 are those rebased to master branch at time of submission (so not compatible with 13.0 code base.) Remaining 7 changes are needed to fix obscure problems you probably would not easily reproduce, and to make resulting pulseaudio code maintainable in the long term.
OK, cloned the repo and got those 4 commits. They apply fine. Let's see if they work.

So, after this patch, my BT headset should show an HFP profile and I should be able to select without making any other changes, right?
Back to top
View user's profile Send private message
garrison
Apprentice
Apprentice


Joined: 18 Mar 2003
Posts: 250

PostPosted: Mon Mar 01, 2021 5:14 am    Post subject: Reply with quote

If it does not work, check if your device has Handsfree profile in 'bluetoothctl info' output with device connected.
Also make sure you either have default (empty) args here 'load-module module-bluetooth-discover' or if you prefer to set args explicitly use 'headset=native' there.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Mon Mar 01, 2021 6:39 am    Post subject: Reply with quote

hmm...seems like it does not work.

My headset is detected as Headset, I can select the HFP Profile but the headset keeps beeping every T (I think 30) seconds. No sound is recorded when I use it as microphone and no sound is played through it.

I switch to A2DP, the sound works but the beeping continues.

Code:
$ bluetoothctl info
Device blah (public)
        Name: Soundcore Life Q30
        Alias: Soundcore Life Q30
        Class: 0x00240404
        Icon: audio-card
        Paired: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Serial Port               (00001101-0000-1000-8000-00805f9b34fb)
        UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
        UUID: Vendor specific           (66666666-6666-6666-6666-666666666666)

modules list:

Code:

0       module-device-restore
1       module-stream-restore
2       module-card-restore
3       module-augment-properties
4       module-switch-on-port-available
5       module-udev-detect
6       module-alsa-card        device_id="2" name="usb-Sonix_Technology_Co.__Ltd._USB_Live_camera_SN0001-02" card_name="alsa_card.usb-Sonix_Technology_Co.__Ltd._USB_Live_camera_SN0001-02" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
7       module-alsa-card        device_id="0" name="pci-0000_2d_00.1" card_name="alsa_card.pci-0000_2d_00.1" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
8       module-alsa-card        device_id="1" name="pci-0000_30_00.4" card_name="alsa_card.pci-0000_30_00.4" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
9       module-jackdbus-detect  channels=2
10      module-bluetooth-policy
11      module-bluetooth-discover
12      module-bluez5-discover
13      module-native-protocol-unix
14      module-zeroconf-publish
15      module-gsettings
16      module-default-device-restore
17      module-rescue-streams
18      module-always-sink
19      module-intended-roles
20      module-suspend-on-idle
21      module-console-kit
22      module-systemd-login
23      module-position-event-sounds
24      module-role-cork
25      module-filter-heuristics
26      module-filter-apply
27      module-x11-publish      display=:0
28      module-x11-cork-request display=:0
29      module-x11-xsmp display=:0 session_manager=local/devsk-amd-pc:@/tmp/.ICE-unix/13206,unix/devsk-amd-pc:/tmp/.ICE-unix/13206
30      module-bluez5-device    path=/org/bluez/hci0/dev_blah autodetect_mtu=0
31      module-cli-protocol-unix


dmesg has this:

Code:

$ dmesg| grep -i bluetooth | tail
[ 1768.220419] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 1768.220419] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 1768.220420] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 1768.220420] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 1768.220421] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 1768.220421] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 1794.845959] Bluetooth: hci0: SCO packet for unknown connection handle 257
[ 1794.845962] Bluetooth: hci0: SCO packet for unknown connection handle 257
[ 1794.845963] Bluetooth: hci0: SCO packet for unknown connection handle 257
[ 1794.845963] Bluetooth: hci0: SCO packet for unknown connection handle 257


I have no idea what the periodic beep is trying to tell me but its annoying the hell out of me....:-) I don't have much time for troubleshooting this. So, if you have some quick thoughts, please let me know.
Back to top
View user's profile Send private message
garrison
Apprentice
Apprentice


Joined: 18 Mar 2003
Posts: 250

PostPosted: Mon Mar 01, 2021 6:49 am    Post subject: Reply with quote

devsk wrote:
hmm...seems like it does not work.
$ dmesg| grep -i bluetooth | tail
[ 1768.220419] Bluetooth: hci0: SCO packet for unknown connection handle 0
...
[ 1794.845963] Bluetooth: hci0: SCO packet for unknown connection handle 257[/code]

I'm not sure about these but you probably need fairly recent kernel anyway to get all bluetooth dongle fixes, 5.10.18+ or 5.11.1+ should be good starting point.
If it still does not work I'd suggest you to try building pulseaudio master from source and see if that flies. Mind that I did not checked the original implementation myself, only relay what was reported by original author in their testing.
EDIT: corrected kernel versions which are expected to work
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Mon Mar 01, 2021 7:04 am    Post subject: Reply with quote

garrison wrote:
devsk wrote:
hmm...seems like it does not work.
$ dmesg| grep -i bluetooth | tail
[ 1768.220419] Bluetooth: hci0: SCO packet for unknown connection handle 0
...
[ 1794.845963] Bluetooth: hci0: SCO packet for unknown connection handle 257[/code]

I'm not sure about these but you probably need fairly recent kernel anyway to get all bluetooth dongle fixes, 5.10.18+ or 5.11.1+ should be good starting point.
If it still does not work I'd suggest you to try building pulseaudio master from source and see if that flies. Mind that I did not checked the original implementation myself, only relay what was reported by original author in their testing.
EDIT: corrected kernel versions which are expected to work
How stable is pulseaudio master branch?....:-) Am I opening a can of worms?

I have to run a recent kernel because of bluetooth fixes I needed on my laptop. So, I am running 5.11.2 right now.
Back to top
View user's profile Send private message
garrison
Apprentice
Apprentice


Joined: 18 Mar 2003
Posts: 250

PostPosted: Mon Mar 01, 2021 7:11 am    Post subject: Reply with quote

devsk wrote:
How stable is pulseaudio master branch?....:-) Am I opening a can of worms?

I have to run a recent kernel because of bluetooth fixes I needed on my laptop. So, I am running 5.11.2 right now.

It's pretty stable (well, at least for me as I run it exclusively for quite some time now) - mind you do not need to install it to perform testing, just run it from build directory.
I did not tested with 5.11.x kernels myself yet.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Mon Mar 01, 2021 7:24 am    Post subject: Reply with quote

garrison wrote:
devsk wrote:
How stable is pulseaudio master branch?....:-) Am I opening a can of worms?

I have to run a recent kernel because of bluetooth fixes I needed on my laptop. So, I am running 5.11.2 right now.

It's pretty stable (well, at least for me as I run it exclusively for quite some time now) - mind you do not need to install it to perform testing, just run it from build directory.
I did not tested with 5.11.x kernels myself yet.
How did you Gentoo'fy the local build? The binary has to run in the context of what's in /etc/pulse, isn't it?

Also, what configure args did you use for local build?
Back to top
View user's profile Send private message
garrison
Apprentice
Apprentice


Joined: 18 Mar 2003
Posts: 250

PostPosted: Mon Mar 01, 2021 7:34 am    Post subject: Reply with quote

If you run it from build tree then configuration files will be used from 'build/src/daemon/' directory
I use these parameters to build current pulseaudio master branch locally
Code:

meson build -D alsadatadir=/usr/share/alsa-card-profile/mixer -D pulsedsp-location='/usr/lib64/pulseaudio' -D stream-restore-clear-old-devices=true -D udevrulesdir=/usr/lib/udev/rules.d -D running-from-build-tree=true

and run it like this
Code:
build/src/daemon/pulseaudio -vvvvv -n -F build/src/daemon/default.pa -p $(pwd)/build/src/modules/ --realtime=true --no-cpu-limit=true --log-time=yes --log-target=file:/tmp/pulse-debug.log

This creates verbose log as well.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 2995
Location: Bay Area, CA

PostPosted: Mon Mar 01, 2021 8:06 am    Post subject: Reply with quote

I got the master running but as soon as I select the HFP profile, I see the errors in the dmesg and bluetooth device gets removed:

Code:
# dmesg | grep -i blue | tail
[ 7281.787623] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 7281.797586] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 7281.797592] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 7281.797593] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 7281.797594] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 7281.797594] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 7281.797595] Bluetooth: hci0: SCO packet for unknown connection handle 0
[ 7286.814173] Bluetooth: hci0: SCO packet for unknown connection handle 257
[ 7286.814177] Bluetooth: hci0: SCO packet for unknown connection handle 257
[ 7286.814178] Bluetooth: hci0: SCO packet for unknown connection handle 257


PA log just sees that the device got removed.

I think this is more trouble than its worth.


Last edited by devsk on Mon Mar 01, 2021 5:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
garrison
Apprentice
Apprentice


Joined: 18 Mar 2003
Posts: 250

PostPosted: Mon Mar 01, 2021 8:15 am    Post subject: Reply with quote

devsk wrote:
I think this is more trouble than its worth.

This could be either headset issue or (more likely still) bluetooth driver issue, or yet another undiscovered problem with HFP HF..
Thanks for giving it a go anyway!
Back to top
View user's profile Send private message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 523
Location: Connecticut, USA

PostPosted: Mon Mar 01, 2021 11:22 pm    Post subject: Reply with quote

I'm now running kernel 5.11.2, and pulse from git head, but still no joy. I don't see any relevant dmesg errors (I do see "input: WH-CH700N (AVRCP) as /devices/virtual/input/input22") but /var/log/messages includes
Code:
bluetoothd[23511]: src/profile.c:ext_start_servers() RFCOMM server failed for Headset unit: socket(STREAM, RFCOMM): Protocol not supported (93)
bluetoothd[23511]: src/profile.c:connect_io() Unable to connect Headset Voice gateway: socket(STREAM, RFCOMM): Protocol not supported (93)
bluetoothd[23511]: src/profile.c:record_cb() Connecting Headset Voice gateway failed: Input/output error
bluetoothctl info includes
Code:
UUID: Vendor specific           (00000000-deca-fade-deca-deafdecacaff)
UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
I think I've tried both with and without hsphfpd running and with and without ofonod running with no apparent difference. pavucontrol gives me the choice of "High Fidelity Playback (A2DP Sink)" or "Headset Hed Unit (HSP/HFP) (unavailable)". Selecting the latter does not show the headset under Input Devices.
I'm at a loss as to what else to try.
[EDIT: it might be helpful to have a pulseaudio-9999 ebuild]
Back to top
View user's profile Send private message
garrison
Apprentice
Apprentice


Joined: 18 Mar 2003
Posts: 250

PostPosted: Wed Mar 03, 2021 5:02 am    Post subject: Reply with quote

genterminl wrote:
I'm now running kernel 5.11.2, and pulse from git head, but still no joy. I don't see any relevant dmesg errors (I do see "input: WH-CH700N (AVRCP) as /devices/virtual/input/input22") but /var/log/messages includes
Code:
bluetoothd[23511]: src/profile.c:ext_start_servers() RFCOMM server failed for Headset unit: socket(STREAM, RFCOMM): Protocol not supported (93)
bluetoothd[23511]: src/profile.c:connect_io() Unable to connect Headset Voice gateway: socket(STREAM, RFCOMM): Protocol not supported (93)


You probably miss a few kernel configuration options, at least this one
Code:
CONFIG_BT_RFCOMM

More prerequisites here https://wiki.gentoo.org/wiki/Bluetooth
Quote:

bluetoothctl info includes
Code:

UUID: Vendor specific           (00000000-deca-fade-deca-deafdecacaff)
UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)


Your device supports both HSP (UUID: Headset) and HFP (UUID: Handsfree) so after adding prerequisites you should be able to either use original native backend with HSP or try out HFP.
Back to top
View user's profile Send private message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 523
Location: Connecticut, USA

PostPosted: Thu Mar 04, 2021 12:07 am    Post subject: Reply with quote

I did follow the wiki,
zgrep RFCOMM /proc/config.gz:
#CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
Besides, if I missed RFCOMM, would the headset work at all, even for output? Could any of the features I have set that are not shown enabled in the wiki actaully interfere? I'll be glad to post more of my .config if it would help. The headset plays audio fine with either profile, but I never see the headset under Input Devices in pulseaudio (either current stable, 14.2 with patches, or git master). The patched version of pulse shows different profiles for HSP and HFP, but both Unavailable, the other versions show just a single HSP/HFP profile, but no input device shows up for any of them. I don't use alsa, but only pulseaudio.

I did find some posts indicating that some bluetooth dongles identifying as Cambridge Silicon Radio are fakes and don't work right, but the patch in that post seems to be included in my current kernel 5.11.2, with no problems seen in dmesg. lsusb shows "Bus 001 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)"

I still see a lot of "socket(STREAM, RFCOMM): Protocol not supported (93)" in /var/log/messages, so I agree something could be missing or misconfigured in the kernel, but I can't find what it might be. I see that error number in two kernel files: include/uapi/asm-generic/errno.h and tools/include/uapi/asm-generic/errno.h (identical files) but that doesn't say where they are used.
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1931

PostPosted: Thu Mar 04, 2021 4:50 am    Post subject: Reply with quote

Has anyone tried PipeWire? Supposedly it has HFP support.

I don't have the need right now since Pali's patch works for me, but PipeWire seems like the way forward.
Back to top
View user's profile Send private message
garrison
Apprentice
Apprentice


Joined: 18 Mar 2003
Posts: 250

PostPosted: Thu Mar 04, 2021 5:20 am    Post subject: Reply with quote

genterminl wrote:
I did follow the wiki,
zgrep RFCOMM /proc/config.gz:
#CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y

It should be the reverse, below is an example of how it looks like in menuconfig
Code:

    <*>     RFCOMM protocol support
        [ ]       RFCOMM TTY support

Module also works. Once initialized this would be in dmesg:
Code:
Bluetooth: RFCOMM socket layer initialized


genterminl wrote:
Besides, if I missed RFCOMM, would the headset work at all, even for output?

Yes, A2DP does not use RFCOMM.
Back to top
View user's profile Send private message
garrison
Apprentice
Apprentice


Joined: 18 Mar 2003
Posts: 250

PostPosted: Thu Mar 04, 2021 7:04 am    Post subject: Reply with quote

While pipewire is getting ready.. :)

A bit of improved mic quality using better 16KHz mSBC codec can be tasted using https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/507
Back to top
View user's profile Send private message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 523
Location: Connecticut, USA

PostPosted: Thu Mar 04, 2021 6:01 pm    Post subject: Reply with quote

[cursing]That was a copy/paste error. CONFIG_BT_RFCOMM IS set.[/cursing]I do not see that startup notice in dmesg. I've just restarted bluetooth (openrc) and I don't see any relevant messages in dmesg. I'm recompiling the kernel with bt built in instead of module. I know it shouldn't matter, but we'll see. I do see some bluetooth startup messages in dmesg, but shortly after booting - not on any restart.
Ah - just realized that I needed to remove and reload the bt kernel modules. Still no start message for RFCOMM, only for BNEP, which I've removed in the new config.
I'll wait to try the new kernel, and hunt through the kernel config yet again.

EDIT: after reboot, I do get the RFCOMM initialized (both socket layer and TTY layer) and the HSP/HFP profiles no longer show Unavailable. However, I still don't get any input device in pavucontrol. However, I think that's a big enough improvement (even if I'm not sure why) that I can so some more troubleshooting before asking for more help, although I'm always open to additional suggestions.
Back to top
View user's profile Send private message
garrison
Apprentice
Apprentice


Joined: 18 Mar 2003
Posts: 250

PostPosted: Wed Jul 07, 2021 8:40 pm    Post subject: Reply with quote

genterminl wrote:
[cursing]That was a copy/paste error. CONFIG_BT_RFCOMM IS set.[/cursing]I do not see that startup notice in dmesg. I've just restarted bluetooth (openrc) and I don't see any relevant messages in dmesg. I'm recompiling the kernel with bt built in instead of module. I know it shouldn't matter, but we'll see. I do see some bluetooth startup messages in dmesg, but shortly after booting - not on any restart.
Ah - just realized that I needed to remove and reload the bt kernel modules. Still no start message for RFCOMM, only for BNEP, which I've removed in the new config.
I'll wait to try the new kernel, and hunt through the kernel config yet again.

EDIT: after reboot, I do get the RFCOMM initialized (both socket layer and TTY layer) and the HSP/HFP profiles no longer show Unavailable. However, I still don't get any input device in pavucontrol. However, I think that's a big enough improvement (even if I'm not sure why) that I can so some more troubleshooting before asking for more help, although I'm always open to additional suggestions.

IIRC building CONFIG_BT_RFCOMM=m is a good idea, so it can be loaded by hand if it does not appear automagically. To double-check all is good look for RFCOMM in /proc/net/protocols, if it is not there then HSP/HFP will not work.

For HFP, did you actually tried to switch to HFP profile with pavucontrol, in Configuration tab?
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1931

PostPosted: Sat Oct 09, 2021 7:41 pm    Post subject: Reply with quote

Etal wrote:
Has anyone tried PipeWire? Supposedly it has HFP support.

I don't have the need right now since Pali's patch works for me, but PipeWire seems like the way forward.


I decided to finally give Pipewire a try and it seems to be working well!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum