HFP 与 ofono-phonesim 一起使用,并以手机作为音频网关?

HFP 与 ofono-phonesim 一起使用,并以手机作为音频网关?

简而言之,从ofono-phonesim调制解调器的角度来看,事情似乎不错,但我仍然无法让 HFP 音频电话用于通话(同时 A2DP 可以完美地用于音乐播放)。

我在 Ubuntu 20.04 Focal Fossa,arm64 上。

这是我的先前的问题。它可能看起来像是这个问题但是,我的用例恰恰相反,因为我试图使用 Linux 机器的 USB 外围设备(15 美元的麦克风和 15 美元的扬声器条)作为耳机单元角色,并使用移动设备作为音频网关。

此外,我已经尝试了最佳答案,特别是到目前为止的所有内容:

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

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

/ofono/test$ ./enable-modem

并且从调制解调器的角度来看似乎没什么问题,但是我仍然听不到电话音频,当我尝试手动将智能手机设置为耳机音频网关(HSP/HFP)时,我在 blueman 中收到“无法将配置文件更改为耳机音频网关”的信息。

以下是 ~/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似乎只提供与 A2DP 相关的有用信息。

有什么想法吗?有人用手机将其用作音频网关吗?

编辑: 在 blueman 中尝试手动切换到 HFP 后cat /var/log/syslog* | grep -i pulse显示。[datetime][machine] pulseaudio[839]: Refused to switch profile to headset_audio_gateway: Not connected

2022 年 2 月 24 日更新: 所以我意识到我已经headset=native在 /etc/pulse/default.pa 中进行了设置,这是从我之前的一些测试中得出的,当时我试图确保使用 HSP 而不是 HFP。所以现在我已经设置好了,headset=ofono当我切换到 HFP 时,我不再收到错误消息“无法将配置文件更改为 earphone_audio_gateway”。

输出自$ 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:

所以至少我明白了earphone_audio_gateway:耳机音频网关(HSP/HFP)(优先级 10,可用:是)现在。现在的问题是,我似乎可以切换到 HSP/HFP,但仍然没有声音。这与我在安装 ofono 和 ofono-phonesim 之前使用 HSP 得到的结果相同。

来自的最后一条新信息cat /var/log/syslog* | grep -i pulsepulseaudio[882]: Deferred setup faild on fd -1: Transport endpoint is not connected。不确定这是什么意思或者是否相关,但看起来像是一个新的错误。

相关内容