For a lot of people having the 1 second timeout results in not finding
the sim at all. Let's rather wait up to 4 seconds for the sim to appear,
it was reported that 3 is enough in a report where 1 wasn't.
Related: issue 2072
[ci:skip-build]: already built successfully in CI
Recent libqmi update in Alpine [1] splits off binary utilities into a
subpackage. This breaks the selection script which depends on qmicli.
Add the new qmi-utils as a dependency to make sure the script can
continue to work.
[1] - a1e61165f4
Unfortunately it looks like some modem firmwares (or SIM cards?) need
more time until the SIM card shows up in the modem. This means that the
SIM card might not get configured, making it look like it was not
detected at all. On the other hand, having the previous long wait loop
affects _all devices_ when there is really no SIM inserted.
The proper solution would be to make it possible to configure SIM cards
once they show up (probably in ModemManager). Until then, try to make it
possible to workaround this by introducing a configurable delay to wait
for the SIM card. It is set to minimal "1 seconds" by default but could
be increased by the user if needed to give the modem enough time to detect
the SIM card.
This reverts commit 683b543a3b ("msm-modem-uim-selection: Don't wait
for SIM (MR 2470)" but with a new configuration mechanism and a default
of 1 second only.
[ci:skip-build] already built successfully in CI
Unfortunately, msm-modem-uim-selection causes boot delays on APQ*
SoCs (without most modem functionality) at the moment. The modem will
never show up so it keeps waiting and waiting.
To allow using the same rootfs on devices that have MSM* and APQ*
variants (e.g. Samsung MSM8916 tablets), add a quick check at the
beginning of the service to cancel early when running on an APQ* SoC.
This is easy to check because the SoC is actually exposed in sysfs.
This is no longer used by anyone and also should not be used anymore.
The new WWAN RPMSG CTRL for the WWAN subsystem is now the preferred
way to talk to the modem on MSM8916/MSM8939/MSM8974 and other similar SoCs.
[ci:skip-build]: already built successfully in CI
The delay to wait for the SIM card to show up appears to be unneeded on
our modems, remove it so that we don't delay boot by 10 seconds if your
device doesn't have a SIM card installed.
[ci:skip-build] already built successfully in CI
uim-selection has "after *" in it's dependencies to make sure the
theoretical up to ~1min delay can't be observed. Unfortunaely this
causes incorrect dependencies ordering if one of other services depends
on ofono or modemmanager. Drop "after *" so modem can always be started
properly.
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.
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.
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
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