Topics

sox?


ab9ca@...
 

OK, while trying to troubleshoot my non-functioning UDRC I decided to run the tone generator to generate a test tone. But when I do that I get the message that I need 'sox', whatever that may be. So . . . do I really need to go get 'sox' or is it on the RPi somewhere but the script can't find it? And what is 'sox' and how do I install it, if need be? 

73 de dave

ab9ca/4



 

If you think you are missing a program, it doesn't hurt to try installing it.

sudo apt-get install sox


On Nov 25, 2016 11:07, <ab9ca@...> wrote:

OK, while trying to troubleshoot my non-functioning UDRC I decided to run the tone generator to generate a test tone. But when I do that I get the message that I need 'sox', whatever that may be. So . . . do I really need to go get 'sox' or is it on the RPi somewhere but the script can't find it? And what is 'sox' and how do I install it, if need be? 

73 de dave

ab9ca/4



ab9ca@...
 

OK, looks like sox installed.


Now when I run meaure_deviate.sh I get:


pi@compass:~ $ ./measure_deviate.sh 1000 -
Found existing wav file: 2200hzsin.wav
If using devcal from Svxlink make sure devcal line has -f2200
Using PTT GPIO 23 with tone of 2200 Hz
ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card
aplay: main:722: audio open error: No such file or directory
Is carrier turned off?
pi@compass:~ $ 


Still does not run.

And it looks like it is ignoring the option to set the tone to 1000 hz rather than 2200.

73, dave
ab9ca/4



 

Hopefully Basil (the author of the script) will chime in.

Try running it with sudo

sudo ./measure_deviate.sh 1000 -

Also, if you have any other sound devices, including the built-in one for the Raspberry Pi, the script may not be trying to talk to the UDRC

In the script, it is looking for plughw:1,0 
#aplay -vv -D hw:CARD=udrc,DEV=0 $wavefile
aplay -vv -D "plughw:1,0" $wavefile
Look at the results of aplay -L to see the various soundcards your alsa system knows about.  You may need to adjust the arguments above to get to the right card.


On Fri, Nov 25, 2016 at 12:06 PM, <ab9ca@...> wrote:

OK, looks like sox installed.


Now when I run meaure_deviate.sh I get:


pi@compass:~ $ ./measure_deviate.sh 1000 -
Found existing wav file: 2200hzsin.wav
If using devcal from Svxlink make sure devcal line has -f2200
Using PTT GPIO 23 with tone of 2200 Hz
ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card
aplay: main:722: audio open error: No such file or directory
Is carrier turned off?
pi@compass:~ $ 


Still does not run.

And it looks like it is ignoring the option to set the tone to 1000 hz rather than 2200.

73, dave
ab9ca/4


_
--


John D. Hays
K7VE

PO Box 1223, Edmonds, WA 98020-1223
   


ab9ca@...
 

The 'sudo' had no effect and it looks like it has the right card:

....................................
pi@compass:~ $ sudo ./measure_deviate.sh 1000 -
Found existing wav file: 2200hzsin.wav
If using devcal from Svxlink make sure devcal line has -f2200
Using PTT GPIO 23 with tone of 2200 Hz
ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card
aplay: main:722: audio open error: No such file or directory
Is carrier turned off?
pi@compass:~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
udrc_out
udrc_in
din6_out
hd15_out
din6_in
hd15_in
din6
hd15
subdin6
subhd15
default:CARD=udrc
    udrc, 
    Default Audio Device
sysdefault:CARD=udrc
    udrc, 
    Default Audio Device
dmix:CARD=udrc,DEV=0
    udrc, 
    Direct sample mixing device
dsnoop:CARD=udrc,DEV=0
    udrc, 
    Direct sample snooping device
hw:CARD=udrc,DEV=0
    udrc, 
    Direct hardware device without any conversions
plughw:CARD=udrc,DEV=0
    udrc, 
    Hardware device with all software conversions
pi@compass:~ $ 
....................................................

Does this look right?


73, dave

ab9ca/4



ml000-0013@...
 

  Dave,

As John suggests, confirm that your copy of the script is using
"hw:CARD=udrc,DEV=0" on the aplay command around line 175.  I just set
mine back to "plughw" and I'm getting the same error as you.  Also,
the script seems to ignore the frequency argument when you are trying
to use the DIN-6.  It looks like an oversight in the script, but you
can fix it on line 147 if you are interested.  I am interested in
seeing how your troubleshooting goes, because I'm having a similar
issue with my UDRC-II.


  Thanks

  Mike


