My understanding is that the RK3399's GPIO0_B0 line receives the interrupt as generated by the headphones jack, but the schematics doesn't seem to provide the actual details how (what goes beyond CN3, the daughterboard, doesn't seem to be documented).
The same connection to the headphones jack that generates the interrupt to the SoC also goes to the GPIO1 line of the ES8316 audio codec, to inform it too, which seems to be required in the ES8316 datasheet.
Edit: Music playback through the internal speakers works fine, despite having 33 as the current interrupt count, which is weird. Furthermore, after inserting the headphones, the count went to 34, with the headphones working as expected and muted speakers. After unplugging the headphones, the count went to 36 (not 35), which is even more weird, but the speakers work as expected.
Edit #2: After inserting the headphones again, the interrupt count went to 37. After unplugging the headphones, it went to 40. Anyway, the music playback works as expected, which should be up to the Linux kernel driver reconfiguring the audio routing according to the actual RK3399 GPIO line state, instead of according to the related interrupt count.
The same connection to the headphones jack that generates the interrupt to the SoC also goes to the GPIO1 line of the ES8316 audio codec, to inform it too, which seems to be required in the ES8316 datasheet.
Edit: Music playback through the internal speakers works fine, despite having 33 as the current interrupt count, which is weird. Furthermore, after inserting the headphones, the count went to 34, with the headphones working as expected and muted speakers. After unplugging the headphones, the count went to 36 (not 35), which is even more weird, but the speakers work as expected.
Edit #2: After inserting the headphones again, the interrupt count went to 37. After unplugging the headphones, it went to 40. Anyway, the music playback works as expected, which should be up to the Linux kernel driver reconfiguring the audio routing according to the actual RK3399 GPIO line state, instead of according to the related interrupt count.