Topics

Changes to "LO Drive" in AlsaMixer Have No Affect #udrc-ii

DAVID BASHAM
 

I would like to measure and change my deviation using the the PI3, SEAPAC Compass Image, and UDRC-II.  I am running Basil's script "measure_deviate.sh" to generate an audio tone.  I am using svxlink to measure the deviation using a RTL-SDR Dongle.  Everything about that process seems to be working.  I get a deviation value of about 3900 and I hear a clear tone in a second radio.  What baffles me is that when I go into alsamixer and change the values for either PCM or LO Drive nothing changes even when changing the values all up and down the scale.  The deviation stays the same and the tone I hear in a second radio sounds just the same.  I can make other changes in alsamixer such as muting the LOR Output and the tone stops so ALSA mixer is reacting to at least that change.  My question, why do my output sound levels remain the same no mater what I set them to in alsamixer? 

Basil Gunn
 

My question, why do my
output sound levels remain the same no mater what I set them to in
alsamixer?
I'm assuming you are using the mini din6 cable for the UDRC II & radio.
What radio are you using?

/Basil

DAVID BASHAM
 

Thanks Basil for your reply.  I am using the din6 and the radio is a Yaesu FT-8800.  Since you asked, I thought I would try a second radio to see if it made a difference.  I hooked up my ICOM 7000 still using the din6.  The deviation went from around 3900 to around 4500 but adjustment of LO Drive all the way from 0  to 100 still has no affect.  Audio level as heard from a second radio and deviation as reported by svxlink remains exactly the same as I change the LO Drive level.    Thanks for your help.

Basil Gunn
 

I am using the din6 and the radio is a Yaesu FT-8800. Since you
asked, I thought I would try a second radio to see if it made a
difference. I hooked up my ICOM 7000 still using the din6. The
deviation went from around 3900 to around 4500 but adjustment of LO
Drive all the way from 0 to 100 still has no affect.  A udio level as
heard from a second radio and deviation as reported by svxlink
remains exactly the same as I change the LO Drive level.
David,

I think what you are observing is that different radio manufacturers
have different requirements for their deviation drive levels. So for
my Kenwood TM-271a I require 38 mV for proper deviation but my Alinco
DR-235 requires 172 mV. I think what is happening is LO Drive is
making mV adjustments while the radio requires a lot more drive so you
are not seeing any change in deviation.

There is a dtoverlay you can try that may help. Try putting this at
the bottom of /boot/config.txt:

dtoverlay=udrc-boost-output

I'll try some things on my end too but it may be a couple of days as I'm
kinda swamped.

/Basil n7nix

DAVID BASHAM
 

Thanks Basil.  I understand what you are saying in regards to different radios reacting differently to the audio drive level being inserted.  That all makes sense.
I did some further testing and found that when PCM is set to 38 (the value set by the set-udrc-din6.sh script)
then any change in LO Drive has no affect.  If I lower PCM to where I first hear a change in received audio level on a second radio (PCM set to around 10), then changing LO Drive does make a difference.  It acts the opposite of what I expected with it acting like the LO Drive is fine control and PCM is course.  I would have expected no output when LO Drive is set to 0 regardless of the PCM setting.  Again, when PCM is set to 38 and LO Drive is set to 0, I hear a good solid tone on my second rig.  I will read up on what those settings do in the TI literature and I will see what affect the dtovlay has on the environment as well.

Jeremy McDermond
 

LO drive controls the gain of the analog "line out" amplifier after the DAC. The PCM control affects the output of the DAC by itself. The PCM count control merely multiples the incoming samples by a scaling factor, so you actually lose DAC resolution by using it. This is why we tell you to adjust LO drive first. 

The LO amp has a few options on where it gets bias from. The dtoverlay setting makes it take off the 3.3v bus, which gives you a bit more drive than stock. 

You also want to check out the waveform itself. My experience is such that 0db on both controls is not very far off from clipping. 

Jeremy
Nh6z@...
Sent from my iPhone

On Jul 3, 2017, at 12:47 PM, DAVID BASHAM <davidcbasham@...> wrote:

