[alsa-devel] Create a general function for codec jack detection