ab9ca@...
 

OK, doing as Mike suggests, changing from 'plughw' to 'hw:CARD=udrc,DEV=0' appears to have gotten the tone generator running. I say appears because I still do not have any audio going over over the air, but I see stuff on the screen that makes me think that the generator is running. 


Now the question is - What should I see when I probe the pins of the 40 pin header with my scope? 

First off, the script does not appear to work with the 6 pin DIN. It ignores the freq option on the command line and also ignores that I changed the time on the line near the end from 30 seconds to 180. I'm old and slow and need more than a paltry 30 sec to run tests.


Since I just want to make sure signal is passing through the UDRC I can run the tone generator for output on the DB15 connector. Using my scope look for waveforms on the lines that go to the DB15.


Running this command:


./measure_deviate.sh 1000


I see the TX LED light for the DB15 connector. I see an approx square wave (maybe with some pulse width modulation) on pin 12 of the 40 pin header. Also see signals on pins 40 and 35. But I see nothing on the output side of the AIC3204. Looks like the needed info is going in but the AIC3240 is dead and nothing is coming out. There is 3.3v on pin 6 of the AIC3204. Am I reading all this correctly? 

What say ye?

73, dave

ab9ca/4



Stuart Longland VK4MSL
 

On 26/11/16 11:46, ab9ca@... wrote:
I see the TX LED light for the DB15 connector. I see an approx square
wave (maybe with some pulse width modulation) on pin 12 of the 40 pin
header. Also see signals on pins 40 and 35. But I see nothing on the
output side of the AIC3204. Looks like the needed info is going in but
the AIC3240 is dead and nothing is coming out. There is 3.3v on pin 6 of
the AIC3204. Am I reading all this correctly?
If it's completely dead, you'd not be able to set mixer controls as the
'AIC3204 would not be responding to the I²C commands. If you can set
the mixer without errors, then *something* is alive. It could be just
bad mixer settings.

On the 40 pin header, you should see one pin toggling at the same rate
as your audio sample rate, that'll be the word clock, then a second one
will be 16 or 32 times this frequency, that'll be the bit clock. The
actual audio data is on two separate lines synchronised to these, one
for transmit, the other for receive.

Format is PCM, sent most significant bit first I believe.

As for the mixer, this CODEC chip is a complex beast, and it took me
quite a while to figure out the mixer in them the first time I
encountered one. The set-up script though provides a very good starting
point, as does TI's documentation.

http://www.ti.com/general/docs/datasheetdiagram.tsp?genericPartNumber=TLV320AIC3204&diagramId=SLOS602C

That functional diagram might help explain what all those knobs and
dials in `alsamixer` do. The inputs to the UDRC from the radio are
IN_1L and IN1_R… and the output is on the line output (LO) amplifier.
The headphone amplifier is not used.

There's some resistors you can select for the input from IN* to the left
and right ADCs as well as common-mode resistors to ground, which help
set the gain. You get the choice of 10k, 20k, 40k or off if I recall
correctly. I think the set-up script for the UDRC sets those to 10k and
CM to 10k, giving a 0dB gain.
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
...it's backed up on a tape somewhere.


Basil Gunn
 

On Fri, 25 Nov 2016 12:28:32 -0800
"John D Hays - K7VE" <@john_hays> wrote:

Hopefully Basil (the author of the script) will chime in.
I understand the argument parsing problem & will have a fix this
morining. You should probably take the code off the wiki & we'll use
github.

Try running it with sudo

sudo ./measure_deviate.sh 1000 -
You shouldn't have to run this program as root. Add your login user to
groups gpio & audio

Also you need to stop direwolf or whatever sound modem software you
are using.

/Basil

Also, if you have any other sound devices, including the built-in one
for the Raspberry Pi, the script may not be trying to talk to the UDRC

In the script, it is looking for plughw:1,0

#aplay -vv -D hw:CARD=udrc,DEV=0 $wavefile
aplay -vv -D *"plughw:1,0"* $wavefile

Look at the results of *aplay -L* to see the various soundcards your
alsa system knows about. You may need to adjust the arguments above
to get to the right card.


On Fri, Nov 25, 2016 at 12:06 PM, <ab9ca@...> wrote:

OK, looks like sox installed.


