Github messages for voidlinux
 help / color / mirror / Atom feed
From: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Closed]: pinephone: add support for modem setup and audio routing.
Date: Sun, 07 Aug 2022 04:13:36 +0200	[thread overview]
Message-ID: <20220807021336.S0QP30GGoltuad3aRKrs5bT_kG3BzSK3L05F3cUFhXw@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-25084@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 3162 bytes --]

There's a closed pull request on the void-packages repository

pinephone: add support for modem setup and audio routing.
https://github.com/void-linux/void-packages/pull/25084

Description:
This pull adds the necessary components for 4G modem usage, with the following use-cases in mind:

- Configure audio setup to and from modem
- Make and receive calls
- Send and read SMS
- Use mobile broadband/cellular data
- Wake-on-Modem (for calls and texts)

For now I've tested this with ModemManager+NetworkManager, but this also provides the groundwork for environments that use `ofono` (or just plain AT commands with `atinout` or `screen`, if you feel clever :^) )

To get started, you first need to run `pinephone_setup-modem` once as root to do the initial modem configuration. (chances are postmarketOS already did this if you booted the phone once, but this might need to be done again incase of potential data loss)

Some use-cases might require further configuration of software (eg specific to NetworkManager) but the setup script should do most of the needed work. Make sure modem is powered up by running `echo 1 > /sys/class/modem-power/modem-power/device/powered_blocking` Some examples of usage that I've tested below:

Read sms with `mmcli`
```sh
$ mmcli -s '/org/freedesktop/ModemManager1/SMS/2'
  -----------------------------------
  Content    |              number: '+5555555555'
             |                text: 'Test'
  -----------------------------------
  Properties |            PDU type: 'deliver'
             |               state: 'received'
             |             storage: 'me'
             |                smsc: '+919810051829'
             |           timestamp: '160808142935+05'
```

Sample script for answering calls, using ModemManager dbus interface. Audio is setup thru `alsaucm`
```sh
#!/bin/bash

MM_IFACE="org.freedesktop.ModemManager1"
MATCH_CALLS="type='signal',sender='${MM_IFACE}',interface='${MM_IFACE}.Modem.Voice',member='CallAdded'"

do_accept() {
	while read TYPE TIME SENDER HEADER
	do
		if [[ "$HEADER" = *"Modem.Voice"* ]]; then
			read TYPE _P OBJ
			OBJ=$(echo "${OBJ}" | tr -d '"')
			echo "Pickup ${OBJ}"

			alsaucm \
				open PinePhone \
				set _verb 'Voice Call' \
				set _enadev 'Mic' \
				set _enadev 'Earpiece'
			
			dbus-send \
				--system \
				--dest="${MM_IFACE}" \
				--print-reply \
				"${OBJ}" \
				"${MM_IFACE}.Call.Accept"
		else
			read
		fi
	done
}

dbus-monitor --system "${MATCH_CALLS}" | do_accept
```

Add a NetworkManager connection for LTE (sub `<operator_apn>` for your carrier's data APN)
```sh
$ nmcli c add type gsm ifname '*' con-name LTE apn <operator_apn>
```

For Wake-on-Modem: I tested by doing `loginctl suspend` from a sway session, then calling the phone. It wakes up within 2 rings.

fwiw: these examples are only good for making sure the hardware/software interface works. More work still needs to be done to get some telephony front-end software in the repo, like #24538 Sxmo also should work out-of-the box with the NetworkManager+ModemManager pair https://git.sr.ht/~mil/sxmo-docs

      parent reply	other threads:[~2022-08-07  2:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25  9:18 [PR PATCH] " jjsullivan5196
2021-01-29  3:10 ` ericonr
2021-01-29  4:08 ` jjsullivan5196
2021-02-05 10:17 ` [PR PATCH] [Updated] " jjsullivan5196
2021-02-05 10:19 ` jjsullivan5196
2021-02-05 10:20 ` jjsullivan5196
2021-02-05 10:22 ` jjsullivan5196
2021-02-06  5:00 ` [PR REVIEW] " the-maldridge
2021-02-06  5:13 ` jjsullivan5196
2021-02-06  5:15 ` the-maldridge
2021-02-06  5:19 ` ericonr
2021-02-06  5:32 ` [PR PATCH] [Updated] " jjsullivan5196
2021-02-06  5:35 ` [PR REVIEW] " jjsullivan5196
2021-02-06  7:06 ` [PR PATCH] [Updated] " jjsullivan5196
2021-02-06  7:09 ` jjsullivan5196
2021-02-06  7:15 ` jjsullivan5196
2021-02-06  7:21 ` jjsullivan5196
2021-02-22 21:39 ` MungFuSensei
2021-02-24  4:03 ` [PR REVIEW] " ericonr
2021-02-24  4:03 ` ericonr
2021-02-24  4:03 ` ericonr
2021-02-25 19:38 ` Piraty
2021-03-01  0:14 ` [PR PATCH] [Updated] " jjsullivan5196
2021-03-01  0:15 ` [PR REVIEW] " jjsullivan5196
2021-03-01  0:15 ` jjsullivan5196
2021-03-01  0:17 ` the-maldridge
2021-03-01  0:18 ` [PR REVIEW] " jjsullivan5196
2022-04-09  9:28 ` JamiKettunen
2022-04-18 20:17 ` HadetTheUndying
2022-07-19  2:14 ` github-actions
2022-08-07  2:13 ` github-actions [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220807021336.S0QP30GGoltuad3aRKrs5bT_kG3BzSK3L05F3cUFhXw@z \
    --to=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).