MMS audio attachment (.amr file) cannot be played

REPRODUCIBILITY: 100%
OS VERSION: 4.4.0.68
HARDWARE: XA2 Ultra, 10 III
UI LANGUAGE: Polish, English
REGRESSION:

DESCRIPTION:

MMS with an audio attachment (an .amr file) cannot be played back. When I open the received MMS message and tap on the attached audio icon (a music note) to play it, it tries to open the audio file in the Multimedia app and fails with “Elements not found” and “Cannot open filename.amr” error messages.

Edit: if I manually locate the attachment in ~/.local/share/commhistory/data and tap on it in File Browser, I get an error message about unsupported AMR (Adaptive Multi-Rate) codec.

PRECONDITIONS:

None.

STEPS TO REPRODUCE:

  1. Receive an MMS with audio attachment (an .amr file).
  2. Open the MMS and try to listen to the audio attachment by tapping on it (represented by a music note icon)
  3. There will be an attempt to open the audio in Multimedia app, but it fails with “No elements found” and “Cannot open filename.amr” error message

EXPECTED RESULT:

The MMS audio attachment can be played back.

ACTUAL RESULT:

It is impossible to play back MMS audio attachments.

MODIFICATIONS:

None.

ADDITIONAL INFORMATION:

My operator (T-Mobile Poland) sends via MMS with audio attachment messages that people leave in voicemail. Until OS 4.4.0.68 I wasn’t able to receive such messages at all, because they have no “Subject” field and the Sailfish OS parser wasn’t accepting them (I was only getting an error message that the message couldn’t be received). OS 4.4.0.68 introduced a fix for this (relaxed parser rules), so I was extremely happy that now I can finally receive those voicemail messages. Sadly, it turned out that being able to receive them doesn’t help much, because they cannot be played back…

If I am not mistaken, AMR is the standard for MMS audio attachments, so SFOS should support it.

EDIT: After installing AMR gstreamer plugins (and the opencore libs they depend on) AMR playback is now supported system-wide. But it is still impossible to play .amr MMS attachments directly from the message, because the SFOS’ Multimedia app - apparently due to Sailjail restrictions - cannot access the file in ~/.local/share/commhistory/data, i.e. where MMS attachments are stored. It takes copying the file manually to somewhere else for the Multimedia app to be able to play it.

5 Likes

The MMS attachment (an .amr file) can be found in a folder in ~/.local/share/commhistory/data. But it cannot be played. The error message is: Unsupported codec Adaptive Multi-Rate (AMR). Clearly, SFOS doesn’t have a codec to play an .amr file…

I was only able to manually open it in VLC (an Android media player) where it was played back just fine.I’ve uploaded a sample .amr MMS attachment here:

Sample .amr file that SFOS can’t play, extracted from MMS message:

https://file.io/qK7oYfEWXEmA

I think the gstreamer-plugins-ugly add AMR-NB an AMR-WB codec support. You might need to dig around a little though.

4 Likes

@hackman Thank you! Indeed, installing AMR plugins from gstreamer-plugins-ugly (as well as opencore libs they depend on) did the job and .amr files are now recognized and played back.

However, it is still impossible to play MMS attachments in Multimedia app directly from the message itself, because - apparently due to Sailjail restrictions - Multimedia app cannot access files in ~/.local/share/commhistory/data/ (i.e. where MMS attachments are stored). It takes manually copying the amr file to e.g. ~/Music for the Multimedia app to be able to open it (it doesn’t even work from ~/ but it must be one of the subfolders like Music).

Is there a way to whitelist a path so that Sailjail’d apps can access it?

3 Likes

Answering to myself… Adding

whitelist ${HOME}/.local/share/commhistory/data

to

/etc/sailjail/permissions/Music.permission

did the job. Now the Music (aka Multimedia) app can access that folder and play MMS audio attachments directly from within the message.

To recap, in order to play MMS audio attachments, one has to:

  • install gstreamer AMR plugins and opencore AMR libraries
  • whitelist ~/.local/share/commhistory/data folder in /etc/sailjail/permissions/Music.permission
7 Likes

Hello,

I recently moved from Symbian Belle to Sailfish OS (Xperia 10 III). I am migrating data/preparing my phone and I stuck with installing amr codec.

In openrepos.net there is no Gstreamer-Plugins-Ugly 64-bit package, so I did this manually.

I copied files from suse gstreamer-plugins-ugly-codecs-1.20.1-pm154.1.1.aarch64.rpm package (libgstamrnb.so and libgstamrwbdec.so) to /usr/lib64/gstreamer-1.0/
and
from libopencore-amrnb0-0.1.5-pm154.1.1.aarch64.rpm + libopencore-amrwb0-0.1.5-pm154.1.1.aarch64.rpm all files to /usr/lib64/

Unfortunately still nothing, ldd shows that all libraries are in place, but gst-inspect-1.0 amrwbdec shows nothing…

What I am doing wrong / what I missed?

Regards,
R.

Thanks for reporting this @wetab73. I’ve created an internal issue about this and tagged it as “tracked”. However, if the AMR codec is in gstreamer-plugins-ugly it may be that it can’t be included on the device.

But we will try to look into it and if there’s any new information to share will do our best to post back here.

4 Likes

Build 1.20 (and actually even 1.18) of gstreamer plugins is TOO NEW for the version of gstreamer currently included in SFOS. Use older plugin versions (or upgrade gstreamer to a newer build…).

I’ve successfully used AMR codecs from 1.16 build of ugly codecs (gstreamer1-plugins-ugly-1.16.1-1.el8.aarch64.rpm), and 0.1.5-7 version of libopencore (opencore-amr-0.1.5-7.el8.aarch64.rpm). Such a combination works perfectly fine.

3 Likes

just added 64-bit packages @ openrepos plugins-ugly (all ugly plugins without dependencies) and plugins-ugly-amr which requires opencore-amr packages…

3 Likes

i must be doing a bad search, but i can’t find them - i’d like to play a MMS audio on my X10 III :slight_smile:

answering to myself - I found it here.

Now it works!

I’ll write a quick blog article soon on this, and will post the link here

OK, blog article live here: How to play MMS Audio files (.amr) on Sailfish OS

3 Likes

I probably do not use the good way to do it, but I can’t install the both libopencore. When I try a rpm -Uvh, it replies me the need for other libs that can’t be installed. Do I do something wrong ?

You shouldn’t use rpm -U, ever.
Use pkcon install-localinstead, it will solve dependency issues if it can.

1 Like

Thanks. Anyway, after installation and reboot, it doesn’t work.

it still works for me, i just have to reinstall after an upgrade as packages are replaced. If you follow the blog article above, does that work?

That’s what I did, it didn’t work at all, not even finished the installation process because of wrong commands and dependences unsatisfied. @nephros said also it wasn’t the good process.
Unfortunately, following his process, even if the installation finished, it didn’t let me able to listen to the audio file.

It’s been working for me since I did it in last year’s autumn. It survives OS upgrades and I never had to do anything about it again.