Re: Digital audio out no longer working?

2018-06-24 Thread Landry Breuil
On Sat, Jun 23, 2018 at 08:48:57PM +0100, Laurence Tratt wrote:
> On Sat, Jun 23, 2018 at 06:43:04PM +0200, Alexandre Ratchov wrote:
> 
> Hello Alexandre,
> 
> >> 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?
> 
> I am happy to confirm that this completely solves the problem. Thanks so much
> for doing this!

Also fixes mixerctl on a secondary device/mic, before the patch:

$mixerctl -f /dev/mixer1 -av
record.enable=sysctl  [ off on sysctl ]

After the patch:

$mixerctl -f /dev/mixer1 -av
record.mic.mute=off  [ off on ]
record.mic=191 volume
record.enable=sysctl  [ off on sysctl ]

Thanks !

Landry



Re: Digital audio out no longer working?

2018-06-23 Thread Laurence Tratt
On Sat, Jun 23, 2018 at 06:43:04PM +0200, Alexandre Ratchov wrote:

Hello Alexandre,

>> 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?

I am happy to confirm that this completely solves the problem. Thanks so much
for doing this!


Laurie
-- 
Personal http://tratt.net/laurie/
Software Development Teamhttp://soft-dev.org/
   https://github.com/ltratt  http://twitter.com/laurencetratt



Re: Digital audio out no longer working?

2018-06-23 Thread Alexandre Ratchov
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
>
> dera...@amd64.openbsd.org:/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 -  1.171
+++ audio.c 23 Jun 2018 16:33:24 -
@@ -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 +,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));



Digital audio out no longer working?

2018-06-15 Thread Laurence Tratt


>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
 
dera...@amd64.openbsd.org:/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".

  $ mixerctl
  inputs.dac-0:1=126,126
  inputs.dac-2:3=126,126
  inputs.dac-4:5=126,126
  inputs.dac-6:7=126,126
  record.adc-0:1_mute=off
  record.adc-0:1=125,125
  record.adc-2:3_mute=off
  record.adc-2:3=125,125
  inputs.mix_source=mic,mic2,line-in,hp,line
  inputs.mix_mic=120,120
  inputs.mix_mic2=120,120
  inputs.mix_line-in=120,120
  inputs.mix_hp=120,120
  inputs.mix_line=120,120
  inputs.mix2_source=dac-0:1,mix
  inputs.mix3_source=dac-2:3,mix
  inputs.mix4_source=dac-4:5,mix
  inputs.mix5_source=dac-6:7,mix
  outputs.SPDIF_source=dig-dac-0:1
  outputs.line_source=mix2
  outputs.line_mute=off
  outputs.line_dir=output
  outputs.line_boost=off
  outputs.line_eapd=on
  outputs.mic_source=mix3
  outputs.mic_mute=off
  inputs.mic=85,85
  outputs.mic_dir=input-vr80
  outputs.mic2_source=mix8
  outputs.mic2_mute=off
  inputs.mic2=85,85
  outputs.mic2_dir=input-vr80
  outputs.mic2_boost=off
  outputs.line-in_source=mix4
  outputs.line-in_mute=off
  inputs.line-in=85,85
  outputs.line-in_dir=input
  outputs.hp_source=mix5
  outputs.hp_mute=off
  inputs.hp=85,85
  outputs.hp_dir=output
  outputs.hp_boost=off
  outputs.hp_eapd=on
  record.adc-2:3_source=mic,mic2,line-in,hp,line,mix
  record.adc-0:1_source=mic,mic2,line-in,hp,line,mix
  inputs.dac-8:9=126,126
  inputs.mix8_source=dac-8:9,mix
  outputs.line_sense=unplugged
  outputs.mic_sense=plugged
  outputs.mic2_sense=unplugged
  outputs.line-in_sense=unplugged
  outputs.hp_sense=unplugged
  outputs.master=126,126
  outputs.master.mute=off
  outputs.master.slaves=dac-0:1,dac-6:7,line,hp
  record.volume=125,125
  mixerctl: Invalid format.
  volume.record=%
$

dmesg:
OpenBSD 6.3-current (GENERIC.MP) #14: Thu Jun 14 23:55:47 MDT 2018
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 17028538368 (16239MB)
avail mem = 16372215808 (15613MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.0 @ 0xc3202000 (89 entries)
bios0: vendor American Megatrends Inc. version "3402" date 07/10/2017
bios0: ASUSTeK COMPUTER INC. Z170M-PLUS
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT BGRT MCFG SSDT FIDT SSDT SSDT HPET SSDT SSDT 
UEFI SSDT LPIT WSMT SSDT SSDT DBGP DBG2
acpi0: wakeup devices PEGP(S4) PEG0(S4) PEGP(S4) PEG1(S4) PEGP(S4) PEG2(S4) 
SIO1(S3) UAR1(S4) PXSX(S4) RP09(S4) PXSX(S4) RP10(S4) PXSX(S4) RP11(S4) 
PXSX(S4) RP12(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz, 4011.39 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 23MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz, 4009.90 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbu