No access to the FM tuner/radio on Aquaris Bq e4.5, e5 and m10
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical System Image |
Confirmed
|
Wishlist
|
Unassigned | ||
media-hub (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
platform-api (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
qtmultimedia (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Device Aquaris BQ e45, e5, m10 as a buitin hardware FM tuner.
On "factory" mode this device works.
The device does not seem known by the kernel and there is no API to develop an FM radio application.
The C code for the FM chip:
https:/
Still missing Audio part.
Some more details from mailing list:
We discussed this topic lengthily on the list some time ago :) It's
not like we don't want to
support FM radio, but the lack of a common Android HAL for FM radio
access would force us to
maintain an FM radio abstraction ourselves (more on that below). In
addition, most of the device-specific
radio apps require elevated privileges to run as they directly access
the FM radio HW (not multiplexed by a system service).
> For some reason Android doesn't have an FM radio API and leaves it up to
> the manufacturers to come up with something. I've looked at several
> devices, among them the bq Aquaris E4.5, and every SoC manufacturer
> seems to have a different opinion on how to do it.
>
> Some ship no FM radio at all.
>
> Some seem to ship drivers for the Linux V4L subsystem.
>
> MediaTek (Aquaris E4.5 and E5) decided to implement custom kernel
> drivers with a custom character device (/dev/fm) and custom ioctl
> commands. There seem to be userspace libraries (libfm*) including a JNI
> wrapper in /system/lib of the Android container on our Ubuntu phones.
>
> Because there is no standard API, there are no generic FM radio apps for
> Android, and pretty much every manufacturer ships a custom app for his
> own SoC(s) and/or device(s).
>
>
> I'll try to come up with a piece of C code for the command line that can
> at least initialize and tune the FM radio on the Aquaris E4.5 and E5.
> The long-term goal could be to turn this into plugins for an extended
> media-hub.
>
If you are interested in helping to enable the functionality, the
correct chain for integrating the feature would be:
[1.] Add a (potentially limited) API to lp:platform-api, that exposes
a simple common C interface to the Ubuntu side.
[2.] Provide an implementation of the API in platform-
http://
[2.1] Provide a dummy fallback implementation for devices that do not
support FM radio of any kind.
[3.] Expose the respective hardware functionality to media-hub.
Multiple ways are possible, but we would need to significantly adjust
the interfaces
to support fm radio semantics (switching stations, rds, automatic scans etc.)
[4.] Adjust Qt's radio abstraction and come up with a Ubuntu Touch
specific backend implementation, that either:
[4.1] Leverages the API in [1.] directly (would require any app to
have special privileges in accessing the system).
[4.2] Leverages the API in [3.] (which is the clean way of
integration FM radio support).
For starters, [1.], [2.], [2.1] and [4.1] should be good enough to get started.
Cheers,
Changed in canonical-devices-system-image: | |
assignee: | nobody → John McAleely (john.mcaleely) |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
Changed in canonical-devices-system-image: | |
assignee: | John McAleely (john.mcaleely) → Simon Raffeiner (sturmflut) |
status: | Confirmed → In Progress |
summary: |
- No access to the FM tuner on Aquaris BQ45 + No access to the FM tuner/radio on Aquaris BQ45 |
summary: |
- No access to the FM tuner/radio on Aquaris BQ45 + No access to the FM tuner/radio on Aquaris Bq e4.5 |
summary: |
- No access to the FM tuner/radio on Aquaris Bq e4.5 + No access to the FM tuner/radio on Aquaris Bq e4.5, e5 and m10 |
description: | updated |
summary: |
- No access to the FM tuner/radio on Aquaris Bq e4.5, e5 and m10 + No access to the FM tuner/radio on Meizu MX4, Aquaris Bq e4.5, e5 and + m10 |
summary: |
- No access to the FM tuner/radio on Meizu MX4, Aquaris Bq e4.5, e5 and - m10 + No access to the FM tuner/radio on Aquaris Bq e4.5, e5 and m10 |
Changed in canonical-devices-system-image: | |
status: | In Progress → Confirmed |
assignee: | Sturm Flut (sturmflut) → nobody |
description: | updated |
Here are some details taken from mailing list:
Good morning dear list,
it's time for the "good news, bad news" part again.
The good news: I managed to attach gdb to the Factory Mode [1] binary, symbol- building and gdb-command-writing it's now
and with some debugging-
starting to get possible to catch every ioctl and semi-automatically
dump the parameters. Those of you who know a bit about debugging may see
the value in a gdb output like this one:
Breakpoint 1, 0xb6f41298 in ioctl () from /system/lib/libc.so
lrwx------ root root 2015-12-16 21:44 25 -> /dev/fm
FM_IOCTL_POWERUP
$5 = {err = 0 '\000', band = 1 '\001', space = 1 '\001', hilo = 0
'\000', freq = 880}
Turns out you only need three ioctl()s to power on and tune the whole FM ANA_SWITCH.
chip: FM_IOCTL_POWERUP, FM_IOCTL_MUTE and FM_IOCTL_
The bad news: We also catched all the ioctls necessary to tell the audio
chip to forward the FM signal to the headphones, and it's 90 (!) calls.
So our problem isn't the FM radio, it actually seems to be the audio
subsystem.
cheers,
Simon
[1] sturmflut. github. io/ubuntu/ bq/2015/ 05/04/hacking- the-bq- part-2- factory- mode/
http://