Subject: Re: S/PDIF Sound
To: None <muc-lists-netbsd-port-i386@moderators.muc.de>
From: Michael Core <520079546242-0001@t-online.de>
List: port-i386
Date: 05/14/2002 23:54:03
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).