[Samsung Galaxy S7 Edge Questions and Answers] schuppus:
Hello gals and guys, you are my last hope.

I have a Galyxy S7 Edge G935F bought in Germany with no sim lock, i got it with G935FXXU1APAW, updated to G395FXXU1APC8. Yesterday i rooted it with CF-Auto-Root-hero2lte-hero2ltexx-smg935f based on XXU1APBF. I still have stock recovery.

The Problem:

Sometimes, while sleeping, the phone disables all sound.

This happens mostly while recharging, but it happened also while simply sleeping and not recharging. It is not reliably reproducable, sometimes the phone works for 2 or 3 days without the error occurring. Which makes the error very hard to find of course.

Sound off means: No media output is working (games, video, music), notifications are not sounding only vibrate, the phone doesn't ring when someone calls, just vibrates. No calls and notifications means, this is very severe.

When i plug in earphones or headphones, there is also no sound on the headphones. Putting in and pulling out the headphones does not reactivate the sound, so it seems not to be a problem with the headphone jack. The jack is very loose, though, doesnt hold the headphones strongly; but thats another problem.

The sound can be reactivated by the following:

- rebooting

- calling someone (i used to call my provider) or getting called (the first call gets lost, but when i get a second call, it works again)

- i installed an app called SoundAbout, which lets me route the sound to different outputs. I must first route media output to "earpiece" (the small loudspeaker you hold on your ear during calls) and then route the media back to "Speaker". Only this combination reactivates the sound again. Just activating "Speaker" or any other combination like for example first "Wired Phones" and then "Speaker" does not work. It must be "earpiece" and then "Speaker".

What i tried, without success:

- deleted all bluetooth devices

- disabled bluetooth

- enabled "prevent USB audio routing" in dev options

- uninstalled all kinds of apps having to do with sound or lockscreen

- played with all kinds of settings having to do with sound or lockscreen

I searched everywhere. A call to Samsung was not very helpful either. I might have to try a factory reset after all, but even if its good at factory, i still won't know the culprit.

But since the problem can be solved via software, i suspect it is software related or is at least diagnoseable via software.

Of course, it would be insanely awesome when someone could just present me the solution, but i would do all the debugging myself, if i only could.

I am a developer myself, but only on windows. My experiences on linux don't go much further than doing an "ls -la" on commandline and i am a total noob on android. I will not be afraid of using a terminal or adb, as long as i am guided a bit.

I hope, somebody can point me out how to diagnose and this thing.

Can one diagnose the current state of audio routing ? Can i manipulate it via commandline ? Are there other relevant components which i need to query ?

Could i write a script that pulls those queries every minute or so ?

And finally, if the wrong settings are found, are there log files which can point out who messed with those settings. Which apps would you recommend for those actions ?

Thanks to everyone in advance ...