On some devices, primarily with two sim slots, modem doesn't choose
the sim automatically. Add an init script that would detect in which
slot the sim is present and configure the modem to use it.
At the moment, oFono/MM are usually stopped after rmtfs on shutdown.
This does not make sense, since the modem managed by oFono/MM will
disappear once rmtfs is stopped. Add a "before ofono modemmanager"
to make sure that OpenRC will stop oFono/MM before rmtfs on shutdown.
This may or may not fix some occasional hangs during shutdown,
but it definitely makes it possible for oFono/MM to shutdown cleanly.
When I upgraded tinyalsa to the new 2.0.0 major release (with breaking
changes) I failed to test q6voiced properly, even though I explicitly
had to rebuild it against the new tinyalsa version (see MR 1941).
In tinyalsa 2.0.0, calling pcm_open() does not automatically call
pcm_prepare() anymore, which is responsible for actually starting any
audio streams. This means that the old version of q6voiced is almost
entirely broken - only by pure luck it's sometimes possible to get
voice call audio working if you play other audio simultaenously while
a voice call is active. This does not work for the microphone though.
The new q6voiced version now calls pcm_prepare() explicitly to fix this.
On some downstream kernels it seems like we need to explicitly keep
/dev/subsys_modem open (without writing anything), otherwise the modem
will be stopped (or never started). Weird.
The -s switch to automatically start/stop the modem remoteproc only
works on mainline, on downstream it fails with "Failed to get rprocfd".
Let's abuse /usr/lib/preload/libqipcrtr4msmipc.so to check if we are
(probably) running on a downstream installation, and omit the -s
argument in this case. The modem remoteproc needs to be started
differently on downstream.
qrtr-ns is not needed (or working) on downstream, also it is no longer
needed for mainline starting with Linux 5.9. Convert the "need" dependency
to a "use" so qrtr-ns is only started if it is really needed.
In most cases, the qrtr-ns is not needed anymore now, but we still
need the libqrtr library. Separate that out into a separate package
so it can be installed independently.
So far we have only created /dev/modem based on the DATA5_CNTL
channel available from the modem. The DATAX_CNTL channels allow
sending QMI messages to the modem. This is sufficient for oFono
to work.
Unfortunately, ModemManager currently does not support starting
calls through the QMI interface. Instead, it uses serial AT commands
that can be alternatively used on all USB-based Qualcomm modems.
It turns out that we can also send serial AT commands through
the RPMSG interface: the DATAX channels (without _CNTL) all respond
to serial AT commands. We set it up at /dev/modem-at, configure
ModemManager accordingly and then we are able to start calls. Yay!
Newer Qualcomm SoCs (e.g. SDM845. MSM8953) seem to use a different
method to talk to the modem. There are no longer separate rpmsg/SMD
channels for QMI messags, instead the modem is also available through QRTR.
On these newer SoCs, installing msm-modem-mainline is pointless,
because the created /dev/modem device will not actually allow
communicating with the modem. However, you still need the part from
the base package (msm-modem), which installs+enables rmtfs.
To avoid confusion, rename the msm-modem-mainline subpackage to
msm-modem-rpmsg. Install only "msm-modem" on SDM845 because that
likely does not allow communication with the modem through RPMSG
anyway.
It is possible for msm-modem to get installed before
rmtfs-openrc, which causes the following error in
post-install:
* rc-update: service `rmtfs' does not exist
ERROR: msm-modem-1-r0.post-install: script exited with error 1
Add a dependency to ensure rmtfs-openrc gets installed first
linux-postmarketos-qcom-msm8916 now supports voice call audio.
However, at the moment the audio stream needs to be explicitly started
by opening some PCM audio devices when the call is started
(even though no audio data is written to the PCM device).
Eventually this should go away by implementing codec2codec support
for q6voice in the kernel. In that case, the stream would be started
once the audio routes are set up using ALSA UCM. However, this is a bit
complicated actually so for now it's nice to have a workaround:
q6voiced listens on dbus for signals from oFono, and opens/closes the
PCM device when a call is initiated/ended in oFono. This essentially
makes voice call audio work out of the box (provided that the audio
routing, e.g. Earpiece and a microphone is set up appropriately).
Co-Authored-By: Nikita Travkin <nikitos.tr@gmail.com>
Combine modem-qcom-msm-{mainline,downstream}-common to a single APKBUILD
with mainline and downstream subpackages.
Enable rmtfs service here instead of directly in the package.
[ci:skip-vercheck]: for qrtr version fix
- use supervise-daemon to restart when necessary
- run normally, without wrapping with sh and logger
- add "need qrtr-ns" to make sure it gets started first
- stop enabling service directly in rmtfs package
(moved to msm-modem)
- Fix version
- Rename init script to qrtr-ns ("nameservice") to clarify which
service is actually started
- Use supervise-daemon
- Configure and start daemon in one command (no need for qrtr-cfg)
- Remove "before qcom_rmtfs": it should depend on qrtr-ns,
not the other way around
- Do not activate qrtr daemon by default - this should happen automatically
if other service files have "need qrtr-ns"
At the moment, only "modem" is detected as rpmsg name.
On MSM8916 the audio DSP and modem are both on the same remote
processor ("hexagon").
Add it to the udev rule so the modem symlink is created on MSM8916.
The changes in command line parameters of rmtfs mean: use the modem*
partitions directly (-P), in read-only mode (-r)...and it will boot the
modem automagically when ready (-s)
I've removed the udev rules in the rmtfs package because it doesn't look
like they are needed with those command line flags.
Remove Werror workaround in APKBUILD, as the necessary change has been
upstreamed. By rebuilding the package, we fix the following errors:
Error relocating /usr/lib/preload/libsmdpkt_wrapper.so: minor: symbol not found
Error relocating /usr/lib/preload/libsmdpkt_wrapper.so: major: symbol not found
We already have it limited by the ID_PART_ENTRY_NAME, it is very less
likely that someone will have sdcard with the partition names which are
similar to modem partition.
This fixes rmtfs for @MartijnBraam who for some reason have internal mmc
as mmcblk1 and not 0.
This patchset is based on the branch on the sysmocom.de git,
https://git.sysmocom.de/ofono/log/?h=lynxis/voicecall
The original branch was based on old ofono so this patches are manually
merged to ofono 1.21 and tested on debian initially.
On my device the rpmsg0 have DATA5_CNTL under name attribute instead of
rpmsg_name
```
looking at device '/devices/platform/smd/smd:modem/smd:modem.rpmsg_chrdev.0.0/rpmsg/rpmsg_ctrl1/rpmsg0':
KERNEL=="rpmsg0"
SUBSYSTEM=="rpmsg"
DRIVER==""
ATTR{dst}=="0"
ATTR{src}=="0"
ATTR{name}=="DATA5_CNTL"
```
So check for name instead of rpmsg_name.
test scripts are useful to enable/disable modem and also do ofono
related tasks, They are installed on /usr/lib/ofono/test directory and
provide much better user experience then the raw dbus-send command.
- Instead of just libqrtr, build all targets of qrtr
- install the qrtr.initd which starts qrtr services before rmtfs is
started
- in post-install enable qrtr service at boot