NixOS: No sound in calls - missing modem source and sink

I’m succesfully running NixOS on my Librem 5 save for one thing: I do not have sound in calls.

The issue seems to be that the modem source and sink are missing. When I call my voicemail:

$ journalctl -fu dbus-:1.2-org.mobian_project.CallAudio@1.service --user
l5 callaudiod[2190]: card has no voice profile and no usable sink
l5 callaudiod[2190]: card has no voice profile and no usable sink
l5 callaudiod[2190]: card has no usable source
l5 callaudiod[2190]: card has no voice profile and no usable sink

Under Settings -> Sound, the modem seems indeed missing:

I’m running pipewire with pulse support. From what I’ve read so far I seem to understand that some dbus configuration is needed to make callaudiod aware of the modem source and sink. This is all very new to me though. I’ve tried to search for a PureOS Librem 5 package that contains the required configuration.

Can someone maybe point me into the right direction?

6 Likes

Getting to know pipewire and wireplumber a bit more, the above is actually incorrect. I still haven’t figured out why I do not have sound in calls, but at least the modem source and sink are available, listed as Analog Input and Analog Output.

I’ll paste the lot here in the hope someone sees something I’m missing, and for future reference.

[ookhoi@l5:~]$ journalctl -u dbus-:1.2-org.mobian_project.CallAudio@1.service --user -S today
May 02 12:17:08 l5 systemd[1116]: Started dbus-:1.2-org.mobian_project.CallAudio@1.service.
May 02 12:17:08 l5 callaudiod[2086]: Card 'alsa_card.platform-sound-hdmi' lacks speaker and/or earpiece port, skipping...
May 02 12:17:08 l5 callaudiod[2086]: no available input found!

=

[ookhoi@l5:~]$ wpctl status
PipeWire 'pipewire-0' [0.3.70, ookhoi@l5, cookie:3826210671]
 └─ Clients:
        31. pipewire                            [0.3.70, ookhoi@l5, pid:1417]
        32. Phone Shell Volume Control          [0.3.70, ookhoi@l5, pid:1390]
        34. WirePlumber                         [0.3.70, ookhoi@l5, pid:1418]
        35. WirePlumber [export]                [0.3.70, ookhoi@l5, pid:1418]
        72. GNOME Volume Control Media Keys     [0.3.70, ookhoi@l5, pid:1723]
        73. .xdg-desktop-portal-wrapped         [0.3.70, ookhoi@l5, pid:1949]
        74. CallAudio                           [0.3.70, ookhoi@l5, pid:2086]
        75. wpctl                               [0.3.70, ookhoi@l5, pid:2970]

Audio
 ├─ Devices:
 │      45. Built-in Audio                      [alsa]
 │      46. Built-in Audio                      [alsa]
 │      47. Built-in Audio                      [alsa]
 │
 ├─ Sinks:
 │  *   56. Built-in Audio Stereo               [vol: 1.00]
 │      58. Built-in Audio Stereo               [vol: 1.00]
 │      59. Built-in Audio Stereo               [vol: 0.97]
 │
 ├─ Sink endpoints:
 │
 ├─ Sources:
 │      57. Built-in Audio Stereo               [vol: 1.00]
 │  *   60. Built-in Audio Stereo               [vol: 1.00]
 │
 ├─ Source endpoints:
 │
 └─ Streams:

Video
 ├─ Devices:
 │      41. imx-capture                         [v4l2]
 │      42. imx-capture                         [v4l2]
 │      43. nxp,imx8mq-vpu-g1-dec               [v4l2]
 │      44. nxp,imx8mq-vpu-g2-dec               [v4l2]
 │
 ├─ Sinks:
 │
 ├─ Sink endpoints:
 │
 ├─ Sources:
 │      48. imx-capture (V4L2)
 │      50. imx-capture (V4L2)
 │
 ├─ Source endpoints:
 │
 └─ Streams:

Settings
 └─ Default Configured Node Names:
         0. Audio/Sink    alsa_output.platform-sound.stereo-fallback
         1. Audio/Source  alsa_input.platform-sound.stereo-fallback

=