Thanks Basil.  I understand what you are saying in regards to different radios reacting differently to the audio drive level being inserted.  That all makes sense.
I did some further testing and found that when PCM is set to 38 (the value set by the set-udrc-din6.sh script)
then any change in LO Drive has no affect.  If I lower PCM to where I first hear a change in received audio level on a second radio (PCM set to around 10), then changing LO Drive does make a difference.  It acts the opposite of what I expected with it acting like the LO Drive is fine control and PCM is course.  I would have expected no output when LO Drive is set to 0 regardless of the PCM setting.  Again, when PCM is set to 38 and LO Drive is set to 0, I hear a good solid tone on my second rig.  I will read up on what those settings do in the TI literature and I will see what affect the dtovlay has on the environment as well.

Kenny Richards
 

Jeremy,

Is there a dtoverlay option for lowering the LO output without having to change the PCM control?

Thanks
Kenny

Jeremy McDermond
 

No, there’s no option for lowering the LO bias rail.  I don’t have the datasheet in front of my, but I don’t recall a third setting on it.

Jeremy McDermond

On Jul 3, 2017, at 2:50 PM, Kenny Richards <kenny@...> wrote:

Jeremy,

Is there a dtoverlay option for lowering the LO output without having to change the PCM control?

Thanks
Kenny

Kenny Richards
 

Bummer.

I have two radios which require much lower levels. I finally got the IC-207 working by dropping the PCM to 24 with the LO at zero. (Which gave me a near prefect deviation of 3 khz on the service monitor)  

I'll bug Bryan about a more hardware focused solution.

Thanks
Kenny

Jeremy McDermond
 

On Jul 3, 2017, at 5:00 PM, Kenny Richards <kenny@...> wrote:

Bummer.

I have two radios which require much lower levels. I finally got the IC-207 working by dropping the PCM to 24 with the LO at zero. (Which gave me a near prefect deviation of 3 khz on the service monitor)

