How to prove LINE_IN is working?

Started by kbro, December 22, 2013, 01:10:50 PM

Previous topic - Next topic

kbro

I recently received my A10S board and I've proved to myself that pretty much everything is working on it.  The thing I'm having trouble is in the LINE_IN 3.5mm stereo audio input socket (section 6.4 in the A10S user manual).  I've been looking for an app that will take audio from LINE_IN and play it to the AUDIO_OUT socket (section 6.5) but so far I've drawn a blank.

Also, I can't find anything in the system settings that will select LINE_IN rather than the microphone input.  The only audio setting I've come across is the ability to change the audio output from HDMI to AUDIO_OUT.

The other thing I need to find out is how to select LINE_IN in preference to the microphone programatically.  I'm trying to get an in-house VOIP application working and I'd rather do something in software rather than start soldering pins to the de-populated MIC/TV connector.

Thanks for your help!

Robert Leacroft

Use Alsamixer to look at the sources and sinks and ensure that the Line In (and Out) are enable and have their gains turned up. Pressing  F6 will show Sunxi Codec as the default source and sink (hw0,0) which are the 3.5 jacks, you should not need to do anything to select these.

A good first audio test bed is Audacity  recording and playback software as it allows you to record (with a visual meter) from hw0,0 and then playback to hw0,0. 

If you have gstreamer 0.10 installed then a simple pipeline like this   "gst-launch-0.10 alsasrc ! alsasink"
will pass the audio on the input jack straight to the output jack, assuming the gains have been turned up as above.

I am using Openob 3  for "Audio over IP" which is much higher quality than VOIP providing full duplex audio; though I do have a problem with 400mS latency at the moment which I hope will be sorted if I can get Jackd to run without "bus error". 

If you  want an on demand "dial-up" link  between two ip addresses then IHU v 0.60( I hear you) is quite a good program.   This IHU needs quite a few dependances installing and is not normally found by apt-get but if you add the Raspian repository list (Raspberry PI) to those for the normal Debian repository list then it is found by apt-get and everything gets loaded fully automatically.

Robert

kbro

#2
Hi Robert, thanks for your reply but I've had no luck with it - I think my newbieness is too extreme :-)

I tried installing AlsaMixer (ROOT REQUIRED) version 1.0.9 by SKVALEX from the play store.  When I ran it I got a list of interesting things including: Line-in-r function define (set to Mono: Playback [off]), LineL (Mono: Playback [off]), LineR (Mono: Playback [off]) - I changed all these to ON.  Also LINEIN APM (set to Mono: 4 [57%]) which I left alone.  Pressing F6 had no visible effect other than making the mouse pointer disappear.

I downloaded gstreamer from http://gstreamer.freedesktop.org/data/pkg/android/1.2.2/gstreamer-1.0-android-arm-1.2.2-release-runtime.zip but couldn't find any installation instructions so I unpacked it into /data/gstreamer, edited the gst-env file to set GSTREAMER_ROOT=/data/gstreamer, sourced the file to set up my environment and ran "gst-launch-1.0 alsasrc ! alsasink".  All I got was

ERROR: pipeline could not be constructed: no element "alsasrc".

I don't doubt that this is not working because I'm doing something (probably several things!) very wrong, but if you could find the time to give me something a little more step-by-step then I'd be very grateful.

PS should also mention I'm plugging the board into a TV screen using HDMI, which causes the output stream to go there by default rather than the 3.5mm output jack.

kbro

#3
Looks like alsasrc is part of the libgstalsa.so module in gstreamer which isn't included in the runtime binary set I downloaded.  alsasink likewise.  Bother!

Robert Leacroft

Hi Kbro,    Looking at "Alsamixer from Play Store" I now realise that you are probably using Android. I use Debian and all of my suggestions related to Debian and its associated Alsamixer etc. I am afraid that I have no experience at all with Android but I assume there must be similar multimedia programs to allow recording and playback that you should be able to find and use as a first test-bed of the hardware.

Perhaps everyone posting should put ANDROID or DEBIAN in the Subject title line in future to avoid confusion.

Sorry about that  Robert

kbro

You're right - I've got the A10s with 4GB NAND which came with Android 4.0.4 pre-installed.  That would explain why I had no luck finding binaries for Audacity either :-)

kbro

I had another crack at AlsaMixer (https://play.google.com/store/apps/details?id=com.skvalex.alsamixer) today and made some progress...

I booted the A10s board with it plugged into an HDMI monitor, USB keyboard with trackball, powered stereo speakers on AUDIO_OUT and my iPhone pumping music into LINE_IN.  I then went into Settings > Sounds > Audio output mode and set it to AUDIO_CODEC (it was set to HDMI).  Then I ran AlsaMixer and tweaked the following settings:-

LineL: on
LineR: on
Playback MIXPAS: on
MIX Enable: on

Hey presto!  The music from my iPhone started coming out of the powered stereo speakers.  I could even control which speaker audio came out of by tweaking LineL or LineR back to off.

One caveat on this - the sound only plays for about 5 seconds, then stops until I click the mouse button again, and then plays for another 5 seconds or so, and so on while I keep clicking the mouse.  Any suggestions why this should be?!

Also, at one point the audio started coming out of the HDMI TV speakers instead of the powered speakers, and in this mode it kept on playing rather than stopping after 5 seconds.  I have no idea what I did to cause this to happen!