[ookhoi@l5:~]$ wpctl inspect 59
id 59, type PipeWire:Interface:Node
    alsa.card = "1"
    alsa.card_name = "Modem"
    alsa.class = "generic"
    alsa.device = "0"
    alsa.driver_name = "snd_soc_simple_card"
    alsa.id = "30030000.sai-bm818 bm818-0"
    alsa.long_card_name = "Modem"
    alsa.name = "30030000.sai-bm818 bm818-0"
    alsa.resolution_bits = "16"
    alsa.subclass = "generic-mix"
    alsa.subdevice = "0"
    alsa.subdevice_name = "subdevice #0"
    api.alsa.card.longname = "Modem"
    api.alsa.card.name = "Modem"
    api.alsa.path = "hw:1"
    api.alsa.pcm.card = "1"
    api.alsa.pcm.stream = "playback"
    audio.adapt.follower = ""
    audio.channels = "2"
    audio.position = "FL,FR"
    card.profile.device = "3"
  * client.id = "35"
    clock.quantum-limit = "8192"
    device.api = "alsa"
    device.class = "sound"
  * device.id = "47"
    device.profile.description = "Stereo"
    device.profile.name = "stereo-fallback"
    device.routes = "1"
  * factory.id = "18"
    factory.mode = "merge"
    factory.name = "api.alsa.pcm.sink"
    library.name = "audioconvert/libspa-audioconvert"
  * media.class = "Audio/Sink"
  * node.description = "Built-in Audio Stereo"
    node.driver = "true"
  * node.name = "alsa_output.platform-sound-wwan.stereo-fallback"
  * node.nick = "30030000.sai-bm818 bm818-0"
    node.pause-on-idle = "false"
  * object.path = "alsa:pcm:1:hw:1:playback"
  * object.serial = "60"
  * priority.driver = "1000"
  * priority.session = "1000"

=

[ookhoi@l5:~]$ wpctl inspect 60
id 60, type PipeWire:Interface:Node
    alsa.card = "1"
    alsa.card_name = "Modem"
    alsa.class = "generic"
    alsa.device = "0"
    alsa.driver_name = "snd_soc_simple_card"
    alsa.id = "30030000.sai-bm818 bm818-0"
    alsa.long_card_name = "Modem"
    alsa.name = "30030000.sai-bm818 bm818-0"
    alsa.resolution_bits = "16"
    alsa.subclass = "generic-mix"
    alsa.subdevice = "0"
    alsa.subdevice_name = "subdevice #0"
    api.alsa.card.longname = "Modem"
    api.alsa.card.name = "Modem"
    api.alsa.path = "hw:1"
    api.alsa.pcm.card = "1"
    api.alsa.pcm.stream = "capture"
    audio.adapt.follower = ""
    audio.channels = "2"
    audio.position = "FL,FR"
    card.profile.device = "2"
  * client.id = "35"
    clock.quantum-limit = "8192"
    device.api = "alsa"
    device.class = "sound"
  * device.id = "47"
    device.profile.description = "Stereo"
    device.profile.name = "stereo-fallback"
    device.routes = "1"
  * factory.id = "18"
    factory.mode = "split"
    factory.name = "api.alsa.pcm.source"
    library.name = "audioconvert/libspa-audioconvert"
  * media.class = "Audio/Source"
  * node.description = "Built-in Audio Stereo"
    node.driver = "true"
  * node.name = "alsa_input.platform-sound-wwan.stereo-fallback"
  * node.nick = "30030000.sai-bm818 bm818-0"
    node.pause-on-idle = "false"
  * object.path = "alsa:pcm:1:hw:1:capture"
  * object.serial = "61"
  * priority.driver = "2000"
  * priority.session = "2000"

=

[ookhoi@l5:~]$ diff -ruN 59 60
--- 59  2023-05-02 12:59:15.341980400 +0200
+++ 60  2023-05-02 12:59:19.866090761 +0200
@@ -1,4 +1,4 @@
-id 59, type PipeWire:Interface:Node
+id 60, type PipeWire:Interface:Node
     alsa.card = "1"
     alsa.card_name = "Modem"
     alsa.class = "generic"
@@ -15,11 +15,11 @@
     api.alsa.card.name = "Modem"
     api.alsa.path = "hw:1"
     api.alsa.pcm.card = "1"
-    api.alsa.pcm.stream = "playback"
+    api.alsa.pcm.stream = "capture"
     audio.adapt.follower = ""
     audio.channels = "2"
     audio.position = "FL,FR"
-    card.profile.device = "3"
+    card.profile.device = "2"
   * client.id = "35"
     clock.quantum-limit = "8192"
     device.api = "alsa"
@@ -29,16 +29,16 @@
     device.profile.name = "stereo-fallback"
     device.routes = "1"
   * factory.id = "18"
-    factory.mode = "merge"
-    factory.name = "api.alsa.pcm.sink"
+    factory.mode = "split"
+    factory.name = "api.alsa.pcm.source"
     library.name = "audioconvert/libspa-audioconvert"
-  * media.class = "Audio/Sink"
+  * media.class = "Audio/Source"
   * node.description = "Built-in Audio Stereo"
     node.driver = "true"
