What I have tried:
I have tried USB earphones and mic, both works perfectly, So it should not be Sound/Audio issue in Android.
If I keep earphones plugged in during boot, PC shuts down at "Initializing" Step. So I think it's a kernel issue. But there is no stacktrace in last_kmsg.
I have tried logcat and bugreport to get some information about this. Logcat has no error or even output between inserting jack and System crash.Bugreport have too much information and I am not able to find anything about crash.
/proc/last_kmsg doesn't exist. /dev/kmsg has output regarding other usb devices/apps. But, it fails to show/save anything in the output after connecting jack. It just shuts down.
- It is not a hardware issue, because both windows 8.1 and xubuntu 18.04 are running without any mic/audio problem in same laptop.
UPDATE 1: It is now confirm that the issue is in android 7.1.1 x86 build, Specificaly with kernel. I tried Default Androidx86 7.1.1 build, redmi os, prmieos. All are based on 7.1.1 (nougat) and had this bug. But Android x86 8.1 oreo builds seems to have resolved this bug. Now, I need to wait for phoenix os to upgrade. One thing i tried is to replace the phoenix nougat kernel with android orea kernel and it booted fine, but no drivers compatibility. Graphics, audio wifi didn't work. I need to replace files too, but i have no idea which one.
People on XDA forums has done it, But I couldn't achieve that possibly because I don't have that much Knowledge about this.
How can I succesfully update kernel and drivers?