[T-Mobile, Samsung Galaxy SIII] kimchanjun:
Hello and sorry for my english.

my phone is sgh-t999 (d2tmo) with latest baseband is T999UVUEOH1.

Im try install many custom rom via TWRP 3.0.2.0 but all of rom i installed still no sound when plug headset until restart my phone.

With stock rom is normal ( no have this bug)

List rom i tried:

cm-12.1-20151117-SNAPSHOT-YOG7DAO1K7-d2tmo

cm-13.0-20161118-NIGHTLY-d2tmo

MK51.1-d2tmo-160420-HISTORY

pac_d2tmo_MM.Beta.Official_20160920-165602

pac_d2tmo_LP-MR1.Official_20160427-075538

OCT-M-R3-6.0.1-20161025-d2tmo

Resurrection_Remix_KK_v5.1.5-20140624-d2lte

Logcat i got when use cm12.1

V/WiredAccessoryManager( 583): Headset UEVENT: {SUBSYSTEM=switch, SEQNUM=2811, ACTION=change, SWITCH_STATE=1, SWITCH_NAME=h2w, DEVPATH=/devices/virtual/switch/h2w}

V/WiredAccessoryManager( 583): newName=h2w newState=1 headsetState=1 prev headsetState=0

D/EventHub( 583): No input device configuration file found for device 'sec_jack'.

W/EventHub( 583): Unable to disable kernel key repeat for /dev/input/event13: Function not implemented

I/EventHub( 583): New device: id=13, fd=210, path='/dev/input/event13', name='sec_jack', classes=0x1, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false, wakeMechanism=EVIOCSSUSPENDBLOCK, usingClockIoctl=true

I/InputReader( 583): Device added: id=13, name='sec_jack', sources=0x00000101

V/WiredAccessoryManager( 583): device h2w connected

W/AudioPolicyManager( 691): checkOutputsForDevice() could not open output for device 4

D/AudioHardwareALSA( 691): useCase HiFi

D/ALSADevice( 691): route: devices 0x4 in mode 0

D/ALSADevice( 691): No valid input device: 0

D/alsa_ucm( 691): snd_use_case_set(): uc_mgr 0xb8b7b470 identifier _disdev value Speaker

D/alsa_ucm( 691): disdev: device Speaker not enabled, no need to disable

D/alsa_ucm( 691): snd_use_case_set(): uc_mgr 0xb8b7b470 identifier _enadev value Headphones

D/ALSADevice( 691): switchDevice: mCurTxUCMDevivce None mCurRxDevDevice Headphones

I/ALSADevice( 691): a2220: txDevice=(null) rxDevice=Headphones

D/alsa_ucm( 691): snd_use_case_set(): uc_mgr 0xb8b7b470 identifier _verb value HiFi

D/alsa_ucm( 691): Set mixer controls for Headphones enable 1

D/alsa_ucm( 691): acdb_id 10 cap 1 enable 1

D/ACDB-LOADER( 691): ACDB -> send_audio_cal, acdb_id = 10, path = 0

D/ACDB-LOADER( 691): ACDB -> send_adm_topology

D/ACDB-LOADER( 691): ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TOPOLOGY_ID

D/ACDB-LOADER( 691): ACDB -> send_audtable

D/ACDB-LOADER( 691): ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TABLE

D/ACDB-LOADER( 691): ACDB -> AUDIO_SET_AUDPROC_CAL

D/ACDB-LOADER( 691): ACDB -> send_audvoltable

D/ACDB-LOADER( 691): ACDB -> ACDB_CMD_GET_AUDPROC_GAIN_DEP_VOLTBL_STEP_COPP

D/ACDB-LOADER( 691): ACDB -> AUDIO_SET_AUDPROC_VOL_CAL

D/ACDB-LOADER( 691): ACDB -> AUDIO_SET_AFE_CAL

D/alsa_ucm( 691): Setting mixer control: PRI_RX Channels, value: Two

D/alsa_ucm( 691): Setting mixer control: RX1 MIX1 INP1, value: RX1

D/alsa_ucm( 691): Setting mixer control: RX2 MIX1 INP1, value: RX2

D/alsa_ucm( 691): Setting mixer control: HPHL DAC Switch, value: 1

D/alsa_ucm( 691): Setting mixer control: HPHL Volume, value: 100

D/alsa_ucm( 691): Setting mixer control: HPHR Volume, value: 100

D/alsa_ucm( 691): Setting multi value: RX1 Digital Volume

D/alsa_ucm( 691): Setting multi value: RX2 Digital Volume

D/alsa_ucm( 691): Set mixer controls for HiFi enable 1

D/alsa_ucm( 691): Setting mixer control: PRI_RX Audio Mixer MultiMedia1, value: 1