-  * node.name = "alsa_output.platform-sound-wwan.stereo-fallback"
+  * node.name = "alsa_input.platform-sound-wwan.stereo-fallback"
   * node.nick = "30030000.sai-bm818 bm818-0"
     node.pause-on-idle = "false"
-  * object.path = "alsa:pcm:1:hw:1:playback"
-  * object.serial = "60"
-  * priority.driver = "1000"
-  * priority.session = "1000"
+  * object.path = "alsa:pcm:1:hw:1:capture"
+  * object.serial = "61"
+  * priority.driver = "2000"
+  * priority.session = "2000"

=

[ookhoi@l5:~]$ pw-dump 47
  {
    "id": 47,
    "type": "PipeWire:Interface:Device",
    "version": 3,
    "permissions": [ "r", "w", "x", "m" ],
    "info": {
      "change-mask": [ "props", "params" ],
      "props": {
        "alsa.card": 1,
        "alsa.card_name": "Modem",
        "alsa.driver_name": "snd_soc_simple_card",
        "alsa.long_card_name": "Modem",
        "api.acp.auto-port": false,
        "api.acp.auto-profile": false,
        "api.alsa.card": 1,
        "api.alsa.card.longname": "Modem",
        "api.alsa.card.name": "Modem",
        "api.alsa.path": "hw:1",
        "api.alsa.use-acp": true,
        "api.dbus.ReserveDevice1": "Audio1",
        "client.id": 35,
        "device.api": "alsa",
        "device.bus-path": "platform-sound-wwan",
        "device.description": "Built-in Audio",
        "device.enum.api": "udev",
        "device.form-factor": "internal",
        "device.icon-name": "audio-card-analog",
        "device.name": "alsa_card.platform-sound-wwan",
        "device.nick": "Modem",
        "device.plugged.usec": 16047081,
        "device.string": 1,
        "device.subsystem": "sound",
        "device.sysfs.path": "/devices/platform/sound-wwan/sound/card1",
        "factory.id": 14,
        "media.class": "Audio/Device",
        "object.id": 47,
        "object.path": "alsa:pcm:1",
        "object.serial": 48
      },
      "params": {
        "EnumProfile": [
          {
            "index": 0,
            "name": "off",
            "description": "Off",
            "priority": 0,
            "available": "yes",
            "classes": [
              0
            ]
          },
          {
            "index": 1,
            "name": "output:stereo-fallback+input:stereo-fallback",
            "description": "Stereo Output + Stereo Input",
            "priority": 5151,
            "available": "unknown",
            "classes": [
              2,
              [
                "Audio/Source",
                1,
                "card.profile.devices",
                [ 2 ]
              ],
              [
                "Audio/Sink",
                1,
                "card.profile.devices",
                [ 3 ]
              ]
            ]
          },
          {
            "index": 2,
            "name": "output:stereo-fallback",
            "description": "Stereo Output",
            "priority": 5100,
            "available": "unknown",
            "classes": [
              1,
              [
                "Audio/Sink",
                1,
                "card.profile.devices",
                [ 3 ]
              ]
            ]
          },
          {
            "index": 3,
            "name": "input:stereo-fallback",
            "description": "Stereo Input",
            "priority": 51,
            "available": "unknown",
            "classes": [
              1,
              [
                "Audio/Source",
                1,
                "card.profile.devices",
                [ 2 ]
              ]
            ]
          },
          {
            "index": 4,
            "name": "pro-audio",
            "description": "Pro Audio",
            "priority": 1,
            "available": "yes",
            "classes": [
              2,
              [
                "Audio/Source",
                1,
                "card.profile.devices",
                [ 1 ]
              ],
              [
                "Audio/Sink",
                1,
                "card.profile.devices",
                [ 0 ]
              ]
            ]
          }
        ],
        "Profile": [
          {
            "index": 1,
            "name": "output:stereo-fallback+input:stereo-fallback",
            "description": "Stereo Output + Stereo Input",
            "priority": 5151,
            "available": "unknown",
            "classes": [
              2,
             [
                "Audio/Source",
                1,
                "card.profile.devices",
                [ 2 ]
              ],
              [
                "Audio/Sink",
                1,
                "card.profile.devices",
                [ 3 ]
              ]
            ],
            "save": false
          }
        ],
        "EnumRoute": [
          {
            "index": 0,
            "direction": "Input",
            "name": "analog-input",
            "description": "Analog Input",
            "priority": 10000,
            "available": "unknown",
            "info": [
              2,
              "port.type",
              "analog",
              "card.profile.port",
              "0"
            ],
            "profiles": [ 3, 1 ],
            "devices": [ 2 ]
          },
          {
            "index": 1,
            "direction": "Output",
            "name": "analog-output",
            "description": "Analog Output",
            "priority": 9900,
            "available": "unknown",
            "info": [
              2,
              "port.type",
              "analog",
              "card.profile.port",
              "1"
            ],
            "profiles": [ 2, 1 ],
            "devices": [ 3 ]
          }
        ],
        "Route": [
          {
            "index": 0,
            "direction": "Input",
            "name": "analog-input",
            "description": "Analog Input",
            "priority": 10000,
            "available": "unknown",
            "info": [
              4,
              "port.type",
              "analog",
              "card.profile.port",
              "0",
              "route.hw-mute",
              "false",
              "route.hw-volume",
              "false"
            ],
            "profiles": [ 3, 1 ],
            "device": 2,
            "props": {
              "mute": false,
              "channelVolumes": [ 1.000000, 1.000000 ],
              "volumeBase": 1.000000,
              "volumeStep": 0.000015,
              "channelMap": [ "FL", "FR" ],
              "softVolumes": [ 1.000000, 1.000000 ],
              "latencyOffsetNsec": 0
            },
            "devices": [ 2 ],
            "profile": 1,
            "save": true
          },
          {
            "index": 1,
            "direction": "Output",
            "name": "analog-output",
            "description": "Analog Output",
            "priority": 9900,
            "available": "unknown",
            "info": [
              4,
              "port.type",
              "analog",
              "card.profile.port",
              "1",
              "route.hw-mute",
              "false",
              "route.hw-volume",
              "false"
            ],
            "profiles": [ 2, 1 ],
            "device": 3,
            "props": {
              "mute": false,
              "channelVolumes": [ 0.923096, 1.000000 ],
              "volumeBase": 1.000000,
              "volumeStep": 0.000015,
              "channelMap": [ "FL", "FR" ],
              "softVolumes": [ 0.923096, 1.000000 ],
              "latencyOffsetNsec": 0
            },
            "devices": [ 3 ],
            "profile": 1,
            "save": true
          }
        ]
      }
    }
  }
