VS1103. Volume linein.

Writing software for systems that use VLSI Solution's devices as slave codecs to a host microcontroller.
Post Reply
_Sam_
User
Posts: 10
Joined: Thu 2013-01-24 16:59

VS1103. Volume linein.

Post by _Sam_ » Thu 2016-11-24 1:33

SCI_MODE = SM_INCONF_SCI_MIDI_SDI_ADPCM | SM_DIFF | SM_LINE_IN | SM_OUTOFFMIDI

Volume for SDI_ADPCM very nice, but linein small volume. As if the SM_DIFF does not apply to A/D to DAC path. If i'm disable SM_DIFF volume SDI_ADPCM and LINEIN equally small.

On page 29 datasheet on VS1103 version 1.03:
When SM_DIFF is set, the player inverts the left channel output. For a stereo input this creates
virtual surround, and for a mono input this creates a differential left/right signal.
Differential left/right signal creates from A/D input or only from mono ADPCM stream?

My schematic in attach
Attachments
Schematic Prints.pdf
(57.76 KiB) Downloaded 44 times

User avatar
Henrik
VLSI Staff
Posts: 1100
Joined: Tue 2010-06-22 14:10

Re: VS1103. Volume linein.

Post by Henrik » Thu 2016-11-24 11:53

_Sam_ wrote:SCI_MODE = SM_INCONF_SCI_MIDI_SDI_ADPCM | SM_DIFF | SM_LINE_IN | SM_OUTOFFMIDI

Volume for SDI_ADPCM very nice, but linein small volume. As if the SM_DIFF does not apply to A/D to DAC path. If i'm disable SM_DIFF volume SDI_ADPCM and LINEIN equally small.

On page 29 datasheet on VS1103 version 1.03:
When SM_DIFF is set, the player inverts the left channel output. For a stereo input this creates
virtual surround, and for a mono input this creates a differential left/right signal.
Differential left/right signal creates from A/D input or only from mono ADPCM stream?

SM_DIFF affects the output signal, so it should work both for your ADPCM stream and line input. Are you sure you got good values in register SCI_MIXERVOL and SCI_ADPCMRECCTL? The A/D stream goes through AGC/Gain4 and Gain3 (see VS1103 Datasheet Figure 12: Normal Data Flow of VS1103b, Part 1).

To make the line input louder, try increasing the gains, for example like this:
  • Set SCI_ADPCMRECCTL to 0x39 (0 dB gain)
  • If that doesn't help, set SCI_MIXERVOL to 0xFF39 (SMV_ACTIVE, SMV_GAIN3=31=+6dB, SMV_GAIN2=25=0dB, SMV_GAIN1=25=0dB)
  • If that doesn't help, set SCI_ADPCMRECCTL to 0x3f (+6 dB gain)
Does this make any difference?
My schematic in attach
Your schematics looks good.

Kind regards,
- Henrik
Good signatures never die. They just fade away.

_Sam_
User
Posts: 10
Joined: Thu 2013-01-24 16:59

Re: VS1103. Volume linein.

Post by _Sam_ » Thu 2016-11-24 14:09

My settings for gains.
SCI_MIXERVOL = (SMV_ACTIVE=1, SMV_GAIN3=31, SMV_GAIN2=31, SMV_GAIN1=31)
SCI_ADPCMRECCTL = (SARC_DREQ512=1, SARC_OUTOFADPCM=0, SARC_GAIN4 = 31).

I'm control volume over SCI_MIXERVOL, SCI_ADPCMRECCTL set once.
Change SMV_GAIN3 i'm increase and decrease volume linein, but maximal volume witch SMV_GAIN3=31 very small compared SDI_ADPCM.

My SDI_ADPCM settings 16bit, mono, 44100Hz. Default frequency linein A/D 8kHz. I'm correct AD_DIV(WRAMADDR = 0xc01e) with value = 24 for normal mixing A/D witch my SDI_ADPCM and mixing work fine, but volume line in small. Мay be the cause of this?

_Sam_
User
Posts: 10
Joined: Thu 2013-01-24 16:59

Re: VS1103. Volume linein.

Post by _Sam_ » Thu 2016-11-24 15:12

I applied to the linein 1Vpp. May be need 2Vpp?

User avatar
Henrik
VLSI Staff
Posts: 1100
Joined: Tue 2010-06-22 14:10

Re: VS1103. Volume linein.

Post by Henrik » Thu 2016-11-24 15:57

Hello Sam!

First some questions: What is your SCI_CLOCKF value? What frequency crystal do you use?

The maximum onput to Line In is 2800 mVpp AC. If your input is 1 Vpp, and you apply the two +6 dB gains I proposed earlier, you should be getting a maximum amplitude output signal, and even a bit more (the same as if you would have 0 dB gains and a 4000 mVpp input signal).

I see you also have maximum gain for ADPCM stream Gain 2. Try to set that lower, e.g. SMV_GAIN2=19, so then the Line in will sound louder in comparison. Compensate by setting SCI_VOL higher.

Kind regards,
- Henrik
Good signatures never die. They just fade away.

_Sam_
User
Posts: 10
Joined: Thu 2013-01-24 16:59

Re: VS1103. Volume linein.

Post by _Sam_ » Thu 2016-11-24 21:06

First some questions: What is your SCI_CLOCKF value?
SCI_CLOCKF = (6 << 13); (SC_MULT = 6, SC_ZER0 = 0, SC_FREQ = 0)
What frequency crystal do you use?
12.288Mhz
I see you also have maximum gain for ADPCM stream Gain 2. Try to set that lower, e.g. SMV_GAIN2=19, so then the Line in will sound louder in comparison. Compensate by setting SCI_VOL higher.
In my design volume ADPCM and linein adjustment is carried out by changing the SMV_GAIN2 and SMV_GAIN3. SCI_VOL always maximum(SCI_VOL = 0)

I can not reduce the maximum volume of ADPCM.(SCI_VOL= 0, SMV_GAIN2 = 31)

_Sam_
User
Posts: 10
Joined: Thu 2013-01-24 16:59

Re: VS1103. Volume linein.

Post by _Sam_ » Sun 2016-11-27 15:50

SCI_MODE.SM_DIFF does not affect the volume linein, but increase volume ADPCM!!! I double-checked it a few times. Maybe there is a patch to fix this feature?

Also, you have an error in the formula for calculating the ADM_DIVIDER. 128 x n should be replaced by 256 x n or error in work freqeuncy A/D stream and 8kHz should be replaced on 16kHz.

_Sam_
User
Posts: 10
Joined: Thu 2013-01-24 16:59

Re: VS1103. Volume linein.

Post by _Sam_ » Thu 2016-12-01 16:25

Decisions not? Really it is necessary to establish a linein operational amplifier that increases the amplitude of the signal? :cry:

_Sam_
User
Posts: 10
Joined: Thu 2013-01-24 16:59

Re: VS1103. Volume linein.

Post by _Sam_ » Thu 2018-01-11 11:36

I again had to return to the problem linein with SCI_MODE.SM_DIFF=1.
I applied a sinusoid to the line input from the generator and check dac output witch oscilloscope. The sine wave on the left dac is not inverted, but only slightly offset, so the sound is quiet and is not actually regulated by the amplitude.
At the same time with ADPCM, everything works well!

Post Reply