Score:1

HFP with ofono-phonesim with phone as Audio Gateway?

cn flag

in a nutshell, things seem to be good from the ofono-phonesim perspective in terms of modems, but I still can't get HFP audio telephony to work for calls (meanwhile A2DP works flawlessly for music playback).

I'm on Ubuntu 20.04 Focal Fossa, arm64.

This is a follow up to my earlier question. It may seem to be a duplicate of this question but, my use case is the opposite, as I'm trying to use the Linux machine's USB peripherals ($15 mic and $15 speaker bar) as the Headset Unit role, and a mobile device as the Audio Gateway.

Additionally, I've attempted the top answer, specifically everything up to this point:

ofono-phonesim -p 12345 /usr/share/phonesim/default.xml

with

dbus-send --print-reply --system --dest=org.ofono /phonesim org.ofono.Modem.SetProperty string:"Powered" variant:boolean:"true"

and

/ofono/test$ ./enable-modem

and it looks like I'm good from a modem perpective, however I still get no audio for telephony, and I get "Failed to change profile to headset_audio_gateway" in blueman when i try to set the Smart Phone to Headset Audio Gateway (HSP/HFP) manually.

Here's the output for ~/ofono/test/list-modems:

user@machine:~/dir$ ofono-phonesim -p 12345 /usr/share/phonesim/default.xml&
[2] 6834
user@machine:~/dir$ dbus-send --print-reply --system --dest=org.ofono /phonesim org.ofono.Modem.SetProperty string:"Powered" variant:boolean:"true"
method return time=1645567249.694253 sender=:1.163 -> destination=:1.166 serial=33 reply_serial=2

user@machine:~/dir/ofono/test$ ./enable-modem /hfp/org/bluez/hci0/dev_E0_D0_83_93_CC_5A
Connecting modem /hfp/org/bluez/hci0/dev_E0_D0_83_93_CC_5A...
user@machine:~/dir/ofono/test$ test/list-modems
bash: test/list-modems: No such file or directory
user@machine:~/dir/ofono/test$ ./list-modems
[ /hfp/org/bluez/hci0/dev_E0_D0_83_93_CC_5A ]
    Online = 1
    Powered = 1
    Lockdown = 0
    Emergency = 0
    Serial = E0:D0:83:93:CC:5A
    Interfaces = org.ofono.VoiceCallManager org.ofono.CallVolume org.ofono.Handsfree org.ofono.NetworkRegistration 
    Features = net 
    Name = enwave64's Note10
    Type = hfp
    [ org.ofono.VoiceCallManager ]
        EmergencyNumbers = 118 110 08 911 000 112 999 119 
    [ org.ofono.CallVolume ]
        SpeakerVolume = 50
        MicrophoneVolume = 50
        Muted = 0
    [ org.ofono.Handsfree ]
        InbandRinging = 1
        EchoCancelingNoiseReduction = 1
        DistractedDrivingReduction = 0
        VoiceRecognition = 0
        Features = three-way-calling echo-canceling-and-noise-reduction voice-recognition release-all-held release-specified-active-call private-chat create-multiparty hf-indicators 
        BatteryChargeLevel = 2
    [ org.ofono.NetworkRegistration ]
        Status = registered
        Mode = auto-only
        Name = 
        Strength = 40