1 Like

Did you continue with this at all? Ive been exploring NixOS lately and am curious how it would play out on the Librem5.

2 Likes

My thoughts, as well. I haven’t played with NixOS or Nix the package manager, but reading and podcasts are making me wish that Purism would adopt the package manager on PureOS. Sure would be nice to try out a new config or flake and be able to revert easily and reliably.

2 Likes

If you want to try NixOS on the Librem 5, this nixos-hardware/purism/librem/5r4 at master · NixOS/nixos-hardware · GitHub (as linked on LINMOB.net - Resources :wink: ) is likely the best starting point.

More resources I could find are

Hope that helps, while I am writing this from a NixOS machine, I have not have found the time to play with this on a smartphone.

Yes, this would be nice; although I guess if FSF approval is still something Purism are going for, Guix is a much more likely candidate.

4 Likes

Last month I’ve tried to install NixOS again on my Librem 5. Unfortunately I cannot get any kernel from Librem5 / linux · GitLab to boot. Just a green led and black screen.

The kernel version in Can someone with serial console access try NixOS kernel on Librem 5? - #20 by ookhoi that did work for me is not available anymore.

It is quite frustrating that both uboot and the kernel still have no upstream support for Librem 5. I’ve given up for now. But NixOS itself is a great fit for the Librem 5 as it has much more software than PureOS and is more robust due to rollback support.

2 Likes

The nix package manager is available on any Linux. I’ve used it on a company laptop with Ubuntu and am currently using it on a company MacBook with MacOS. Nix enables me to bring my configuration to any device whether at home or at a company provided Linux/MacOS. Nix manages not just software but also my configuration for bash, firefox, ssh, gpg, tmux, alacritty, git, emacs, etc.

Give home-manager a try: Home Manager Manual

2 Likes

I’ve used nixos-hardware for Librem 5 at some point but my Librem 5 did not boot anymore after an update of uboot. As I didn’t agree with some choices anyway - using ext2 for example - I decided to do without nixos-hardware. I’m not using it on any of my systems anyway and never missed it.

2 Likes

Yeah, seems weird to me as I thought ext2 was soon to lose Linux kernel support.

1 Like

Indeed. ext2 filesystems will still be supported by the backwards compatible ext4 driver but an ext2 filesystems misses all the improvements of an ext4 filesystem. One can create an ext4 filesystem without journal if that is a reason to choose ext2 for /boot: mkfs.ext4 -O ^has_journal /path/to/device

3 Likes