On Fri, Jun 15, 2018 at 09:56:13AM +0100, Laurence Tratt wrote:
> 
> >Synopsis:    digital audio out no longer working?
> >Environment:
>       System      : OpenBSD 6.3
>       Details     : OpenBSD 6.3-current (GENERIC.MP) #14: Thu Jun 14 23:55:47 
> MDT 2018
>                        
> [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> 
>       Architecture: OpenBSD.amd64
>       Machine     : amd64
> >Description:
>     As of the last two snapshots, digital audio out via S/PDIF on my machine
>     no longer works:
> 
>       $ doas mixerctl outputs.mode=digital
>       mixerctl: field outputs.mode does not exist
> 
>     There also seems to be something odd with mixerctl's output which may or 
> may
>     be related? Note the "invalid format" near the end and the incomplete
>     formatting of "volume.record".
> 

Could you confirm that this diff fixes the problem?

Thanks.

Index: audio.c
===================================================================
RCS file: /cvs/src/sys/dev/audio.c,v
retrieving revision 1.171
diff -u -p -u -p -r1.171 audio.c
--- audio.c     26 May 2018 10:16:13 -0000      1.171
+++ audio.c     23 Jun 2018 16:33:24 -0000
@@ -1088,20 +1088,13 @@ audio_attach(struct device *parent, stru
 
        mi = malloc(sizeof(struct mixer_devinfo), M_TEMP, M_WAITOK);
 
-       sc->mix_nent = 0;
        mi->index = 0;
        while (1) {
                if (sc->ops->query_devinfo(sc->arg, mi) != 0)
                        break;
-               switch (mi->type) {
-               case AUDIO_MIXER_SET:
-               case AUDIO_MIXER_ENUM:
-               case AUDIO_MIXER_VALUE:
-                       sc->mix_nent++;
-               }
                mi->index++;
        }
-
+       sc->mix_nent = mi->index;
        sc->mix_ents = mallocarray(sc->mix_nent,
            sizeof(struct mixer_ctrl), M_DEVBUF, M_WAITOK);
 
@@ -1118,9 +1111,9 @@ audio_attach(struct device *parent, stru
                case AUDIO_MIXER_ENUM:
                        ent->dev = mi->index;
                        ent->type = mi->type;
-                       ent++;
                }
                mi->index++;
+               ent++;
        }
 
        free(mi, M_TEMP, sizeof(struct mixer_devinfo));

Reply via email to