0

Setting channel status bits not working

I've been playing around with the hifiberry_digi and wm8804 drivers trying to figure out how to flip the copyright assertion bit on the SPDIF output (setting 0x04 on SPDTX1 to 1). Here's what I've tried

1) I've tried in hifiberry_digi.c to set the bit with

snd_soc_update_bits(codec, WM8804_SPDTX1, 0x4, 0x4);

to flip the bit and

snd_soc_update_bits(codec, WM8804_SPDTX4, 0x800x80);

to set TXSTATSRC to 1 before and after turning on Tx in snd_rpi_hifiberry_digi_init

2) changing the default value of SPDTX1 in wm8804.c from 0x00 to 0x04

3) After applying a patch to dump the values of the registers to /proc, as an experiment, I played a local file to Tx and used a cable to loop it back to the input and record. Tx source is set to AIF. Here's the reading I'm getting from the registers

pwrdn:    0x00
pll      ON
spdif rx ON
spdif tx ON
osc      ON
aif      ON
trio     ON
prescale  1
pll_n     6
pll_k     0x3f19e5
freq mode 0x02
pll clock 11788799 Hz
spdstat:  0x00
lock     ON
rec freq 192 Khz
rxchan1:  0x00
rxchan2:  0x00
rxchan3:  0x00
rxchan4:  0x30
ind freq 44.1 Khz
rxchan5:  0x0b
org freq 44.1 Khz
intstat:   0x8d
spdrx1:   0x80
spdtx1:   0x04
spdtx2:   0x00
spdtx3:   0x00
spdtx4:   0xf0
spdtx5:   0x0b
gpo0:   0x70
gpo1:   0x57
gpo2:   0x42

So it looks like spdtx1 is set correctly, the receiver is locked onto the correct frequency, but the value of rxchan1 is 0x00 instead of 0x04

4) When I play to HDMI out, send it to an audio extractor, then capture the SPDIF, I get this
pwrdn:    0x00
pll      ON
spdif rx ON
spdif tx ON
osc      ON
aif      ON
trio     ON
prescale  1
pll_n     6
pll_k     0x3f19e5
freq mode 0x02
pll clock 11788799 Hz
spdstat:  0x24
lock     ON
rec freq 48 or 44.1 Khz
rxchan1:  0x04
rxchan2:  0x00
rxchan3:  0x00
rxchan4:  0x00
ind freq 44.1 Khz
rxchan5:  0xfb
org freq ? Khz
intstat:   0xaf
spdrx1:   0x80
spdtx1:   0x04
spdtx2:   0x00
spdtx3:   0x00
spdtx4:   0xf0
spdtx5:   0x0b
gpo0:   0x70
gpo1:   0x57
gpo2:   0x42

so the correct value is set on rxchan1

Any ideas?

1 comment

Please sign in to leave a comment.