Subject: Re: S/PDIF Sound
To: None <520079546242-0001@t-online.de>
From: Ernst du Toit <et@houseofet.com>
List: port-i386
Date: 05/15/2002 11:18:01
Are you running -current for the SPDIF functionality?

I'm on 1.5.2 using driver:
$NetBSD: cmpci.c,v 1.3.2.1 2000/06/30 16:27:49 simonb Exp $

mixerctl(1) gives me:

$ mixerctl -f /dev/mixer1  -a
outputs.master=128,128
inputs.fmsynth=128,128
inputs.fmsynth.mute=off
inputs.fmsynth.swap=off
inputs.cd=128,128
inputs.cd.mute=off
inputs.cd.swap=off
outputs.cd.mute=on
outputs.dac=128,128
inputs.mic=0
inputs.mic.mute=off
inputs.mic.swap=off
outputs.mic.mute=on
inputs.line=0
inputs.line.mute=off
inputs.line.swap=off
outputs.line.mute=on
record.source=mic
equalization.treble=128,128
equalization.bass=128,128
inputs.pc_speaker=128,128
inputs.input=128,128
outputs.output=128,128
inputs.agc=off
$

(I've got audio0 as my onboard audio and audio1 as the CMI8738)

So either one needs -current or my 8738 is the SX or LX version that does
not have SPDIF support. From the data sheet it looks like the chips are pin
compatible, so the manufacturer could have placed the lower spec chip on the
board and left the connectors off.

I'll have to pull the card tonight to confirm my theory.

--et

> Ernst du Toit wrote:
> 
>> Currently I'm only interested in SPDIF-out anyway, so that sounds
>> good.
>> 
>> I assume this is with the cmpci driver, I have a 'budget' CM8738 card:
>> 
>> cmpci0 at pci0 dev 8 function 0: CMI8738 PCI Audio Device
>> cmpci0: interrupting at irq 5
>> audio1 at cmpci0: full duplex, mmap, independent
> 
> Yes, that's the device I'm using.
> 
>> Is there any magic in mixerctl(1) to get the SPDIF port to output?
>> Running mixerctl(1) against this card does not show anything related
>> that hits at it.
> 
> 1. enable SPDIF output:
> # mixerctl -w playback.mode=spdif
> 
> 2. set the correct voltage
> # mixerctl -w spdif.output.voltage=5V
> or (not recommended)
> # mixerctl -w spdif.output.voltage=0.5V
> 
> 5V should be the correct setting for *optical* devices. 0.5V should be
> used with coax devices. AFAIK the settings have the vice-versa effect.
> Someone has send me a patch for it but it hasn't been comitted to
> current, yet. BTW, this chip supports SPDIF with 44.1kHz and 48KHz,
> only.
> NetBSD-current has a bug here, too. If you use 48kHz you cannot use a
> lower frequency any longer (without screwed sound). I've received a
> patch for this problem, too. But it has not been comitted to current,
> either.
> 
> These is the complete output from mixerctl:
> 
> inputs.dac=192,192
> inputs.dac.mute=off
> inputs.fmsynth=192,192
> inputs.fmsynth.mute=off
> inputs.cd=0,0
> inputs.cd.mute=on
> inputs.line=0,0
> inputs.line.mute=on
> inputs.aux=0,0
> inputs.aux.mute=on
> inputs.mic=0
> inputs.mic.mute=on
> inputs.mic.preamp=off
> inputs.speaker=128
> record.source=
> record.mic=0
> playback.mode=spdif
>spdif.input=spdin1
>spdif.input.phase=positive
>spdif.output=playback
>spdif.output.playback=wave
>spdif.output.voltage=5V
>spdif.monitor=off
> outputs.master=128,128
> outputs.rear=on
> outputs.rear.individual=on
> outputs.rear.reverse=off
> outputs.surround=off
> 
>> My card did not have the SPDIF interface supplied, but there is space
>> for the header to plug in on the card, so it might be possible that
>> the chip is strapped not to provide the functionality?
> 
> Well, I cannot tell you whether a device attached to that header will
> work. You should at least use a volt meter before you try anything, to
> be sure nothing will be damaged. BTW, I was rather surprised to find
> out my years-old CD-ROM has a S/PDIF output which can be used with this
> card (haven't used this under NetBSD, yet).