D/ALSADevice( 691): close: handle 0xb8c2ad90 h 0x0

D/ALSADevice( 691): open: handle 0xb8c2ad90, format 0x2

D/ALSADevice( 691): Device value returned is hw:0,0

D/ALSADevice( 691): handle->format: 0x2

D/ALSADevice( 691): setHardwareParams: reqBuffSize 2048 channels 2 sampleRate 48000

D/ALSADevice( 691): setHardwareParams: buffer_size 16384, period_size 2048, period_cnt 8

W/AudioFlinger( 691): direct output implements pause but not resume

I/AudioFlinger( 691): HAL output buffer size 512 frames, normal sink buffer size 512 frames

W/AudioPolicyManager( 691): checkOutputsForDevice() could not open output for device 4

I/AudioFlinger( 691): AudioFlinger's thread 0xb8bff830 ready to run

D/ALSADevice( 691): standby: handle 0xb8c2ad90 h 0x0

D/alsa_ucm( 691): snd_use_case_set(): uc_mgr 0xb8b7b470 identifier _verb value Inactive

D/alsa_ucm( 691): Set mixer controls for HiFi enable 0

D/alsa_ucm( 691): Setting mixer control: PRI_RX Audio Mixer MultiMedia1, value: 0

D/alsa_ucm( 691): snd_use_case_set(): uc_mgr 0xb8b7b470 identifier _disdev value Headphones

D/alsa_ucm( 691): Set mixer controls for Headphones enable 0

D/alsa_ucm( 691): Setting mixer control: RX1 MIX1 INP1, value: ZERO

D/alsa_ucm( 691): Setting mixer control: RX2 MIX1 INP1, value: ZERO

D/alsa_ucm( 691): Setting mixer control: HPHL DAC Switch, value: 0

D/alsa_ucm( 691): Setting mixer control: HPHL Volume, value: 0

D/alsa_ucm( 691): Setting mixer control: HPHR Volume, value: 0

D/alsa_ucm( 691): Setting mixer control: RX1 Digital Volume, value: 0

D/alsa_ucm( 691): Setting mixer control: RX2 Digital Volume, value: 0

D/AudioUsbALSA( 691): exitPlaybackThread, mproxypfdPlayback: -1

D/AudioUsbALSA( 691): closeDevice handle 0x0

D/AudioUsbALSA( 691): closeDevice handle 0x0

D/AudioUsbALSA( 691): exitPlaybackThread, mproxypfdPlayback: -1

D/AudioUsbALSA( 691): closeDevice handle 0x0

D/AudioUsbALSA( 691): closeDevice handle 0x0

D/ALSAStreamOps( 691): close

D/ALSAStreamOps( 691): close() : Found mHandle 0xb8c2ad90, proceeding to close

D/ALSADevice( 691): close: handle 0xb8c2ad90 h 0x0

D/ALSAStreamOps( 691): close

D/ALSAStreamOps( 691): close() : Found mHandle 0xb8c2ad90, proceeding to close

D/ALSADevice( 691): close: handle 0xb8c2ad90 h 0x0

D/ALSAStreamOps( 691): setParameters(): keyRouting with device 0x0

E/ALSAStreamOps( 691): must not change mDevices to 0

I/HeadsetService( 1053): Headset=true; Bluetooth=false ; USB=false

I/HeadsetService( 1053): Preferences updated.

D/AudioHardwareALSA( 691): openInputStream: devices 0x1000000 format 0x1 channels 49168 sampleRate 48000

I/AudioFlinger( 691): AudioFlinger's thread 0xb3f64008 ready to run

D/AudioStreamInALSA( 691): close

D/AudioStreamInALSA( 691): Deregistering REC bit, musbRecordingState:0

D/AudioStreamInALSA( 691): close

D/AudioHardwareALSA( 691): Closing USB Recording Session as no stream is active

D/AudioUsbALSA( 691): exitRecordingThread

D/AudioUsbALSA( 691): write to fd

D/AudioUsbALSA( 691): closeDevice handle 0x0

D/AudioUsbALSA( 691): closeDevice handle 0x0

D/ALSAStreamOps( 691): close

D/ALSAStreamOps( 691): close() : Found mHandle 0xb8c39e60, proceeding to close

D/ALSADevice( 691): close: handle 0xb8c39e60 h 0x0

D/ALSAStreamOps( 691): close

D/ALSAStreamOps( 691): close() : Found mHandle 0xb8c39e60, proceeding to close

D/ALSADevice( 691): close: handle 0xb8c39e60 h 0x0

W/InputMethodSettingValuesWrapper( 1007): Invalid selected imi: com.android.inputmethod.latin/.LatinIME

D/Index ( 1007): Indexing locale 'vi_VN' took 529 millis

So some one can give a way to fix it. Thank you so much!