Now when I run meaure_deviate.sh I get:

pi@compass:~ $ ./measure_deviate.sh 1000 -
Found existing wav file: 2200hzsin.wav
If using devcal from Svxlink make sure devcal line has -f2200
Using PTT GPIO 23 with tone of 2200 Hz
ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card
aplay: main:722: audio open error: No such file or directory
Is carrier turned off?
pi@compass:~ $


Still does not run.

And it looks like it is ignoring the option to set the tone to 1000
hz rather than 2200.

73, dave
ab9ca/4


_


ab9ca@...
 

If you copy 9 lines, 134 thru 142,  from case 1 and add them to case 2 such that you end up with this:

............................

;;


1)

   # Validate tone frequency

   if [ "$1" -ge 10 -a "$1" -le 20000 ]; then

     REPLY=1;

   elif

     echo "Frequency $1 out of range (10 - 20000)"; then

     exit 1

   fi

   # Set frequency from command line arg

   freq=$1

;;

2)

  # Validate tone frequency

   if [ "$1" -ge 10 -a "$1" -le 20000 ]; then

     REPLY=1;

   elif

     echo "Frequency $1 out of range (10 - 20000)"; then

     exit 1

   fi

   # Set frequency from command line arg

   freq=$1

   # use channel 1 PTT gpio

   gpio_pin=23

;;

........................................


I think that gets the tone generator going OK on the mini DIN connector.

Case 1 and Case 2 are independent. The same validation needs to be done for both. 

No need to take it off the wiki.

With the tone generator running it is time to return to the original thread:

Where did the modulation go ..........

More troubleshooting there.

73 de dave

ab9ca/4



Basil Gunn
 

On Sat, 26 Nov 2016 08:01:20 -0800
Basil Gunn <@basil860> wrote:


On Fri, 25 Nov 2016 12:28:32 -0800
"John D Hays - K7VE" <@john_hays> wrote:

Hopefully Basil (the author of the script) will chime in.
I've updated the measure_deviation tone generating script & added a
README.md. I verified the script with a UDRC & UDRC II with both din6
& hd15 cables. Please read the README.md.

You can check it out here:

https://github.com/nwdigitalradio/n7nix/tree/master/deviation

/Basil


 

--


John D. Hays
K7VE

PO Box 1223, Edmonds, WA 98020-1223
   


Basil Gunn
 

OK, looks like sox installed.
Now when I run meaure_deviate.sh I get:

pi@compass:~ $ ./measure_deviate.sh 1000 -
Found existing wav file: 2200hzsin.wav
If using devcal from Svxlink make sure devcal line has -f2200
Using PTT GPIO 23 with tone of 2200 Hz
ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card
aplay: main:722: audio open error: No such file or directory
Is carrier turned off?

Still does not run.

And it looks like it is ignoring the option to set the tone to 1000
hz rather than 2200.
Get the latest version of the measure_deviate.sh script:

https://github.com/nwdigitalradio/n7nix/tree/master/deviation

Figure out what else is using the sound card:
Is direwolf running?

pidof direwolf

Make sure alsa enumerates the udrc

aplay -l

Depending on your configuratipon you may have to change the device
used by aplay. See 'aplay' command at bottom of script.

Read the n7nix/deviation/README.md. What do I need to add to make you
setup work?

/Basil n7nix


Basil Gunn
 

On Sat, 26 Nov 2016 08:01:20 -0800
Basil Gunn <@basil860> wrote:


On Fri, 25 Nov 2016 12:28:32 -0800
"John D Hays - K7VE" <@john_hays> wrote:

Hopefully Basil (the author of the script) will chime in.
There is a new measure_deviate.sh script and documentation here:

https://github.com/nwdigitalradio/n7nix/tree/master/deviation

Also @ml000-0013@... if PTT is working but you are not
getting any modulation/audio then check LOL Outp & LOR Outp with
alsamixder. See "Debug notes" section in the README.md file from the
above link.

/Basil


ml000-0013@...
 

On Fri, Dec 2, 2016 at 01:37 pm, Basil Gunn wrote:
Also @ml000-0013@... if PTT is working but you are not
getting any modulation/audio then check LOL Outp & LOR Outp with
alsamixder. See "Debug notes" section in the README.md file from the
above link.

   Yes, I did verify that both LOL and LOR outputs are OOpen :) .


  Thanks

  Mike