Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pulseaudio: add hsphfpd support #103225

Merged
merged 5 commits into from Nov 11, 2020
Merged

pulseaudio: add hsphfpd support #103225

merged 5 commits into from Nov 11, 2020

Conversation

gebner
Copy link
Member

@gebner gebner commented Nov 9, 2020

Motivation for this change

HFP is a bluetooth protocol used for headsets with microphones. This PR packages an in-progress patch to pulseaudio that supports HFP using the new hsphfpd daemon.

Warning: missing codec support is a big pain point for now. You get microphone support, but only at 8kHz because the mSBC codec is not implemented yet. And pulseaudio-modules-bt doesn't work, so there's no AAC/etc. support.

To enable:

{
hardware.pulseaudio.package = pkgs.pulseaudio-hsphfpd;
hardware.bluetooth.hsphfpd.enable = true;
}

This is a reworked version of #101787. Thanks to @eadwu for doing all the work! cc @jtojnar

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@eadwu
Copy link
Member

eadwu commented Nov 9, 2020

Since audio_client was removed you might want to add an assert for the package to be pulseaudio-hsphfpd. I don't think it affects anything if you use the normal pulseaudio package with hsphfpd activated but HFP probably won't work (I believe? I don't remember exactly).

@gebner
Copy link
Member Author

gebner commented Nov 10, 2020

Since audio_client was removed you might want to add an assert for the package to be pulseaudio-hsphfpd. I don't think it affects anything if you use the normal pulseaudio package with hsphfpd activated but HFP probably won't work (I believe? I don't remember exactly).

As far as I understand, the audio_client.pl script is more of a demo application and not intended for production usage, that's why I removed it. It is easy enough to use the patched pulseaudio server instead. Furthermore, the == pkgs.pulseaudio-hsphfpd check is very brittle (e.g. it fails if you override the pulseaudio-hsphfpd attribute).

AFAICT all combinations of pulseaudio-hsphfpd and hsphfpd should work (and most of them even make sense):

  • Both enabled: then you get full HFP support.
  • None enabled: this is the status quo.
  • Only hsphfpd enabled, but not the patched pulseaudio: this is what you want for pipewire.
  • Patched pulseaudio, but without hsphfpd: this doesn't make too much sense, but it's explicitly supported in the code (see legacy-hsp.c)

@pali
Copy link

pali commented Nov 10, 2020

  • Patched pulseaudio, but without hsphfpd: this doesn't make too much sense, but it's explicitly supported in the code (see legacy-hsp.c)

This make sense too. Original pulseaudio HSP code is buggy. My patches fixes this (legacy) HSP code to work correctly and is loaded when hsphfpd daemon is running. So if you do not need HFP and HSP is enough then you can use pulseaudio also without hsphfpd.

@collares
Copy link
Member

I apologize if this is off-topic, but what would it take to get pulseaudio-modules-bt working? If I understand correctly, pulseaudio-modules-bt in this branch supports FastStream (decent quality microphone voice in the A2DP profile for headsets that support it).

@jtojnar
Copy link
Contributor

jtojnar commented Nov 10, 2020

@collares wiki has a config example. If it does not work, please open a new issue.

@gebner
Copy link
Member Author

gebner commented Nov 10, 2020

@jtojnar pulseaudio-modules-bt doesn't work in the pulseaudio version of this PR because the A2DP codec subsystem of pulseaudio has been significantly changed. Eventually, all the codec support that's now in pulseaudio-modules-bt should probably be included in pulseaudio itself.

@collares
Copy link
Member

Just to give enough context: Pali's branch has added stuff to src/modules/bluetooth ([0]), which is what I thought pulseaudio-modules-bt referred to (because I tried this PR and couldn't get the FastStream support to work). Now I see that pulseaudio-modules-bt is an out-of-tree thing and does not refer to src/modules/bluetooth, apologies for the confusion!

[0] https://gitlab.freedesktop.org/pali/pulseaudio/-/commit/3f3d3a0fb2e4b2ce0068917e3bf4a02612660f67#e8b038a9eb97cdbaef81f7f8ecd437ac1209d48e

@jtojnar
Copy link
Contributor

jtojnar commented Nov 10, 2020

Looks like they might work on upstreaming it after pali’s patches are merged according to EHfive/pulseaudio-modules-bt#1. Hopefully, that will be in PA 15.

@gebner
Copy link
Member Author

gebner commented Nov 11, 2020

I'll merge this PR as all comments have been addressed and this is a change that doesn't cause any rebuilds and shouldn't break anything.

@gebner gebner merged commit 753656b into NixOS:master Nov 11, 2020
@domenkozar
Copy link
Member

Note that @pali has deleted the fork on gitlab.

@gebner
Copy link
Member Author

gebner commented Dec 8, 2020

I am also following the situation... I don't think we should make any rushed decisions. If you're concerned about the dead link in the pulseaudio-hsphfpd package in the meantime, we could change it to my fork instead.

@domenkozar
Copy link
Member

Thanks. @pali did you also work on mSBC codec support?

@edolstra
Copy link
Member

edolstra commented Dec 8, 2020

What's the impact of this on closure size? It looks like it makes pulseaudio depend on gst_all_1.gst-plugins-base, which in turn pulls in Wayland, libGL, X11, ...

@gebner
Copy link
Member Author

gebner commented Dec 8, 2020

The impact on closure size is zero. Applications only depend on the pulseaudio libraries (libpulseaudio), while this is another package providing the pulseaudio server (pulseaudio-hsphfpd). We already have another server version called pulseaudioFull. The default server package is pulseaudio.

@domenkozar
Copy link
Member

domenkozar commented Dec 8, 2020

I'm abusing this PR, but using the following configuration:

{
  hardware.pulseaudio.package = pkgs.pulseaudio-hsphfpd;
  hardware.pulseaudio.enable = true;
  hardware.bluetooth.hsphfpd.enable = true;
  hardware.bluetooth.enable = true;
}
I can observe the following output
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Supported codecs combination on SCO socket by kernel:
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Air codec CVSD with agent codec PCM_s16le_8kHz
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Air codec mSBC with agent codec mSBC
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Registered profile hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Registered profile hsp_hs
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Registered profile hsp_ag
Dec 08 17:12:24 guava hsphfpd.pl[18083]: added: profile_manager=/org/bluez
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Supported air codecs for adapter /org/bluez/hci0:
Dec 08 17:12:24 guava hsphfpd.pl[18083]: ulaw
Dec 08 17:12:24 guava hsphfpd.pl[18083]: alaw
Dec 08 17:12:24 guava hsphfpd.pl[18083]: CVSD
Dec 08 17:12:24 guava hsphfpd.pl[18083]: AuriStream_2bit_8kHz
Dec 08 17:12:24 guava hsphfpd.pl[18083]: AuriStream_2bit_16kHz
Dec 08 17:12:24 guava hsphfpd.pl[18083]: AuriStream_4bit_8kHz
Dec 08 17:12:24 guava hsphfpd.pl[18083]: AuriStream_4bit_16kHz
Dec 08 17:12:24 guava hsphfpd.pl[18083]: mSBC
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Supported agent codecs for adapter /org/bluez/hci0:
Dec 08 17:12:24 guava hsphfpd.pl[18083]: CVSD
Dec 08 17:12:24 guava hsphfpd.pl[18083]: mSBC
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Supported codecs combination for adapter /org/bluez/hci0 by kernel:
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Air codec CVSD with agent codecs: PCM_s16le_8kHz
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Air codec mSBC with agent codecs: mSBC
Dec 08 17:12:24 guava hsphfpd.pl[18083]: added: adapter=/org/bluez/hci0 address=9C:B6:D0:D9:A8:F6
Dec 08 17:12:24 guava hsphfpd.pl[18083]: added: device=/org/bluez/hci0/dev_84_76_37_ED_D8_29 adapter=/org/bluez/hci0 endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf local_address=9C:B6:D0:D9:A8:F6 remote_address=84:76:37:ED:D8:29 profile=hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: New connection: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf profile=hfp_hf device=/org/bluez/hci0/dev_84_76_37_ED_D8_29 fd=6 version=1.7 features=59
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Opening connection for endpoint /org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Supported HF profile features:
Dec 08 17:12:24 guava hsphfpd.pl[18083]: echo-canceling-and-noise-reduction
Dec 08 17:12:24 guava hsphfpd.pl[18083]: three-way-calling
Dec 08 17:12:24 guava hsphfpd.pl[18083]: voice-recognition
Dec 08 17:12:24 guava hsphfpd.pl[18083]: volume-control
Dec 08 17:12:24 guava hsphfpd.pl[18083]: wide-band-speech
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Creating uinput device for endpoint /org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf: FreeBuds 3 (HFP)
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: AT+BRSF=763
Dec 08 17:12:24 guava hsphfpd.pl[18083]: HF features changed event
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Supported HF features:
Dec 08 17:12:24 guava hsphfpd.pl[18083]: codec-negotiation
Dec 08 17:12:24 guava hsphfpd.pl[18083]: echo-canceling-and-noise-reduction
Dec 08 17:12:24 guava hsphfpd.pl[18083]: enhanced-call-control
Dec 08 17:12:24 guava hsphfpd.pl[18083]: enhanced-call-status
Dec 08 17:12:24 guava hsphfpd.pl[18083]: esco-s4-settings
Dec 08 17:12:24 guava hsphfpd.pl[18083]: three-way-calling
Dec 08 17:12:24 guava hsphfpd.pl[18083]: voice-recognition
Dec 08 17:12:24 guava hsphfpd.pl[18083]: volume-control
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: +BRSF: 16383
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: AT+BAC=1,2
Dec 08 17:12:24 guava hsphfpd.pl[18083]: HF codecs changed event
Dec 08 17:12:24 guava hsphfpd.pl[18083]: HF codecs:
Dec 08 17:12:24 guava hsphfpd.pl[18083]: CVSD
Dec 08 17:12:24 guava hsphfpd.pl[18083]: mSBC
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: AT+CIND=?
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Request for list of supported AG indicators
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: +CIND: ("service",(0,1)),("call",(0,1)),("callsetup",(0-3)),("callheld",(0-2)),("signal",(0-5)),("roam",(0,1)),("battchg",(0-5)),("call_setup",(0-3)),("sounder",(0,1)),("message",(0,1)),("vox",(0,1)),("smsfull",(0,1))
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: AT+CIND?
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Request for values of all AG indicators
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: +CIND: 0,0,0,0,0,0,0,0,0,0,0,0
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: AT+CMER=3,0,0,1
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Request for activating reporting of AG indicators
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: AT+CHLD=?
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Request for supported call hold and multiparty services
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: +CHLD: (0,1,1x,2,2x,3,4)
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: AT+VGM=8
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: AT+NREC=0
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Request for disabling of noise reduction and echo canceling
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: AT+XAPL=0A0B-A0B0-0100,1
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Apple features changed event
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Supported Apple features:
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:24 guava hsphfpd.pl[18083]: Line: +XAPL=iPhone,30
Dec 08 17:12:27 guava hsphfpd.pl[18083]: Trying to connect some telephony agent for endpoint /org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:27 guava hsphfpd.pl[18083]: There is no application with telephony agent for role client
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Line: AT+HUAWEIBATTERY=6,2,95,3,0,4,100,5,0,6,75,7,1
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Unknown command
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Line: ERROR
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Line: AT+IPHONEACCEV=1,1,9
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Apple indicators changed event
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Apple battery level changed
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Line: AT+TBSF=?
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Unknown command
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Line: ERROR
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Line: AT+HUAWEIBATTERY=?
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Unknown command
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Line: ERROR
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Line: AT+VGS=7
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Setting tx volume gain to 7
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:28 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:37 guava hsphfpd.pl[18083]: Disconnect connection: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf profile=hfp_hf device=/org/bluez/hci0/dev_84_76_37_ED_D8_29
Dec 08 17:12:37 guava hsphfpd.pl[18083]: Destroying uinput device for endpoint /org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:37 guava hsphfpd.pl[18083]: Closing connection for endpoint /org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: New connection: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf profile=hfp_hf device=/org/bluez/hci0/dev_84_76_37_ED_D8_29 fd=6 version=1.7 features=59
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Opening connection for endpoint /org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Supported HF profile features:
Dec 08 17:12:42 guava hsphfpd.pl[18083]: echo-canceling-and-noise-reduction
Dec 08 17:12:42 guava hsphfpd.pl[18083]: three-way-calling
Dec 08 17:12:42 guava hsphfpd.pl[18083]: voice-recognition
Dec 08 17:12:42 guava hsphfpd.pl[18083]: volume-control
Dec 08 17:12:42 guava hsphfpd.pl[18083]: wide-band-speech
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Creating uinput device for endpoint /org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf: FreeBuds 3 (HFP)
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: AT+BRSF=763
Dec 08 17:12:42 guava hsphfpd.pl[18083]: HF features changed event
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Supported HF features:
Dec 08 17:12:42 guava hsphfpd.pl[18083]: codec-negotiation
Dec 08 17:12:42 guava hsphfpd.pl[18083]: echo-canceling-and-noise-reduction
Dec 08 17:12:42 guava hsphfpd.pl[18083]: enhanced-call-control
Dec 08 17:12:42 guava hsphfpd.pl[18083]: enhanced-call-status
Dec 08 17:12:42 guava hsphfpd.pl[18083]: esco-s4-settings
Dec 08 17:12:42 guava hsphfpd.pl[18083]: three-way-calling
Dec 08 17:12:42 guava hsphfpd.pl[18083]: voice-recognition
Dec 08 17:12:42 guava hsphfpd.pl[18083]: volume-control
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: +BRSF: 16383
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: AT+BAC=1,2
Dec 08 17:12:42 guava hsphfpd.pl[18083]: HF codecs changed event
Dec 08 17:12:42 guava hsphfpd.pl[18083]: HF codecs:
Dec 08 17:12:42 guava hsphfpd.pl[18083]: CVSD
Dec 08 17:12:42 guava hsphfpd.pl[18083]: mSBC
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: AT+CIND=?
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Request for list of supported AG indicators
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: +CIND: ("service",(0,1)),("call",(0,1)),("callsetup",(0-3)),("callheld",(0-2)),("signal",(0-5)),("roam",(0,1)),("battchg",(0-5)),("call_setup",(0-3)),("sounder",(0,1)),("message",(0,1)),("vox",(0,1)),("smsfull",(0,1))
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: AT+CIND?
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Request for values of all AG indicators
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: +CIND: 0,0,0,0,0,0,0,0,0,0,0,0
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: AT+CMER=3,0,0,1
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Request for activating reporting of AG indicators
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: AT+CHLD=?
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Request for supported call hold and multiparty services
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: +CHLD: (0,1,1x,2,2x,3,4)
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: AT+VGM=8
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: AT+NREC=0
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Request for disabling of noise reduction and echo canceling
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: AT+XAPL=0A0B-A0B0-0100,1
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Apple features changed event
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Supported Apple features:
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:42 guava hsphfpd.pl[18083]: Line: +XAPL=iPhone,30
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Trying to connect some telephony agent for endpoint /org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:45 guava hsphfpd.pl[18083]: There is no application with telephony agent for role client
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Line: AT+IPHONEACCEV=1,1,9
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Apple indicators changed event
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Apple battery level changed
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Line: AT+TBSF=?
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Unknown command
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Line: ERROR
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Line: AT+HUAWEIBATTERY=?
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Unknown command
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Line: ERROR
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Line: AT+VGS=7
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:12:45 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:15:13 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:15:13 guava hsphfpd.pl[18083]: Line: AT+IPHONEACCEV=1,1,8
Dec 08 17:15:13 guava hsphfpd.pl[18083]: Apple indicators changed event
Dec 08 17:15:13 guava hsphfpd.pl[18083]: Apple battery level changed
Dec 08 17:15:13 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:15:13 guava hsphfpd.pl[18083]: Line: OK
Dec 08 17:16:08 guava hsphfpd.pl[18083]: Socket ready read: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:16:08 guava hsphfpd.pl[18083]: Line: AT+IPHONEACCEV=1,1,8
Dec 08 17:16:08 guava hsphfpd.pl[18083]: Apple indicators changed event
Dec 08 17:16:08 guava hsphfpd.pl[18083]: Apple battery level changed
Dec 08 17:16:08 guava hsphfpd.pl[18083]: Socket write: endpoint=/org/hsphfpd/hci0/dev_84_76_37_ED_D8_29/hfp_hf
Dec 08 17:16:08 guava hsphfpd.pl[18083]: Line: OK

But pavucontrol still says HSP/HFP unavailable.

@domenkozar
Copy link
Member

pulseaudio -k saves the day.

@bobvanderlinden
Copy link
Member

telephony_client from this PR doesn't make sense. It results in telephone_client systemd service to always fail. This is because of this line:

https://github.com/pali/hsphfpd-prototype/blob/d294d064879591e9570ca3f444fa3eee2f269df8/telephony_client.pl#L8

It might be better to remove the service until there is an alternative that does actual UI things.

@eadwu
Copy link
Member

eadwu commented Feb 23, 2021

Simple example of telephony agent which automatically accepts all incoming
calls is in file telephony_client.pl. To start this example, just run:

  ./telephony_client.pl

Telephony agent can be started or stopped at any time, hsphfd will take care
to properly initialize connection even if agent is started after HFP connection
is already setup.

May be useless in functionality but I'm pretty sure it's some required(?) part of the stack. It shouldn't be failing, or at least it didn't while I used it.

@bobvanderlinden
Copy link
Member

I made an issue to further discuss the (potential) issue: #114222

It might include required parts of the stack, but currently it seems it is doing nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants