[pulseaudio-discuss] Sound recording/routing issues on Librem5

Angus Ainslie angus at akkea.ca
Thu Nov 28 23:44:42 UTC 2019


Hi,

On the librem5 phone I'm having problems getting the audio routed from 
the modem to the codec.

The modem source is displaying a couple of odd behaviours. Here are the 
modem sources

     index: 0
         name: <alsa_output.platform-sound-wwan.stereo-fallback.monitor>
         driver: <module-alsa-card.c>
         flags: DECIBEL_VOLUME LATENCY
         state: SUSPENDED
         suspend cause: IDLE
         priority: 1000
         volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 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 2ch 48000Hz
         channel map: front-left,front-right
                      Stereo
         used by: 0
         linked by: 0
         fixed latency: 100.00 ms
         monitor_of: 0
         card: 0 <alsa_card.platform-sound-wwan>
         module: 6
         properties:
                 device.description = "Monitor of Built-in Audio Stereo"
                 device.class = "monitor"
                 alsa.card = "0"
                 alsa.card_name = "MODEM"
                 alsa.long_card_name = "MODEM"
                 device.bus_path = "platform-sound-wwan"
                 sysfs.path = "/devices/platform/sound-wwan/sound/card0"
                 device.form_factor = "internal"
                 device.string = "0"
                 module-udev-detect.discovered = "1"
                 device.icon_name = "audio-card"
     index: 1
         name: <alsa_input.platform-sound-wwan.stereo-fallback>
         driver: <module-alsa-card.c>
         flags: HARDWARE DECIBEL_VOLUME LATENCY
         state: SUSPENDED
         suspend cause: IDLE
         priority: 9000
         volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 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 2ch 48000Hz
         channel map: front-left,front-right
                      Stereo
         used by: 0
         linked by: 1
         fixed latency: 100.00 ms
         card: 0 <alsa_card.platform-sound-wwan>
         module: 6
         properties:
                 alsa.resolution_bits = "16"
                 device.api = "alsa"
                 device.class = "sound"
                 alsa.class = "generic"
                 alsa.subclass = "generic-mix"
                 alsa.name = ""
                 alsa.id = "30030000.sai-gtm601 gtm601-0"
                 alsa.subdevice = "0"
                 alsa.subdevice_name = "subdevice #0"
                 alsa.device = "0"
                 alsa.card = "0"
                 alsa.card_name = "MODEM"
                 alsa.long_card_name = "MODEM"
                 device.bus_path = "platform-sound-wwan"
                 sysfs.path = "/devices/platform/sound-wwan/sound/card0"
                 device.form_factor = "internal"
                 device.string = "hw:0"
                 device.buffering.buffer_size = "19200"
                 device.buffering.fragment_size = "4800"
                 device.access_mode = "mmap"
                 device.profile.name = "stereo-fallback"
                 device.profile.description = "Stereo"
                 device.description = "Built-in Audio Stereo"
                 module-udev-detect.discovered = "1"
                 device.icon_name = "audio-card"
         ports:
                 analog-input: Analog Input (priority 10000, latency 
offset 0 usec, available: unknown)
                         properties:

         active port: <analog-input>

If I use parecord to record from alsa_card.platform-sound-wwan I get the 
audio from the modem.

If I use parecord to record from 
alsa_output.platform-sound-wwan.stereo-fallback.monitor I don't get any 
audio from the call until it disconnects.

Our application is grabbing the first source from alsa.card_name = 
"MODEM" and is showing the same behaviour as parecord.

Is there a way to disable the monitor source or possibly reorder the 
sources ?

I tried remapping the source and sink but I can't record from that 
either.

load-module module-remap-source source_name=Modem 
master=alsa_input.platform-sound-wwan.stereo-fallback
load-module module-remap-sink sink_name=Modem 
master=alsa_output.platform-sound-wwan.stereo-fallback

The modem sink is passing audio so that's good. The issue with the sink 
is there is about 3 seconds of latency. I can see ~1 second of that due 
to the cellular network.

How would I check the latency through pulseaudio ?

Thanks
Angus


More information about the pulseaudio-discuss mailing list