Hi,

I'm trying to enable HFP on pulseaudio 6.0 using oFono and bluez 5 on a new 
embedded platform which doesn't support alsa yet.
In order to confirm that audio is 'played' I record it using parecord tool. - 
This method worked just fine when enabled a2dp a short time ago.

After executing oFono & pulseaudio, a call is answered on the remote device- It 
is seemed that the relevant profile is chosen on pulseaudio, and parecord fails 
to record.

When executing 'pacmd stat' it seems that
Memory blocks allocated during the whole lifetime: 192, size: 699.9 KiB.
Is constant while pulseaudio prints to terminal the following message along the 
call with relatively fixed intervals:

( 482.106|   0.013) D: [pulseaudio][modules/module-loopback.c:201 
adjust_rates()] Should buffer 96 bytes, buffered at minimum 128 bytes
( 482.118|   0.012) D: [pulseaudio][modules/module-loopback.c:226 
adjust_rates()] [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate to 8000 Hz.
( 482.132|   0.013) D: [pulseaudio][modules/module-loopback.c:197 
adjust_rates()] Loopback overall latency is 610.13 ms + 0.00 ms + 25.00 ms = 
635.13 ms
( 482.146|   0.014) D: [pulseaudio][modules/module-loopback.c:201 
adjust_rates()] Should buffer 96 bytes, buffered at minimum 0 bytes
( 482.159|   0.012) D: [pulseaudio][modules/module-loopback.c:226 
adjust_rates()] [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate to 8000 Hz.
( 492.134|   9.975) D: [pulseaudio][modules/module-loopback.c:197 
adjust_rates()] Loopback overall latency is 610.13 ms + 8.00 ms + 0.00 ms = 
618.13 ms
( 492.148|   0.013) D: [pulseaudio][modules/module-loopback.c:201 
adjust_rates()] Should buffer 96 bytes, buffered at minimum 128 bytes
( 492.161|   0.012) D: [pulseaudio][modules/module-loopback.c:226 
adjust_rates()] [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate to 8000 Hz.
( 492.175|   0.013) D: [pulseaudio][modules/module-loopback.c:197 
adjust_rates()] Loopback overall latency is 610.13 ms + 0.00 ms + 25.00 ms = 
635.13 ms
( 492.189|   0.014) D: [pulseaudio][modules/module-loopback.c:201 
adjust_rates()] Should buffer 96 bytes, buffered at minimum 0 bytes
( 492.201|   0.012) D: [pulseaudio][modules/module-loopback.c:226 
adjust_rates()] [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate to 8000 Hz.
( 502.176|   9.975) D: [pulseaudio][modules/module-loopback.c:197 
adjust_rates()] Loopback overall latency is 610.13 ms + 8.00 ms + 0.00 ms = 
618.13 ms
( 502.190|   0.013) D: [pulseaudio][modules/module-loopback.c:201 
adjust_rates()] Should buffer 96 bytes, buffered at minimum 128 bytes
( 502.202|   0.012) D: [pulseaudio][modules/module-loopback.c:226 
adjust_rates()] [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate to 8000 Hz.
( 502.216|   0.013) D: [pulseaudio][modules/module-loopback.c:197 
adjust_rates()] Loopback overall latency is 610.13 ms + 0.00 ms + 25.00 ms = 
635.13 ms

Please note:
I'm now familer with oFono at all - I simply run it as ofonod -d
Pacmd list output is attached while call is still ongoing. - there are 2 
sources loaded and one sink.

Also, could someone explain why are there two source available? Nexus 4 and 
Nexus 4 monitor?
How can I confirm that the audio arrives at pulseaudio? By the log I would 
assume that the answer is positive, but according to 'pacmd stat' the value it 
seems not.

Thanks for your help,
Eytan.
pulse@OpenWrt:/$ pacmd list
( 580.160|   7.623) I: [pulseaudio][pulsecore/client.c:78 pa_client_new()] 
Created 12 "UNIX socket client"
Memory blocks currently allocated: 3, size: 5.7 KiB.
Memory blocks allocated during the whole lifetime: 192, size: 699.9 KiB.
Memory blocks imported from other processes: 0, size: 0 B.
Memory blocks exported to other processes: 0, size: 0 B.
Total sample cache size: 0 B.
Default sample spec: s16le 2ch 44100Hz
Default channel map: front-left,front-right
Default sink name: bluez_sink.98_D6_F7_34_98_E8
Default source name: bluez_source.98_D6_F7_34_98_E8
Memory blocks of type POOL: 3 allocated/192 accumulated.
Memory blocks of type POOL_EXTERNAL: 0 allocated/0 accumulated.
Memory blocks of type APPENDED: 0 allocated/0 accumulated.
Memory blocks of type USER: 0 allocated/0 accumulated.
Memory blocks of type FIXED: 0 allocated/0 accumulated.
Memory blocks of type IMPORTED: 0 allocated/0 accumulated.
22 module(s) loaded.
    index: 0
        name: <module-device-restore>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically restore the volume/mute 
state of devices"
                module.version = "6.0-dirty"
    index: 1
        name: <module-stream-restore>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically restore the 
volume/mute/device state of streams"
                module.version = "6.0-dirty"
    index: 2
        name: <module-card-restore>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically restore profile of cards"
                module.version = "6.0-dirty"
    index: 3
        name: <module-augment-properties>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Augment the property sets of streams with 
additional static information"
                module.version = "6.0-dirty"
    index: 4
        name: <module-switch-on-port-available>
        argument: <>
        used: -1
        load once: no
        properties:

    index: 5
        name: <module-udev-detect>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Detect available audio hardware and load 
matching drivers"
                module.version = "6.0-dirty"
    index: 6
        name: <module-bluetooth-policy>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Frédéric Dalleau"
                module.description = "When a bluetooth sink or source is added, 
load module-loopback"
                module.version = "6.0-dirty"
    index: 7
        name: <module-bluetooth-discover>
        argument: <headset=ofono>
        used: -1
        load once: yes
        properties:
                module.author = "João Paulo Rechi Vita"
                module.description = "Detect available Bluetooth daemon and 
load the corresponding discovery module"
                module.version = "6.0-dirty"
    index: 8
        name: <module-bluez5-discover>
        argument: <headset=ofono>
        used: -1
        load once: yes
        properties:
                module.author = "João Paulo Rechi Vita"
                module.description = "Detect available BlueZ 5 Bluetooth audio 
devices and load BlueZ 5 Bluetooth audio drivers"
                module.version = "6.0-dirty"
    index: 9
        name: <module-esound-protocol-unix>
        argument: <>
        used: -1
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "ESOUND protocol (UNIX sockets)"
                module.version = "6.0-dirty"
    index: 10
        name: <module-native-protocol-unix>
        argument: <>
        used: -1
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "Native protocol (UNIX sockets)"
                module.version = "6.0-dirty"
    index: 11
        name: <module-default-device-restore>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically restore the default sink 
and source"
                module.version = "6.0-dirty"
    index: 12
        name: <module-rescue-streams>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "When a sink/source is removed, try to 
move its streams to the default sink/source"
                module.version = "6.0-dirty"
    index: 13
        name: <module-always-sink>
        argument: <>
        used: -1
        load once: yes
        pr( 580.200|   0.040) D: [pulseaudio][pulsecore/cli.c:129 
line_callback()] operties:
                module.author = "Colin Guthrie"
                module.description = "Always keeps at least one sink loaded 
even if it's a null one"
                module.version = "6.0-dirty"
    index: 15
        name: <module-intended-roles>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Automatically set device of streams based 
on intended roles of devices"
                module.version = "6.0-dirty"
    index: 16
        name: <module-suspend-on-idle>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "When a sink/source is idle for too long, 
suspend it"
                module.version = "6.0-dirty"
    index: 17
        name: <module-position-event-sounds>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Position event sounds between L and R 
depending on the position on screen of the widget triggering them."
                module.version = "6.0-dirty"
    index: 18
        name: <module-role-cork>
        argument: <>
        used: -1
        load once: yes
        properties:
                module.author = "Lennart Poettering"
                module.description = "Mute & cork streams with certain roles 
while others exist"
                module.version = "6.0-dirty"
    index: 25
        name: <module-bluez5-device>
        argument: <path=/org/bluez/hci0/dev_98_D6_F7_34_98_E8>
        used: 4
        load once: no
        properties:

    index: 27
        name: <module-loopback>
        argument: <sink="bluez_sink.98_D6_F7_34_98_E8" sink_dont_move="true" 
source_output_properties="media.role=phone">
        used: -1
        load once: no
        properties:
                module.author = "Pierre-Louis Bossart"
                module.description = "Loopback from source to sink"
                module.version = "6.0-dirty"
    index: 28
        name: <module-loopback>
        argument: <source="bluez_source.98_D6_F7_34_98_E8" 
source_dont_move="true" sink_input_properties="media.role=phone">
        used: -1
        load once: no
        properties:
                module.author = "Pierre-Louis Bossart"
                module.description = "Loopback from source to sink"
                module.version = "6.0-dirty"
    index: 29
        name: <module-cli-protocol-unix>
        argument: <>
        used: -1
        load once: no
        properties:
                module.author = "Lennart Poettering"
                module.description = "Command line interface protocol (UNIX 
sockets)"
                module.version = "6.0-dirty"
1 sink(s) available.
  * index: 1
        name: <bluez_sink.98_D6_F7_34_98_E8>
        driver: <module-bluez5-device.c>
        flags: HARDWARE DECIBEL_VOLUME LATENCY FLAT_VOLUME
        state: RUNNING
        suspend cause:
        priority: 9030
        volume: mono: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 610.13 ms
        max request: 0 KiB
        max rewind: 0 KiB
        monitor source: 5
        sample spec: s16le 1ch 8000Hz
        channel map: mono
                     Mono
        used by: 2
        linked by: 3
        fixed latency: 128.00 ms
        card: 3 <bluez_card.98_D6_F7_34_98_E8>
        module: 25
        properties:
                bluetooth.protocol = "headset_audio_gateway"
                device.description = "Nexus 4"
                device.string = "98:D6:F7:34:98:E8"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "phone"
                bluez.path = "/org/bluez/hci0/dev_98_D6_F7_34_98_E8"
                bluez.class = "0x5a020c"
                bluez.alias = "Nexus 4"
                device.icon_name = "audio-card-bluetooth"
        ports:
                phone-output: Phone (priority 0, latency offset 0 usec, 
available: yes)
                        properties:

        active port: <phone-output>
2 source(s) available.
    index: 5
        name: <bluez_sink.98_D6_F7_34_98_E8.monitor>
        driver: <module-bluez5-device.c>
        flags: DECIBEL_VOLUME LATENCY
        state: RUNNING
        suspend cause:
        priority: 1030
        volume: mono: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 0.00 ms
        max rewind: 0 KiB
        sample spec: s16le 1ch 8000Hz
        channel map: mono
                     Mono
        used by: 1
        linked by: 1
        fixed latency: 128.00 ms
        monitor_of: 1
        card: 3 <bluez_card.98_D6_F7_34_98_E8>
        module: 25
        properties:
                device.description = "Monitor of Nexus 4"
                device.class = "monitor"
                device.string = "98:D6:F7:34:98:E8"
                device.api = "bluez"
                device.bus = "bluetooth"
                devCLI got EOF from user.
( 580.957|   0.756) ice.form_factor = "phone"
                bluez.path = "/org/bluez/hci0/dev_98_D6_F7_34_98_E8"
                bluez.class = "0x5a020c"
                bluez.alias = "Nexus 4"
                device.icon_name = "audio-card-bluetooth"
  * index: 6
        name: <bluez_source.98_D6_F7_34_98_E8>
        driver: <module-bluez5-device.c>
        flags: HARDWARE DECIBEL_VOLUME LATENCY
        state: RUNNING
        suspend cause:
        priority: 9030
        volume: mono: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 25.00 ms
        max rewind: 0 KiB
        sample spec: s16le 1ch 8000Hz
        channel map: mono
                     Mono
        used by: 1
        linked by: 1
        fixed latency: 28.00 ms
        card: 3 <bluez_card.98_D6_F7_34_98_E8>
        module: 25
        properties:
                bluetooth.protocol = "headset_audio_gateway"
                device.description = "Nexus 4"
                device.string = "98:D6:F7:34:98:E8"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "phone"
                bluez.path = "/org/bluez/hci0/dev_98_D6_F7_34_98_E8"
                bluez.class = "0x5a020c"
                bluez.alias = "Nexus 4"
                device.icon_name = "audio-card-bluetooth"
        ports:
                phone-input: Phone (priority 0, latency offset 0 usec, 
available: yes)
                        properties:

        active port: <phone-input>
1 client(s) logged in.
    index: 12
        driver: <cli.c>
        owner module: 29
        properties:
                application.name = "UNIX socket client"
1 card(s) available.
    index: 3
        name: <bluez_card.98_D6_F7_34_98_E8>
        driver: <module-bluez5-device.c>
        owner module: 25
        properties:
                device.description = "Nexus 4"
                device.string = "98:D6:F7:34:98:E8"
                device.api = "bluez"
                device.class = "sound"
                device.bus = "bluetooth"
                device.form_factor = "phone"
                bluez.path = "/org/bluez/hci0/dev_98_D6_F7_34_98_E8"
                bluez.class = "0x5a020c"
                bluez.alias = "Nexus 4"
                device.icon_name = "audio-card-bluetooth"
        profiles:
                a2dp_source: High Fidelity Capture (A2DP Source) (priority 10, 
available: unknown)
                headset_audio_gateway: Headset Audio Gateway (HSP/HFP) 
(priority 20, available: yes)
                off: Off (priority 0, available: yes)
        active profile: <headset_audio_gateway>
        sinks:
                bluez_sink.98_D6_F7_34_98_E8/#1: Nexus 4
        sources:
                bluez_sink.98_D6_F7_34_98_E8.monitor/#5: Monitor of Nexus 4
                bluez_source.98_D6_F7_34_98_E8/#6: Nexus 4
        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:

2 sink input(s) available.
    index: 4
        driver: <module-loopback.c>
        flags: VARIABLE_RATE DONT_MOVE START_CORKED
        state: RUNNING
        sink: 1 <bluez_sink.98_D6_F7_34_98_E8>
        volume: mono: 65536 / 100% / 0.00 dB
                balance 0.00
        muted: no
        current latency: 8.00 ms
        requested latency: 128.00 ms
        sample spec: s16le 1ch 8000Hz
        channel map: mono
                     Mono
        resample method: speex-fixed-1
        module: 27
        properties:
                media.role = "abstract"
                module-stream-restore.id = "sink-input-by-media-role:abstract"
                media.name = "Loopback from Monitor of Nexus 4"
    index: 5
        driver: <module-loopback.c>
        flags: VARIABLE_RATE START_CORKED
        state: DRAINED
        sink: 1 <bluez_sink.98_D6_F7_34_98_E8>
        volume: mono: 65536 / 100% / 0.00 dB
                balance 0.00
        muted: no
        current latency: 0.00 ms
        requested latency: 128.00 ms
        sample spec: s16le 1ch 8000Hz
        channel map: mono
                     Mono
        resample method: speex-fixed-1
        module: 28
        properties:
                media.role = "phone"
                module-stream-restore.id = "sink-input-by-media-role:phone"
                media.name = "Loopback from Nexus 4"
                media.icon_name = "audio-card-bluetooth"
2 source output(s) available.
    index: 7
        driver: <module-loopback.c>
        flags: START_CORKED
        state: RUNNING
        source: 5 <bluez_sink.98_D6_F7_34_98_E8.monitor>
        volume: mono: 65536 / 100% / 0.00 dB
                balance 0.00
        muted: no
        current latency: 0.00 ms
        requested latency: 128.00 ms
        sample spec: s16le 1ch 8000Hz
        channel map: mono
                     Mono
        resample method: (null)
        owner module: 27
        properties:
                media.role = "phone"
                module-stream-restore.id = "source-output-by-media-role:phone"
                media.name = "Loopback to Nexus 4"
I: [pulseaudio][pulsecore/client.c:100 pa_client_free()] Freed 12 "UNIX socket 
client"          media.icon_name = "audio-card-bluetooth"
    index: 8
        driver: <module-loopback.c>
        flags: DONT_MOVE START_CORKED
        state: RUNNING
        source: 6 <bluez_source.98_D6_F7_34_98_E8>
        volume: mono: 65536 / 100% / 0.00 dB
                balance 0.00
        muted: no
        current latency: 0.00 ms
        requested latency: 28.00 ms
        sample spec: s16le 1ch 8000Hz
        channel map: mono
                     Mono
        resample method: (null)
        owner module: 28
        properties:
                media.role = "abstract"
                module-stream-restore.id = 
"source-output-by-media-role:abstract"
                media.name = "Loopback to Nexus 4"
                media.icon_name = "audio-card-bluetooth"
0 cache entrie(s) available.
_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to