[ /phonesim ]
    Online = 0
    Powered = 1
    Lockdown = 0
    Emergency = 0
    Manufacturer = MeeGo
    Model = Synthetic Device
    Revision = REV1
    Serial = 1234567890
    Interfaces = org.ofono.SmartMessaging org.ofono.PushNotification org.ofono.MessageManager org.ofono.Phonebook org.ofono.TextTelephony org.ofono.RadioSettings org.ofono.CallForwarding org.ofono.SimToolkit org.ofono.SimAuthentication org.ofono.AllowedAccessPoints org.ofono.VoiceCallManager org.ofono.SimManager 
    Features = sms tty rat stk sim 
    Type = hardware
    [ org.ofono.SmartMessaging ]
    [ org.ofono.PushNotification ]
    [ org.ofono.MessageManager ]
        ServiceCenterAddress = +15551234567
        UseDeliveryReports = 0
        Bearer = cs-preferred
        Alphabet = default
    [ org.ofono.Phonebook ]
    [ org.ofono.TextTelephony ]
        Enabled = 1
    [ org.ofono.RadioSettings ]
        TechnologyPreference = any
        AvailableTechnologies = gsm umts lte 
    [ org.ofono.CallForwarding ]
        VoiceUnconditional = 
        VoiceBusy = 
        VoiceNoReply = 
        VoiceNoReplyTimeout = 20
        VoiceNotReachable = 
        ForwardingFlagOnSim = 0
    [ org.ofono.SimToolkit ]
        IdleModeText = 
        IdleModeIcon = 
        MainMenuTitle = 
        MainMenuIcon = 
        MainMenu = 
    [ org.ofono.SimAuthentication ]
        NetworkAccessIdentity = [email protected]
    [ org.ofono.AllowedAccessPoints ]
    [ org.ofono.VoiceCallManager ]
        EmergencyNumbers = 911 1020 112 
    [ org.ofono.SimManager ]
        Present = 1
        CardIdentifier = 8949222074451242066
        SubscriberIdentity = 246813579
        ImsPrivateIdentity = [email protected]
        FixedDialing = 0
        BarredDialing = 0
        MobileCountryCode = 246
        MobileNetworkCode = 81
        SubscriberNumbers = 358501234567 
        LockedPins = 
        ServiceNumbers = [112] = '112' [Emergency] = '999' [Police] = '997' [Firemen] = '998' [Sea emergency] = '+48601100100' [Mountain emer.] = '+48601100300' [.HELP DESK] = '2601' [.RECHARGE] = '5555' [.Voicemail] = '+48601222222' [.Voice access] = '+48601104444' 
        PreferredLanguages = de en it fr es nl 
        PinRequired = none
        Retries = [pin = 3] 
        CardSlotCount = 1
        ActiveCardSlot = 1

bluetoothd only seems to give useful info related to A2DP.

Any ideas? Has anyone gotten this to work with the phone as the Audio Gateway?

edit: cat /var/log/syslog* | grep -i pulse shows [datetime][machine] pulseaudio[839]: Refused to switch profile to headset_audio_gateway: Not connected after attempting to switch to HFP manually in blueman.

Update Feb 24 2022: So I realized that I had headset=native set in /etc/pulse/default.pa, from some earlier testing where I was trying to ensure HSP instead of HFP. So now that i've set headset=ofono I'm no longer getting an error message "Failed to change profile to headset_audio_gateway" when I switch to HFP.

output from $ pacmd list-cards:

index: 4
        name: <bluez_card.E0_D0_83_93_CC_5A>
        driver: <module-bluez5-device.c>
        owner module: 28
        properties:
                device.description = "enwave64's Note10"
                device.string = "E0:D0:83:93:CC:5A"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "phone"
                bluez.path = "/org/bluez/hci0/dev_E0_D0_83_93_CC_5A"
                bluez.class = "0x5a020c"
                bluez.alias = "enwave64's Note10"
                device.icon_name = "audio-card-bluetooth"
        profiles:
                headset_head_unit: Headset Head Unit (HSP/HFP) (priority 30, available: no)
                a2dp_source: High Fidelity Capture (A2DP Source) (priority 20, available: unknown)
                headset_audio_gateway: Headset Audio Gateway (HSP/HFP) (priority 10, available: yes)
                off: Off (priority 0, available: yes)
        active profile: <headset_audio_gateway>
        sinks:
                bluez_sink.E0_D0_83_93_CC_5A.headset_audio_gateway/#7: enwave64's Note10
        sources:
                bluez_sink.E0_D0_83_93_CC_5A.headset_audio_gateway.monitor/#17: Monitor of enwave64's Note10
                bluez_source.E0_D0_83_93_CC_5A.headset_audio_gateway/#18: enwave64's Note10
        ports:
                phone-output: Phone (priority 0, latency offset 0 usec, available: yes)
                        properties:

                phone-input: Phone (priority 0, latency offset 0 usec, available: yes)
                        properties:

So at least I see headset_audio_gateway: Headset Audio Gateway (HSP/HFP) (priority 10, available: yes) now. Now the issue is it seems like I can switch to HSP/HFP okay, but I'm still getting silence. This was the same result I would get with HSP before installing ofono & ofono-phonesim.

last piece of new info from cat /var/log/syslog* | grep -i pulse: pulseaudio[882]: Deferred setup faild on fd -1: Transport endpoint is not connected. Not exactly sure what this means or if it's relevant but looks to be a new error.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.