[Gta04-owner] Sound devices in the GTA04

Dr. H. Nikolaus Schaller hns at goldelico.com
Sat Dec 31 09:36:56 CET 2011

Hi Neil,

Am 31.12.2011 um 05:34 schrieb NeilBrown:

> I often get confused by the myriad options that "alsamixer" present to me for
> the sound card in the Freerunner and the Phoenux.
> So having read through lots of docs and figured most of it out for the
> Phoenux I thought I would write down what I know in the hope that 
> a/ it will be useful to others, and
> b/ if I am wrong about something, someone will tell me.
> c/ it will force me to confirm that my understanding is complete.
> There are 4 sound devices in the Pheonux - each wired directly to the OMAP
> SOC (each to a different McBSP port - multi-channel buffered serial port).
> Three of them are very simple.
>   gta04voice - the sound to and from the GSM chip
>   gta04headset - sound to and from the bluetooth chip
>   gta04fm - sound to/from the FM transceiver (not in 3.2 yet)
> They don't have any mixer controls - they just send and receive data in a
> fixed format at a fixed rate (or maybe a small selection of rates).
> The other is more complex:  "gta04" is provided by the TWL4030.  It has
> some functionality that is not connected in the GTA04 so we should try to
> hide it from ALSA so I don't keep getting confused.
> The best starting point is the diagram on page 692 of the doco for
> TPS65950 aka TWL4030 referenced in table 5.1 of the GTA04 manual.
> It is figure 14-6.  It displays "Option 1".  "Option 2" doesn't make sense for
> the GTA04A3 due to the connections available.
> There are 2 input channels, 'left' and 'right'.
> 'left' can be connected to:
>  - on-board microphone                                 "Analog Left Main Mic"
>  - headset microphone                                  "Analog Left Headset Mic"
>  - AUX input line on alternate cable in headset jack   "Analog Left AUXL"
> 'right' can be connected to
>  - AUX input line on alternate cable in headset jack   "Analog Right AUXR"
> Both channels have adjustable gain:  "Analog"
> (For these to be accessable "TX1" and "TX2" must be set to "Analog" - we
> should try to impose that in the kernel and hide those settings).
> The output side is a bit more complex.  There are 4 digital channels allowing
> quadraphonic sound!  Left and Right, Front and Back.  They can be mixed in
> various ways with each other and with the amplified input streams and sent to
> various output devices.
> The 'front' channels are labelled '1' and the 'back' channels '2', so
> 'Right1' is Front/Right.  To avoid confusion I'll stick with '1' and '2' as
> those are the labels used in the ALSA device - just remember that '1' is the
> primary (front) pair and '2' is the secondary (back) pair.
> Some mixing and amplification happens digitally and then 4 digital signals
> are fed into 4 DACs - DAC1 and DAC2 each with left and right channels - to
> produce analogue signals.  Each of these has a fine-grained and a
> course-grained digital amplifier before the DAC.  So a digital signal goes
> through:
> "DACn Digital Fine" then "DACn Digital Coarse" then becomes analogue and
>    goes through "DACn Analog".
> Each of these are stereo and with n={1,2} so we have 4 paths.
> The hardware allows these 4 paths to be fed from various sources however
> the current driver doesn't support switching and the obvious defaults are
> used.
> The hardware allows the '1' (front) paths to be fed from either 'front' or
> 'back' of the appropriate side, or an L+R mix of either front or back (so 4
> options).
> The '2' (back) paths can be fed from the 'back' of the appropriate side
> or a mix of L+R from the back (so 2 options).
> The lack of driver support means that e.g. you cannot send a stereo signal to
> the audio device and have the channels mixed and sent out the single speaker
> of the GTA02 case.  So I'll probably have to fix that short-coming.
> The 4 amplified analogue signals are optionally mixed with either the left or
> right input channel (to provide a Voice Side-tone) in the main amplifier
> stage.  These are controlled by the switches
>   "Left1 Analog Loopback", "Right1 Analog Loopback"
>   "Left2 Analog Loopback", "Right2 Analog Loopback".
> There is then a 5th analogue amplifier which just takes the Voice Loopback
> (sidetone) signal and amplifies it separately to the digitally provided
> signals.
> These 5 signals can be mixed or multiplexed into various output devices:
> (The "hands free" speakers can just select one signal, the other outputs can
> choose a mix of signals).
> The "headset" (plugged in to 2.5mm jack) has a Left and a Right.
> Each can receive a mix of 
>  Voice,  DAC1,  DAC2
> (where Voice is the side-tone loopback - a single channel - and DAC1 and
> DAC2 are either the Left or Right as appropriate).
> Then there are the speakers which is where I get confused again.
> There can be 2 "HandsFree" speakers, and 1 "Ear" speaker - or maybe Earphone.
> The HandsFree seem to be the 2 speakers in the GTA01 case, or just the Left
> HandsFree is the single speaker in the GTA02 case.
> The gta04 Schematic shows the Ear connections wired to something labelled
> "CASEEAR" (Case Ear) but I cannot see where that appears on the board layout.
> I would assume that this is just a future-expansion port, except that the
> "sound-demo" script provided sets the volume for "Ear" but does not set the
> input for "HandsFree".  so - confused.

