as described in Arch wiki. There is also some new suspend code written by a user but I've never tested it https://github.com/l29ah/proxyoss.
About jack detection I don't really know what's the matter there. Everything seems to work for me.
EDIT: How can one check if jack detection works?