Index: dev/pci/azalia.c =================================================================== RCS file: /home/cvs/src/sys/dev/pci/azalia.c,v retrieving revision 1.266 diff -u -p -r1.266 azalia.c --- dev/pci/azalia.c 30 Oct 2021 03:24:59 -0000 1.266 +++ dev/pci/azalia.c 9 Nov 2021 21:37:03 -0000 @@ -279,6 +279,9 @@ int azalia_suspend(azalia_t *); int azalia_resume(azalia_t *); int azalia_resume_codec(codec_t *); +/* sysctl */ +int audio_hdmi_enable = 0; + /* variables */ struct cfattach azalia_ca = { sizeof(azalia_t), azalia_pci_match, azalia_pci_attach, @@ -954,9 +957,10 @@ azalia_init_codecs(azalia_t *az) c = -1; for (i = 0; i < az->ncodecs; i++) { codec = &az->codecs[i]; - if ((codec->audiofunc < 0) || - (codec->codec_type == AZ_CODEC_TYPE_HDMI)) - continue; + if(audio_hdmi_enable) + if ((codec->audiofunc < 0) || + (codec->codec_type == AZ_CODEC_TYPE_HDMI)) + continue; if (codec->codec_type == AZ_CODEC_TYPE_DIGITAL) { if (c < 0) c = i; Index: kern/init_sysent.c =================================================================== RCS file: /home/cvs/src/sys/kern/init_sysent.c,v retrieving revision 1.230 diff -u -p -r1.230 init_sysent.c --- kern/init_sysent.c 27 Oct 2021 03:25:11 -0000 1.230 +++ kern/init_sysent.c 9 Nov 2021 22:05:42 -0000 @@ -1,4 +1,4 @@ -/* $OpenBSD: init_sysent.c,v 1.230 2021/10/27 03:25:11 visa Exp $ */ +/* $OpenBSD$ */ /* * System call switch table. Index: kern/kern_sysctl.c =================================================================== RCS file: /home/cvs/src/sys/kern/kern_sysctl.c,v retrieving revision 1.396 diff -u -p -r1.396 kern_sysctl.c --- kern/kern_sysctl.c 30 Oct 2021 23:24:48 -0000 1.396 +++ kern/kern_sysctl.c 9 Nov 2021 21:23:30 -0000 @@ -126,6 +126,7 @@ extern fixpt_t ccpu; extern long numvnodes; extern int allowdt; extern int audio_record_enable; +extern int audio_hdmi_enable; extern int video_record_enable; int allowkmem; @@ -2427,13 +2428,17 @@ int sysctl_audio(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen) { + int error = 0; if (namelen != 1) return (ENOTDIR); - if (name[0] != KERN_AUDIO_RECORD) - return (ENOENT); + if (name[0] == KERN_AUDIO_RECORD) + error = sysctl_int(oldp, oldlenp, newp, newlen, &audio_record_enable); - return (sysctl_int(oldp, oldlenp, newp, newlen, &audio_record_enable)); + if (name[0] == KERN_AUDIO_HDMI) + error = sysctl_int(oldp, oldlenp, newp, newlen, &audio_hdmi_enable); + + return (error); } #endif Index: sys/sysctl.h =================================================================== RCS file: /home/cvs/src/sys/sys/sysctl.h,v retrieving revision 1.219 diff -u -p -r1.219 sysctl.h --- sys/sysctl.h 30 Oct 2021 23:24:48 -0000 1.219 +++ sys/sysctl.h 7 Nov 2021 18:52:34 -0000 @@ -317,11 +317,13 @@ struct ctlname { * KERN_AUDIO */ #define KERN_AUDIO_RECORD 1 -#define KERN_AUDIO_MAXID 2 +#define KERN_AUDIO_HDMI 2 +#define KERN_AUDIO_MAXID 3 #define CTL_KERN_AUDIO_NAMES { \ { 0, 0 }, \ { "record", CTLTYPE_INT }, \ + { "hdmi", CTLTYPE_INT }, \ } /*