View source for Neo Freerunner audio subsystem

From Openmoko

Jump to: navigation, search

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Administrators.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page:

Return to Neo Freerunner audio subsystem.

Personal tools

The Neo Freerunner (GTA02) inherited the audio subsystem from its older brother the Neo 1973 (GTA01). However, there are a few small differences. This page tries to show and explain the differences and points you to the Neo 1973 page whenever it touches the common points (but there may be overlaps for the sake of usability). As wiki pages are, errors and omissions are likely, and your help is welcomed.

Differences from Neo 1973

  • There is only 1 (mono) built-in loud speaker (connected to LOUT1) instead of 2 (stereo).
  • The Wolfson Codec driver presents 94 separate controls {switches, multiplexers, and volumes} to the alsa system (in both Neos). Unfortunately they are not mapped exactly the same for the GTA01 as for the GTA02.

Possible sound connections through the Wolfson Codec

  • "Yes" = Confirmed, alsa state file exists.
  • "No" = Not possible / not desirable.
  • "Should" = Should be possible, not confirmed yet.
  • "?" = Have no idea.
- CPU GSM Bluetooth
Bluetooth  ? Yes
Wired Speaker Yes Yes  ?
Wired Mic Yes Yes  ?
Body Earpiece Should Yes  ?
Body Speaker Yes Should  ?
Body Mic Should Yes  ?

Alsamixer channel controls

The ALSA state files are installed by default, and belong to package "openmoko-alsa-scenarios". To see where the files reside, do "opkg files openmoko-alsa-scenarios". Currently they are in "/usr/share/openmoko/scenarios/". Recommended statefile for phone usage is

  1. State: GSM <-> Built-in Handset (file gsmhandset.state)
    1. Mic volume:
      • Control 48: "Mic2 Capture Volume" (alsamixer name: "Mic2". Suggested value: max)
      • Control 12: "Mono Sidetone Playback Volume" (alsamixer name: "Mono sidetone" Suggested value: 5..7(max))
      • Control 5: "Mono Playback Volume" (alsamixer name: "Mono" Value: as needed)
      • Control 63: 'Mic Sidetone Mux' MANDATORY VALUE "Mic 2"!!!
    2. Earpiece volume:
      • Control 6: "Bypass Playback Volume"
      • Control 4: "Speaker Playback Volume"

For mic settings please refer also to

user should set volume according to own preferences:

for mic the (full, true) procedure is as follows:
reduce #5 by some 15..30 steps
do testcall:
you get very low volume at far end. but tone should be clear, no clipping (sharp agressive noise)
if there is clipping: reduce #48 by one step (i.e. to "2")
then adjust #5 to your preferences and taste
(do `alsactrl store -f gsmhandset.state` to save the changes if you used a mixer to adjust the levels)

for earpiece(-speaker):

level up modem to full volume (AT+CLVL cmd used by framework), 
level up #6 to full volume, 
adjust by #4
if you get clipping when #4 is at moderate level (same as above): reduce #6 (or even AT+CLVL) until clipping vanishes
(very unlikely to occur for earpiece playback)

  1. State: GSM <-> Built-in Handsfree (file gsmspeakerout.state)
    1. Mic volume:
      • Control ?:
    2. Speaker volume:
      • Control ?:
  2. State: GSM <-> Wired Headset (file gsmheadset.state)
    1. Mic volume:
      • Control 49: "Mic1 Capture Volume"
      • Control 12: "Mono Sidetone Playback Volume"
      • Control 5: "Mono Playback Volume"
    2. Speaker volume:
      • Control 6: "Bypass Playback Volume"
      • Control 3: "Headphone Playback Volume"
  3. State: GSM <-> Bluetooth Headset (file ???)
    1. Alternative working state files: [1]
    2. Mic volume:
      • Control 13: "Mono Voice Playback Volume"
      • Control 5: "Mono Playback Volume"
  4. State: CPU <-> Built-in Handset (file voip-handset.state)
    1. Mic volume:
      • Control ?:
    2. Speaker volume:
      • Control ?:
  5. State: CPU <-> Wired Headset (file headset.state)
    1. Stereo sound:
      • Control ?:
    2. Headset output:
      • Control 94: "Amp Spk Switch" <- false
  6. State: CPU <-> Buildin Speaker (file stereoout.state)
    1. Mono sound:
      • Control ?:
    2. Headset output:
      • Control 94: "Amp Spk Switch" <- true
  7. State: CPU -> GSM (file gsmhandset.state)
    1. Mono sound:
      • Control 74: Mono Mixer Left Playback Switch to true
      • Control 75: Mono Mixer Right Playback Switch to true
      • Control 1: PCM Volume suggested value 135
  • These files I still don't know what they are for:

--Femto 12:39, 24 September 2008 (UTC) I've updated above values. Must be checked.

-- I created another state file (voip-handsfree.state) for CPU Handsfree, mixed and matched voip-handset and stereoout. You can find it here. Feel free to make a change to it if there are errors. I don't see any, though.

Volume Control

Angus Ainslie has written a simple python volume control (which is getting more and more sophisticated) using some of these settings.

Installing the GUI mixer

cp /usr/bin
chmod u+x /usr/bin/
cp volume.desktop /usr/share/applications
opkg install python-pygtk
opkg install

If the python script aborts unexpectedly then look here for a fix