This is the earpiece speaker. It is just two contact points on the PCB and is sitting
in the front cover. So it is not a component to be soldered. Therefore, it is designated
as a part of the case.

> Anyway, the HandsFree speakers can get just one signal selected from
>  Voice DAC1(appropriate side) DAC2-Left DAC2-Right.
> These are controlled by the "HandsfreeL Mux" and "HandsfreeR Mux" which can
> be set to one of "Voice", "AudioL1", "AudioL2", "AudioR1", "AudioR2".
> and the EAR speaker can get a mix of:
>  Voice, DAC1-left, DAC1-right, or DAC2-left.
> by muting or enabling:
> "Earpiece Mixer AudioL1", "Earpiece Mixer AudioL2"
> "Earpiece Mixer AudioR1", "Voice".
> Aside from all this, any one of the 4 (mixed) digital signals can be feed to
> a Pulse-Width-Modulator to drive the VibraMotor by setting "Vibra Mux" and
> some other "Vibra" settings.
> So that is how it works in GTA04A3.  I've heard rumours that there is a
> change for the A4 so I'll say something about that...

Yes, the direct voice path has been added. It is important to
tri-state that or it will try to drive the PCM link but the GTM601 is the

So it is a three-way connection between the GTM601, the TPS voice
channel and the McBSP.

> The TWL4030 (aka TPS65950) allows digital connections directly to the GSM
> Modem and the bluetooth controller.  I believe GSM is connected in GTA04A4 -
> don't know about bluetooth.

Bluetooth is not connected directly since it shares the PCM clock with the voice

> This allows the TWL4030 to be configured (Option 2) to forward audio between
> the mic/speakers or the bluetooth controller  and the GSM Modem.  That way
> the CPU can just set up the audio channels and let the phone call progress
> without being involved - it could even go to sleep to save power.


> Also the FM radio *could* be wired to the TWL4030 as the "AUX In" so you
> could listen to the radio without needing the CPU to copy data around.

I am not sure how that could work since the Si4721 has even 6 lines for PCM
(separate lock & frame sync signals).

Unfortunately it is very difficult to do experiments on such a miniaturized
device because you can't easily solder 4 or 6 wires... It needs to produce
a new PCB variant.

> So I'm curious as to why bluetooth and GSM aren't wired directly to the
> TWL4030 in the A3, and exactly what is wired in the A4.   Nikolaus??

The reason is simple: we did not understand what you have described
very well when we designed the A3 board.

> I'd also be happy if someone could clarify what "CASEEAR" is all about.

Ear pice speaker.

> Oh, and "Happy new year" and all that.

Same to you (here in Europe we still have the old year, i.e. we lag
behind :)


More information about the Gta04-owner mailing list