I'll bug Bryan about a more hardware focused solution.
There’s not much analog there to deal with. If you need more range on PCM, you might be able to combine the default UDRC with the alsa “softvol” control (http://alsa.opensrc.org/How_to_use_softvol_to_control_the_master_volume). You can use softvol to cut the levels of the input samples before they get to the hardware device. That being said, the volume control on the DAC goes down to 63.5dB. That being said, remember that the dynamic range of a 16 bits of ADC is only around 96dB. If you turn things down all the way, you’re only getting around 33dB of dynamic range on there. Anything you add to that in software volume control is going to reduce that further.

Thanks
Kenny

--
Jeremy McDermond (NH6Z)
Xenotropic Systems
mcdermj@...

DAVID BASHAM
 

Thanks Jeremy.  Can you expand just a little on what the PCM control is doing.  When you say the PCM control multiplies the sample by a scaling factor, I assume there is a scaling factor that multiples PCM by 1.  Would that be the value of 38 (0 db)?  I have been reading more about deviation and understand that if your looking at a spectrum plot, and you increase the modulation till the center frequency disappears and you just see the side tones, then you are at about a deviation of 3khz.  I have Basil's script running and generating a tone of 1200hz using the UDRCII into a Yaesu FT-8800.  I'm looking at the output via a RTL Dongle and SDR#.  With the PCM at 38 changing the LO Drive has negligible affect.  It is not until I bring PCM down to about 8 that the LO Slider makes any difference and it is not till the PCM is around 8 that my center frequency in the spectrum begins to disappear.  So, would it be correct to think I have to reduce the gain of the DAC alot (33db in this case) in order to get down to about 3khz deviation?  If so, then should I be using a PCM value of 8 and making fine adjustment with the LO Drive.  Things seem to work with the default values of PCM 38 and LO Drive of 9 however I'm not sure if reducing PCM would make things better.  I'm just trying to understand more about the system of things at work and the methods I should use to optimize it.  Thanks again for your thoughts.

Jeremy McDermond
 

On Jul 5, 2017, at 8:35 PM, DAVID BASHAM <davidcbasham@...> wrote:

Thanks Jeremy. Can you expand just a little on what the PCM control is doing. When you say the PCM control multiplies the sample by a scaling factor, I assume there is a scaling factor that multiples PCM by 1. Would that be the value of 38 (0 db)?
Yes, 0dB should be multiplying samples by 1.0 essentially.

I have been reading more about deviation and understand that if your looking at a spectrum plot, and you increase the modulation till the center frequency disappears and you just see the side tones, then you are at about a deviation of 3khz. I have Basil's script running and generating a tone of 1200hz using the UDRCII into a Yaesu FT-8800. I'm looking at the output via a RTL Dongle and SDR#. With the PCM at 38 changing the LO Drive has negligible affect. It is not until I bring PCM down to about 8 that the LO Slider makes any difference and it is not till the PCM is around 8 that my center frequency in the spectrum begins to disappear. So, would it be correct to think I have to reduce the gain of the DAC alot (33db in this case) in order to get down to about 3khz deviation? If so, then should I be using a PCM value of 8 and making fine adjustment with the LO Drive. Things seem to work with the default values of PCM 38 and LO Drive of 9 however I'm not sure if reducing PCM would make things better. I'm just trying to understand more about the system of things at work and the methods I should use to optimize it. Thanks again for your thoughts.
I can’t tell you about Basil’s script or looking at spectrum plots. I have an HP 8901A that I use for setting deviation of my devices.

What I can tell you is that reducing PCM to get more LO Drive isn’t an optimal setup. This is what I was trying to explain to Kenny. Let me see if I can explain a little.

When you use the PCM control, you are multiplying the samples that go into the AIC3204 by some fraction. My recollection is that the control is essentially in voltage gain, which means that every 6dB you knock off on the PCM control, you’re halving the samples, or multiplying by .5.

But, remember that we’re doing this in *binary* and in a computer. Multiplying by half is essentially shifting the value right by one bit. So, a full scale value of 1111111111111111 now becomes 0111111111111111. Since that’s full scale, that means that *no* value will now use the highest order bit. That bit will *ALWAYS* be zero.

Why does this matter? It matters because you’ve now just essentially turned your 16-bit DAC into a 15-bit DAC. This will affect things like the dynamic range you get out of the device (as a simplification, you get a range of 16383 to -16384 instead of 32767 to -32768). More importantly, you have halved the number of steps between the biggest number you can represent, and the smallest number you can represent. This makes what’s called the “quantization noise” (https://en.wikipedia.org/wiki/Quantization_(signal_processing)) worse. So, you’re actually making your signal noisier when you do this.

Think of the degenerate case where you cut off 15 of the 16 bits by multiplying the samples down. Your signal can now only assume two different levels, 0 or 1. You can amplify those (using the LO gain control), but you’ll end up with a square wave. That’s probably not very close to what you intend.

So, you’d rather use the PCM control sparingly, and turn to the LO control first. I understand that there are cases where you’ll have to adjust PCM, but you should do that as a second-order adjustment.

Hopefully this makes some amount of sense.


--
Jeremy McDermond (NH6Z)
Xenotropic Systems
mcdermj@...

DAVID BASHAM
 

Jeremy, Thanks for the additional detail.  I understand what your are saying re the PCM control.  I believe that I have greater than desired deviation and thus would need to do something else such as add a resister divider in the output (rather than using the PCM control) to bring the level down without sacrificing DAC resolution.  My deviation is not that excessive and perhaps I just shouldn't worry about it.  Thanks again for your explanations.

Jeremy McDermond
 

On Jul 5, 2017, at 9:44 PM, DAVID BASHAM <davidcbasham@...> wrote:

Jeremy, Thanks for the additional detail. I understand what your are saying re the PCM control. I believe that I have greater than desired deviation and thus would need to do something else such as add a resister divider in the output (rather than using the PCM control) to bring the level down without sacrificing DAC resolution. My deviation is not that excessive and perhaps I just shouldn't worry about it. Thanks again for your explanations.
By all means, if you can’t get it to the proper deviation, use the PCM control. But, you’d rather cut the LO control to it’s full down position first, and then move the PCM down to accomplish your goal.


--
Jeremy McDermond (NH6Z)
Xenotropic Systems
mcdermj@...

DAVID BASHAM
 

I have done exactly that. I moved LO Drive to 0.  Then I kept reducing PCM until their was an affect on deviation and that did not happen until PCM was down to about 8 (-33db).  Thanks again.

Kenny Richards
 

David,

That is exactly my situation as well, but I only had to drop the PCM down to 24 (and the LO at 0) to get the deviation correct.

Thanks
Kenny

Previous Topic Next Topic