yashsingh1/xdaforums huggingface dataset:
[Miscellaneous Android Development] 21prods:
One question, if I wanted to do it by myself (which in fact I want ;) ), what should I do? I guess I would have to compile my own build, is it? I cannot do it copying a file from one ZIP to the other one, can I?

Thank you in advance!
[Miscellaneous Android Development] ottmi:
Great stuff. Please report back whether this improves audio quality so I can include it in the next build..
[Miscellaneous Android Development] ottmi:
You don't have to compile your own build. On Linux you would do this:

Extract the ZIP, convert the sparse system image to a raw image, mount it as loopback and copy all libstagefright*.so files from /lib and /lib64 to your phone.

If that doesn't mean anything to you, just wait for a few more minutes until my upload of the new build finishes :)
[Miscellaneous Android Development] ottmi:
Ok, the new build is up. It should fix the problems with mediaserver crashing due to the libstagefright bug. Also, I've replaced some binary blobs for the Adreno GPU by files from the Wileyfox Swift. In the Trunk stock ROM, there were some missing. Not sure whether that makes any difference, though..
[Miscellaneous Android Development] siljaer:
Unfortunately, some people kept reporting echoes, so I needed to lower mic volume again. However, the file requested more changes than initially thought. I am attaching it: my changes are commented and marked with my nick.

I hope you can give it a look and check whether preprocessing library is actually supported by audio HAL: I am not able to do it by myself.

Thank you again for your great effort!
[Miscellaneous Android Development] marcachas:
Really Thanks

confirmed, it has been solved failure blockades and shutdowns, everything becomes completely stable and usable, has returned fluidity to the system.

Thank you, many grace and a hug. :fingers-crossed:
[Miscellaneous Android Development] ottmi:
Thanks for this. I've poked around in the CM source and it seems there's libqcomvoiceprocessing.so that also provides AEC, NS, and AGC. I'm wondering whether that is the better library to use for our device?

In fact, on any MSM8916 device the audio_effects.conf should enable them by default. But for some strange a different configuration file ends up on our device that doesn't use them. I will investigate further..

EDIT: Ok, there are two audio_effects.conf files: one in /system/etc and one in /system/vendor/etc. The one in /system/vendor/etc, however, takes precedence over /system/etc. So which one did you modify? Unless it was the one in /system/vendor/etc, it shouldn't have had any effect :confused:
[Miscellaneous Android Development] siljaer:
Maybe aec and ns can be enabled in audio_platform_info.xml. I added a line for handset mic:

<acdb_ids>
<device name="SND_DEVICE_OUT_SPEAKER" acdb_id="14" />
<device name="SND_DEVICE_IN_HANDSET_MIC" acdb_id="108" />
</acdb_ids>

value for speaker was 15, but I changed it to 14 according to: https://github.com/CyanogenMod/andr...cm-13.0-caf-8996-ZNH2K/hal/msm8916/platform.c (I hope it is the right file). Speaker still works, however.

according to the same file, 108 should enable aec and ns, while 106 aec alone.

I cannot say about any improvements yet.

As for my previous changes in audio_effects.conf, they were probably useless for voice calls: the source says

# Audio preprocessor configurations.
# The pre processor configuration consists in a list of elements each describing
# pre processor settings for a given input source. Valid input source names are:
# "mic", "camcorder", "voice_recognition", "voice_communication"

so probably they affect only voip and other third party apps.

---------- Post added at 12:51 ---------- Previous post was at 12:47 ----------

/system/etc ....
[Miscellaneous Android Development] 21prods:
Everything working again. Congratulations!

As a secondary issue, couldn't your builds be considered 'official' at some point? I dare not to say what else remains to be done as CM runs smoothly and is definitely stable. Perhaps enforcing SELinux in the future? Appart from that...

Enviado desde mi Elephone Trunk mediante Tapatalk
[Miscellaneous Android Development] siljaer:
which is the ACDB ID for [SND_DEVICE_IN_HANDSET_MIC_AEC] according to the sources your mod is using? (sorry, I have problems finding it by myself).
[Miscellaneous Android Development] ottmi:
106 like you quoted above and 108 for SND_DEVICE_IN_HANDSET_MIC_AEC_NS.
[Miscellaneous Android Development] siljaer:
Thanks. BTW, I've found that Qualcomm's Fluence technology works only when the device has two mics. AFAIK, elephone trunk has just one. Am I right?
[Miscellaneous Android Development] ottmi:
I think so, too. However, there are plenty of references in audio_policy et all to a 2nd mic.. Maybe those should be removed then..
[Miscellaneous Android Development] siljaer:
if so, in build.prop should be:

