A10 audio line input

Started by iz4ako, November 18, 2014, 12:10:34 am

Previous topic - Next topic

iz4ako

Hello,
i want to use the LINEIN R or L as audio input in order to do some ham radio experiments to decode digital transmission using FLDIGI software.
Trough a 1:1 600ohm trasformer I apply the audio from my HF receiver to LINEIn R (pin13 of GPIO-4 and GND).

It seems not working.
I have the feeling that LINEIN is not selected.

I'm using LINUX KERNEL 3.4.90+

Gerrit

To select the input port you have to set the mixer control called ADC Input Mux

Input Port: linein = 7

http://linux-sunxi.org/Audio_Codec

iz4ako

I'm trying. The first thing that I dit is amixer contents | less.
Then I found numid=23 that is related to ADC Input Mux

numid=23,iface=MIXER,name='ADC Input Mux'
  ; type=INTEGER,access=rw------,values=1,min=0,max=7,step=0
  : values=0

according to the linux-sunxi.org/Audio_Codec the value could be 0 or 7. Actually is "0". So it should be OK

I'll check the electrical connections. may be the 1:1 transformer is KO

Gerrit,
I tried also to plug a USB audio card. With lsusb I see it, but nothing more. I think I do not have the kernel module.

Gerrit

November 19, 2014, 12:08:53 am #3 Last Edit: November 21, 2014, 08:33:53 pm by Gerrit
what kernel module are you talking about, usb audio could be missing ?

check with lsmod for snd_usb_audio

For so far i can see from your information ALSA does know about the internal cards.

Try aplay -l to see which cards are available.

**** List of PLAYBACK Hardware Devices ****
card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sunxisndhdmi [sunxi-sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0


arecord -l  for the capture devices

**** List of CAPTURE Hardware Devices ****
card 0: sunxicodec [sunxi-CODEC], device 0: M1 PCM [sunxi PCM]
  Subdevices: 1/1
  Subdevice #0: subdevice #0



and maybe try alsamixer more easy to play with all the controls to see if you get any sound

to listen to the input:
arecord -D hw:0,0 -f cd |aplay

The above command to play LINEINL and LINEINR on default out works with this config

/var/lib/alsa/asound.state
state.sunxisndhdmi {
control {
}
}
state.sunxicodec {
control.1 {
iface MIXER
name 'Master Playback Volume'
value 29
comment {
access 'read write'
type INTEGER
count 1
range '0 - 63'
}
}
control.2 {
iface MIXER
name 'Playback Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.3 {
iface MIXER
name 'Fm Volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
}
}
control.4 {
iface MIXER
name 'Line Volume'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.5 {
iface MIXER
name 'FmL Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.6 {
iface MIXER
name 'FmR Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.7 {
iface MIXER
name 'LineL Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.8 {
iface MIXER
name 'LineR Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.9 {
iface MIXER
name 'Ldac Left Mixer'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.10 {
iface MIXER
name 'Rdac Right Mixer'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.11 {
iface MIXER
name 'Ldac Right Mixer'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.12 {
iface MIXER
name 'Mic Input Mux'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 15'
}
}
control.13 {
iface MIXER
name 'Master Capture Mute'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.14 {
iface MIXER
name 'Right Capture Mute'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.15 {
iface MIXER
name 'Left Capture Mute'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.16 {
iface MIXER
name 'Capture Volume'
value 3
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
}
}
control.17 {
iface MIXER
name 'Line Capture Volume'
value 3
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
}
}
control.18 {
iface MIXER
name 'MicL Volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 3'
}
}
control.19 {
iface MIXER
name 'MicR Volume'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 3'
}
}
control.20 {
iface MIXER
name 'Mic2 Boost'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.21 {
iface MIXER
name 'Mic1 Boost'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.22 {
iface MIXER
name 'Mic Power'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.23 {
iface MIXER
name 'ADC Input Mux'
value 0
comment {
access 'read write'
type INTEGER
count 1
range '0 - 7'
}
}
}
state.CODEC {
control.1 {
iface MIXER
name 'PCM Playback Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.2 {
iface MIXER
name 'PCM Playback Volume'
value.0 108
value.1 108
comment {
access 'read write'
type INTEGER
count 2
range '0 - 128'
dbmin -12800
dbmax 0
dbvalue.0 -2000
dbvalue.1 -2000
}
}
}

dejohnny

How do you guys connect to the line inputs? I've located LINEINL and LINENINR on GPIO4 pins 13 and 15, but there is no common or analog ground or similar on that header.

Gerrit

Quote from: dejohnny on February 04, 2015, 05:29:59 am
How do you guys connect to the line inputs? I've located LINEINL and LINENINR on GPIO4 pins 13 and 15, but there is no common or analog ground or similar on that header.


Look again GPIO4 pin 2 is ground.

dejohnny

Thanks, but I don't think that can work can it?

The audio signal is AC, if I connect to GND the LINEIN's will go negative on the bottom half of the wave. I think I need something similar to HPCOM on the output (this one shows some something like 1,7V on the multimeter).

Gerrit

Of course it can work, before the signal gets processed they add add a DC signal to lift it.

you can't do this for the headphone, because you don't want to have a DC component in the signal.

looks at section 6.4  GND is used for MIC-IN
https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-MICRO-4GB/resources/A20-OLinuXino-Micro.pdf

dejohnny

Thanks, I'll try it! :) Just to make sure, are you saying the -LIME boards can be used for audio line input without external components just by connecting to LINEINL/R + GND on GPIO-4 ?

I'm still confused, the -MICRO schematic does not show any similar circuitry for the line inputs as for the microphone, and I also thought the -LIME boards would lack those components anyway. Is this level shifting done internally to the chip?

Gerrit

Quote from: dejohnny on February 04, 2015, 12:23:47 pm
Thanks, I'll try it! :) Just to make sure, are you saying the -LIME boards can be used for audio line input without external components just by connecting to LINEINL/R + GND on GPIO-4 ?


I would advise to use capacitors to have some protection for LINEINL/R

JohnS

Check the schematics and chip datasheets.  Don't connect any signal before being sure it's safe for the chips or be happy to damage them.

If another board has extra circuitry then it's probably required.

John

dejohnny

Thanks for the advice!

I managed to get garbled audio input by playing with the 'ADC input mux'. No settings will give me clean audio though, the upper half of the waveform is chopped off. One of the 'ADC input mux' settings gave me something that looked like a wave but with a significant DC offset and it sounded distorted after trying various DC offset removals / LPF filtering.

I'll keep on trying.

Gerrit

February 04, 2015, 09:47:57 pm #12 Last Edit: February 04, 2015, 11:52:08 pm by Gerrit
Quote from: dejohnny on February 04, 2015, 04:16:26 pm
I managed to get garbled audio input by playing with the 'ADC input mux'.


garbled sound means in the most cases the input is set much to sensitive i would advice to start with all levers on level 10 - 20. except ADC input mux is to select the input, LINE IN is 0 or 7

http://linux-sunxi.org/Audio_Codec