ngoquang2708 / android_device_samsung_vivalto3gvn

Device tree for Samsung Galaxy V SM-G313HZ
7 stars 8 forks source link

cm-13.0: audio not work #41

Closed ngoquang2708 closed 8 years ago

ngoquang2708 commented 8 years ago

Audio is not work because the audio module cannot access /dev/snd/controlC%d due to permission denies. Need to find out what service load audio module and set a proper user or group for it. My first guess is mediaserver, but it already had system group, which is /dev/snd/controlC%d has. Don't know why audio module cannot access it though.

ngoquang2708 commented 8 years ago

Working now with this 71d544bfe690c8cec1699e4988bea30358a0b28a. Need a better solution.

ngoquang2708 commented 8 years ago

Fixed by https://github.com/ngoquang2708/android_system_core/commit/838a95a878be4b1f708fff64a7edba3c57e09057.

ngoquang2708 commented 8 years ago

Stop working again after rebase upstream.

ngoquang2708 commented 8 years ago

@koquantam This thing look like crap again :(

diepquynh commented 8 years ago

We're back with CM-11.0 :D

diepquynh commented 8 years ago

Did you tried REmarking mediaserver as root user?

ngoquang2708 commented 8 years ago

OMG, sound back again. I hate it so much.

diepquynh commented 8 years ago

How? Randomly?

ngoquang2708 commented 8 years ago

Recompile the source again, and it work again. Don't know why :(

ngoquang2708 commented 8 years ago

Found some interesting things. We didn't use audio_policy.*.so at all since CM-12.1. Deleted all of them, and sound stills working. Then, I discovered that, CM-12.1 use libaudiopolicymanagerdefault.so. So we should focus on them. The source is located at frameworks/av/services/audiopolicy.

diepquynh commented 8 years ago

Lol, I known that lib :D but thought it was in hardware frameworks

ngoquang2708 commented 8 years ago

Found some thing interesting. I can route audio from mic to speaker by echo 1,2,7 > /dev/pipe/mmi.audio.ctrl, route to earpiece by echo 1,1,7 > /dev/pipe/mmi.audio.ctrl. I don't known the way android route app's sound to speaker. Any ideas? @koquantam @corphish

ngoquang2708 commented 8 years ago

Seem this fix our issue completely https://github.com/ngoquang2708/android_device_samsung_vivalto3gvn/commit/0f9e32856267bac253ccb3bd07dc869604177464. I try 1 clean build with that flag enabled and another clean build with that flag disabled to confirm it. @koquantam If you have time, pleases confirm this.

diepquynh commented 8 years ago

OK, CM12.1 is done with me, now I'm doing for our vivalto

diepquynh commented 8 years ago

Making clean build now

diepquynh commented 8 years ago

This situation was just like RIL :D One BoardConfig flag solves all

ngoquang2708 commented 8 years ago

Hope so :)

diepquynh commented 8 years ago

Confirmed

diepquynh commented 8 years ago

I think we have already known this happen while reading the commit message from your referenced commit

diepquynh commented 8 years ago

Hmm... somehow audio doesn't work again o.O

ngoquang2708 commented 8 years ago

Aggh, just happened to me with the last build, again. Doing a clean build, again :(

ngoquang2708 commented 8 years ago

Since CM-11.0, this audio issue is always suck.

diepquynh commented 8 years ago

Totally sucks

ngoquang2708 commented 8 years ago

But at least it works for you the first time, right :)

diepquynh commented 8 years ago

I guess, this is our problem 06-28 11:50:49.637 251 251 E TinyAlsaUtils: open snd control failed.

ngoquang2708 commented 8 years ago

I just restart an audio is working again, what the heck! FALSE ALARM~

diepquynh commented 8 years ago

Oh you've told in description :D

ngoquang2708 commented 8 years ago

About this:

06-28 12:01:30.284   148   148 E TinyAlsaUtils: open snd control failed: No such file or directory

I have it too, it just cannot open one card, we have 3 we have 4:

06-28 12:01:30.284   148   148 I audio_hw_primary: s_tinycard = 0, s_vaudio = -1,s_voip = 2, s_bt_sco = 3,s_vaudio_w is 1
diepquynh commented 8 years ago

Should we use again the mediaserver hack?

ngoquang2708 commented 8 years ago

mediaserver already had the right permission to access /dev/snd/*. The fact is that audio work for some times. But we should try. About my previous comment about sound working again after reboot, sorry, false alarm. I am using my other build that with audio working, not my latest build :(

ngoquang2708 commented 8 years ago

Can I ask you that your audio stop working with different builds or with the same build?

diepquynh commented 8 years ago

It work for the first time in the last build from yesterday, then stopped working after ONE RESTART LOL

ngoquang2708 commented 8 years ago

OK, one more clue.

diepquynh commented 8 years ago

That's all :D

diepquynh commented 8 years ago

If we have to touch mediaserver again, then I think it's init problem (system/core)

Edit: The hack isn't working anymore LOL

ngoquang2708 commented 8 years ago

Try this magic.diff.zip.

diepquynh commented 8 years ago

Is that real magic? :D

ngoquang2708 commented 8 years ago

Yes

diepquynh commented 8 years ago

OK, gonna try with my Core Prime :D

Seems everything in our tree works with it

ngoquang2708 commented 8 years ago

Do not need to make a clean build, just rebuild audio.primary.scx15.so.

diepquynh commented 8 years ago

Right

diepquynh commented 8 years ago

Btw, how to rebuild a blob only? Just "mka bacon" or something else?

ngoquang2708 commented 8 years ago

cd to that audio dir then mm

ngoquang2708 commented 8 years ago

Use mmp, it will push to your phone automatically using adb.

diepquynh commented 8 years ago

Wow, thanks

ngoquang2708 commented 8 years ago

You never read CM's Wiki, right :)

ngoquang2708 commented 8 years ago

Tons of great things there.

diepquynh commented 8 years ago

I just know basic parameters, like mka :D

ngoquang2708 commented 8 years ago

I've read it, and I missed that mka, until you told me.

diepquynh commented 8 years ago

LOL