ro.qc.sdk.audio.fluencetype=none
persist.audio.fluence.voicecall=false
persist.audio.fluence.voicerec=false
persist.audio.fluence.speaker=false
[Miscellaneous Android Development] siljaer:
I've found something unexpected: I installed Droid Examiner from F-Droid, in order to check the number of microphones on the trunk. I did not find that information, but the app found several sensors I did not know to exist. All of them are Bosch Sensortec:

Acceleration

Gyroscope

Magnetic Field

Orientation

Gravity

Linear Acceleration

Rotation Vector

Game Rotation Vector

Gyroscope Uncalibrated

Magnetic Field Uncalibreted

Geomagnetic Rotation Vector

So, we should have a gyroscope and a compass. Is it possible?

EDIT: with S Tools+ I can see them: they are there.
[Miscellaneous Android Development] ottmi:
Nope. There's only proximity, light, and acceleration. I'm using the Bosch sensor framework though and probably need to disable code for sensors that don't exist.
[Miscellaneous Android Development] siljaer:
Hi ottmi,

I am browsing your source code (well, I was investigating the feasibility of an ubuntu touch port, but it looks like the master branch can't support 64 bit yet...) and I tried the script to extract proprietary components. Even with stock ROM (latest version) several files are not found. Why? I guess they are not essential, yet I am curious.

BTW, I've seen you're still working on it, thank you!
[Miscellaneous Android Development] ottmi:
It shouldn't be a problem to compile the kernel as 32 bit. If I remember correctly, that's what the Ark Benefit ROMs are using..

The proprietary blobs are a mess. Many are missing in the Trunk stock ROM. And others don't seem to work properly with Android 6.0. That's why I'm "borrowing" some files from the Wileyfox Swift: There's an additional proprietary-files-crackling.txt that contains the list of files I've copied from there. But the extract-files.sh script hasn't been updated yet to use it..
[Miscellaneous Android Development] siljaer:
Yes, I could compile kernel as 32 bit. Actually, I don't even know whether 64 bit are supported in the newer branches.

From what you say about blobs, the best branch seems to be that based on android 5.1. Unfortunately, documentation is very scarce, so I'll have to ask in specialized forums.

I've read that camera blobs are the most problematic ones with Marshmallow. What about Qualcomm's? Are there any other set that don't work properly?
[Miscellaneous Android Development] siljaer:
Hi ottmi,

about the echo again: I solved the problem by decreasing drastically earpiece and mic volume. However, I found that in 4pda.ru some other people are experiencing it with other roms. Actually, the patch by Wenderer7755 that you applied has been modified ( http://4pda.ru/forum/index.php?s=&showtopic=692103&view=findpost&p=49832177 ), but some people keep suffering from the problem., so he suggested these changes: http://4pda.ru/forum/index.php?s=&showtopic=692103&view=findpost&p=50377107

I will try those changes as soon as you release a new version, before rewriting my values (if needed).
[Miscellaneous Android Development] siljaer:
I've found that Galaxy Tab S2 uses the same sensor (s5k4h5) and CM13 runs on it, maybe there's also an official upgrade to Android 6.0.1. Could it be useful to us?
[Miscellaneous Android Development] ottmi:
No, because the Galaxy uses an Exynos SOC and the camera daemon is specific to the SOC. So unless we fond a Qualcomm device with this sensor, there's not much we can do..
[Miscellaneous Android Development] siljaer:
I see. Too bad :(

However, the camera works fine with opencamera. The only thing I cannot do is setting photo resolution to the real (non-interpolated) resolution of the sensor. But I guess it's because of the driver. For sure, it's a useless waste of bytes...
[Miscellaneous Android Development] ottmi:
Can you send me these files? I always get a 404 when I try to download them..
[Miscellaneous Android Development] ottmi:
There's a new build in the download section:

http://xdaforums.com/devdb/project/dl/?id=19046

Changes:

Fix bug in libstagefright properly I've sent the bugfix upstream, so this should hopefully be fixed for good

Fix sensor glue code to only show actually existing sensors - Now the phone should only report light, proximity, and acceleration sensors

Fix device permissions I hope this should fix the problem with incompatible apps in the play store

Use own key to sign code instead of testkeys To get rid of the testkeys

Set selinux to enforce ROM seems stable enough, so selinux shouldn't cause any trouble with debugging anymore
[Miscellaneous Android Development] 21prods:
Great! Thank you very much once again!

Enviado desde mi Nexus 5 mediante Tapatalk
[Miscellaneous Android Development] siljaer:
It's the same for me, but I thought it's because I am not registered to 4pda.ru.

However, don't hold your breath: it looks like the matter it's still worked on: http://4pda.ru/forum/index.php?showtopic=692103&view=findpost&p=50815511

I think a possible explanation of the fact that some people are hearing the echo while other people aren't could be the different lags among operators.
[Miscellaneous Android Development] todoss:
All credit goes to Wenderer7755!
[Miscellaneous Android Development] ottmi:
So what should I do? Keep it as it is or use one of the files [MENTION=5312743]todoss[/MENTION] provided? I don't have any problems with echo, so I really can't tell..
[Miscellaneous Android Development] siljaer:
In my humble opinion, nothing (for now). The problem affects only a minority of users (I'm one of them, though...). A workaround is possible and, above all, testing is quite hard: you have to call several people and ask them whether they can hear it. I would run out of friends soon with 6 different patches :) Too bad android and cyanogen do not provide a simple way to adjust handset mic and earpiece gain/volume.

I've often read that cheap smartphones have often earpiece volume set very low. I suppose it's a quick workaround for phones that transmit sound too well from earpiece to mic, something that can be (sometimes) solved with a second mic near the eaerpiece, that such phones are lacking. People that try increasing the volume often experience echo.

I told you about the patch because I thought that Wenderer7755 had come out with a definitive solution. Since they are still experimenting with that, maybe it's better to wait, as 4pda users seem to be affected much more than xda users.

You are doing a terrific job and you have added incredible value to a 100EUR smartphone. BTW, battery life is outstanding too!
[Miscellaneous Android Development] evgen6375:
these patches are only for Miui !!! Cm13- not work
[Miscellaneous Android Development] siljaer:
Wenderer7755 was working on his CM13 too.

I have seen test1. The interesting blocks are:

<ctl name="HPHL Volume" value="9" />
<ctl name="HPHR Volume" value="9" />
<ctl name="RX1 Digital Volume" value="86" />
<ctl name="RX2 Digital Volume" value="86" />
<ctl name="RX3 Digital Volume" value="86" />
<ctl name="IIR1 INP1 Volume" value="84" />
<ctl name="IIR1 INP2 Volume" value="84" />
<ctl name="IIR1 INP3 Volume" value="84" />
<ctl name="IIR1 INP4 Volume" value="84" />
<ctl name="ADC1 Volume" value="6" />
<ctl name="ADC2 Volume" value="6" />
<ctl name="ADC3 Volume" value="6" />
<ctl name="DEC1 Volume" value="84" />
<ctl name="DEC2 Volume" value="84" />

HPHL and HPHR should affect headphones. Here is interesting to see that also RX<x> and IIR1 INP<x> volumes are changed. I don't what they exactly are, though. ADC<x> are self explanatory. DEC1 is what I use to reduce mic sensitivity. I set it to 75, but I left other values (ottmi's) untouched.

then:

<path name="handset">
<ctl name="RX1 MIX1 INP1" value="RX1" />
<ctl name="RDAC2 MUX" value="RX1" />
<ctl name="RX1 Digital Volume" value="84" />
<ctl name="EAR PA Gain" value="POS_6_DB" />
<ctl name="EAR_S" value="Switch" />
</path>

RX1 Digital Volume affects earpiece volume. Mine is set to 75 too.

<path name="sidetone-handset">
<path name="sidetone-iir" />
<ctl name="IIR1 INP1 Volume" value="53" />
<ctl name="RX1 MIX2 INP1" value="IIR1" />
</path>

<path name="sidetone-headphone">
<path name="sidetone-iir" />
<ctl name="RX1 MIX2 INP1" value="IIR1" />
<ctl name="RX2 MIX2 INP1" value="IIR1" />
<ctl name="IIR1 INP1 Volume" value="53" />
</path>

I don't know what these two sections refer to, but the value to play with is IIR1 INP1 Volume in both.

Edit: I've found what sidetone is (feedback of speaker's voice through earpiece), it shouldn't be important since the other party hears the delayed echo of their own voice.

However, as far as I have understood, echo cancellation should be performed on the phone of the party that is suffering from echo of their own voice, as the signal received is compared with voice previously transmitted and, if something similar is found, the latter is subtracted.
[Miscellaneous Android Development] ottmi:
So what happens then when you put the call on speaker? I would imagine that the "echo sending" phone then also has to do some echo cancellation..
[Miscellaneous Android Development] evgen6375:
Wenderer7755 wrote that in the CM13, for the echo answers a different file, different files with Miui
[Miscellaneous Android Development] siljaer:
Yes, you're right. I've made further research on the topic, and I have found that AEC is performed on both parties in both directions. Even more interesting (and that can explain the elusive nature of the phenomenon), I have found that AEC is also implemented by the carrier. So, not only the delay varies with the carrier, but also the algorithm.

http://www.uky.edu/~jclark/mas355/ECHO.PDF

here an explanation on echoes on mobiles:

http://www.vocal.com/echo-cancellation/acoustic-echoes-in-mobile/

the picture reminds me of the experiment I made to understand how loud is the sound from the earpiece near the mic. It was quite louder, especially on the back of the phone. Unfortunately, quite unusually, the mic is placed on the edge, and the hole is on the back cover, that conducts sound so well....

Maybe it makes a difference if you hold the phone with right or left hand, as I think that using right hand you can dampen the cover vibrations.
[Miscellaneous Android Development] Sampierdarena:
Hi!

I need help: I can not install the latest release.

Currently I installed version 6.16.2016

The TWRP is 3.0.2, it gives me error 7: What vul mean?

How do I upgrade?

Thank you

https://s32.postimg.org/m36vx30yd/20160701_072950.jpg
[Miscellaneous Android Development] ottmi:
It's right there on your screen: "run a factory reset".

Did anybody else have this problem when upgrading?
[Miscellaneous Android Development] Sampierdarena:
Thank you, it is true it was clearly written. My doubt is: I can not update without a factory reset?

Until now I run wipe cache / davil and everything worked well ...
[Miscellaneous Android Development] ottmi:
I'm not sure. Usually it works without factory reset. Maybe it's because I've changed the signing keys. In fact, I got the same error message and got around doing a factory reset by flashing system.img with fastboot..
[Miscellaneous Android Development] cool400:
ottmi, thanks for your work!

But I've got big problems with your latest build 20160630 - I can't install Gapps Micro because of "Insufficient storage space available in System partition" :confused:

I downloaded Gapps Micro ARM64 6.0 Micro, which I thought must work, but I reproduced this error three times now.

I re-downloaded the ROM and Gapps three times, but no success.

I used the latest TWRP 3.0.2.0 from hisname, wiped everything in advanced, installed the ROM and right after - without a reboot - I tried to install Gapps.

Any hints? What might I did wrong?

Thanks for your help and keep up your good work!
[Miscellaneous Android Development] 21prods:
I did, so I wiped data and everything is working now.

Enviado desde mi Nexus 5 mediante Tapatalk
[Miscellaneous Android Development] ottmi:
The system partition is quite full. So better install the nano gapps and the missing apps later from Play Store. They will then be installed to the data partition that has plenty of space..
[Miscellaneous Android Development] cool400:
[MENTION=7319300]ottmi[/MENTION]: Thanks for your help, but also the Nano-Gapps are too big :-/

Am I the only one who can't install Gapps with this ROM? Is there a way to provide more space on the System partition?
[Miscellaneous Android Development] 21prods:
I always install pico gapps so I can access the Play Store. Therefrom I install any Google app I deem appropriate. I would say you can find anything there from Google.

Sorry I don't answer your query but I hope to be helpful

Enviado desde mi Nexus 5 mediante Tapatalk
[Miscellaneous Android Development] Dininthedrider:
For me many apps still incompatible. Even open camera is incompatible. I'm on the latest version
[Miscellaneous Android Development] Sampierdarena:
With the help of [MENTION=7319300]ottmi[/MENTION] I managed to install the latest release of the CM.

Finally the incompatibility of some application of Play Store have been resolved.

It seems to me that everything else functions admirably.

It seemed to me that the GPS functions more precisely, but maybe it's an impression.

Thanks to the legendary Ottmi, his works are always at the TOP
[Miscellaneous Android Development] ottmi:
That's odd. I've just installed Open Camera from Play Store.

Can you try reinstalling the ROM, but wipe the system partition first. No need to wipe data or do a factory reset. And remember to also reinstall gapps right after flashing the ROM.
[Miscellaneous Android Development] Dininthedrider:
I had to wipe data as well, because installer stopped with incompatible data partition message. After restoring data from TWRP apps became incompatible again, so I used Titanium backup instead. Now it is working flawlessly. Thank you for the development!!
[Miscellaneous Android Development] cool400:
Okay, it worked with Gapps Pico - thanks a lot! I installed all the other Google apps from the Playstore :)
[Miscellaneous Android Development] ottmi:
Quick heads-up on the next build:

any space issues with the system partition will be solved. Turns out that the actual partition is 1.8GB but I'm using only 1GB for the filesystem. So the next build will have 800M of extra space - that should be sufficient for any gapps package.

Also I will return to the generic CyanogenMod MSM8916 kernel. I had problems with this kernel earlier, with camera and sensors not working. I've solved the problems with the sensors (and actually improved sensitivity for the light sensor) and for now I've also fixed the camera problems by backporting the driver from mdeejay's Ark Benefit kernel. I also had to backport the touchpanel driver, but I'm quite confident to make it work without any backported drivers. All issues until now were due to errors in the devicetree..
[Miscellaneous Android Development] cool400:
That sounds awesome!

Can I simply install the new build over my existing installation or will I have to wipe and reinstall everything?

Gesendet von meinem HUAWEI CRR-L09 mit Tapatalk
[Miscellaneous Android Development] marcachas:
Really, you are the best, really thanks
[Miscellaneous Android Development] siljaer:
This is really a terrific achievement!
[Miscellaneous Android Development] 21prods:
Hats off! Simply incredible!

Enviado desde mi Nexus 5 mediante Tapatalk
[Miscellaneous Android Development] Sampierdarena:
Congratulations [MENTION=7319300]ottmi[/MENTION] Thanks for your wonderful work.

This device has a new life thanks to you! :good:
[Miscellaneous Android Development] cool400:
Can anyone please reply to my question, if a dirty flash is possible or if I have to reinstall everything?

Gesendet von meinem HUAWEI CRR-L09 mit Tapatalk
[Miscellaneous Android Development] 21prods:
Unless someone has managed to do it differently, you need to wipe data so yes, you'll have to reinstall everything although you don't need to erase your pictures or music (just apps and personal configuration).

I suggest you do a back-up of all important data before and then restore it.

Or you can wait until [MENTION=7319300]ottmi[/MENTION] or someone else finds a way to do a dirty flash.

Enviado desde mi Nexus 5 mediante Tapatalk
[Miscellaneous Android Development] siljaer:
With the latest release, Cyanogen's File Manager is not working properly with system files: when I try to edit them (integrated editor), it cannot load the file (it shows a blank page with "Loading...." at the bottom). When I go back, it does not display folders and files anymore. Can anyone confirm?

Edit: possibly related to SELinux. After I changed mixer_paths*.xml by changing permission and using a different editor, the trunk would not reboot. So I reflashed and I used SELinuxModeChanger to set "permissive". This way I was able to edit build.prop and mixer_paths*.xml and reboot successfully.
[Miscellaneous Android Development] ottmi:
This was only an issue with the 20160630 build as I have changed the signing keys. With all upcoming builds it should be possible to do a dirty flash - as it was with previous updates.

I got around wiping data by flashing it via fastboot, but for that you have to convert the sparse system.img from the update ZIP to a full image:

sdat2img.py system.transfer.list system.new.dat system.img
adb reboot bootloader
fastboot flash system system.img

sda2img.py can be found here:

https://github.com/xpirt/sdat2img
[Miscellaneous Android Development] ottmi:
I don't really know much about SELinux, but I suppose that's kind of what it is supposed to do :)

I'd imagine that we could add an SELinux rule for File Manager to grant access, but then again I'm not sure whether that's a good idea..
[Miscellaneous Android Development] siljaer:
I know less than you about SELinux, but I found that with a different file manager (Amaze) I can edit those files.

Problem is, after that the phone cannot boot. I don't know whether it's SELinux behaviour, however if I disable it, I can edit and reboot. Initially, I thought it was a signature problem. I should study the subject, though.