Revision as of 10:17, 5 April 2009

In the center of the Neo1973audio subsystem is the WM8753 (the "Wolfson Codec"), which implements record (ADCs), playback (DACs), and signal mixing. On the stereo output is the LM4857 amplifier, which drives the stereo speakers, the mono earpiece and the headphones. Sound from and to GSM is received from and sent to the GSM modem via analog connections. There's a digital mono interface for sound from and to the Bluetooth chip.

ALSA Channels

The channel numbers shown here are for the Freerunner, not the 1973.
A way more pretty diagram is here

Png version with ALSA control names printed over (these are alsa controls like found in statefiles or amixer commands, alsamixer removes trailing "Playback Volume" and such where it sees fit) Inkscape source:

root@om-gta02:~# amixer controls

numid=1,iface=MIXER,name='PCM Volume'

numid=2,iface=MIXER,name='ADC Capture Volume'

numid=3,iface=MIXER,name='Headphone Playback Volume'

numid=4,iface=MIXER,name='Speaker Playback Volume'

numid=5,iface=MIXER,name='Mono Playback Volume'

numid=6,iface=MIXER,name='Bypass Playback Volume'

numid=7,iface=MIXER,name='Sidetone Playback Volume'

numid=8,iface=MIXER,name='Voice Playback Volume'

numid=9,iface=MIXER,name='Headphone Playback ZC Switch'

numid=10,iface=MIXER,name='Speaker Playback ZC Switch'

numid=11,iface=MIXER,name='Mono Bypass Playback Volume'

numid=12,iface=MIXER,name='Mono Sidetone Playback Volume'

numid=13,iface=MIXER,name='Mono Voice Playback Volume'

numid=14,iface=MIXER,name='Mono Playback ZC Switch'

numid=15,iface=MIXER,name='Bass Boost'

numid=16,iface=MIXER,name='Bass Filter'

numid=17,iface=MIXER,name='Bass Volume'

numid=18,iface=MIXER,name='Treble Volume'

numid=19,iface=MIXER,name='Treble Cut-off'

numid=20,iface=MIXER,name='Sidetone Capture Volume'

numid=21,iface=MIXER,name='Voice Sidetone Capture Volume'

numid=22,iface=MIXER,name='Capture Volume'

numid=23,iface=MIXER,name='Capture ZC Switch'

numid=24,iface=MIXER,name='Capture Switch'

numid=25,iface=MIXER,name='Capture Filter Select'

numid=26,iface=MIXER,name='Capture Filter Cut-off'

numid=27,iface=MIXER,name='Capture Filter Switch'

numid=28,iface=MIXER,name='ALC Capture Target Volume'

numid=29,iface=MIXER,name='ALC Capture Max Volume'

numid=30,iface=MIXER,name='ALC Capture Function'

numid=31,iface=MIXER,name='ALC Capture ZC Switch'

numid=32,iface=MIXER,name='ALC Capture Hold Time'

numid=33,iface=MIXER,name='ALC Capture Decay Time'

numid=34,iface=MIXER,name='ALC Capture Attack Time'

numid=35,iface=MIXER,name='ALC Capture NG Threshold'

numid=36,iface=MIXER,name='ALC Capture NG Type'

numid=37,iface=MIXER,name='ALC Capture NG Switch'

numid=38,iface=MIXER,name='3D Function'

numid=39,iface=MIXER,name='3D Upper Cut-off'

numid=40,iface=MIXER,name='3D Lower Cut-off'

numid=41,iface=MIXER,name='3D Volume'

numid=42,iface=MIXER,name='3D Switch'

numid=43,iface=MIXER,name='Capture 6dB Attenuate'

numid=44,iface=MIXER,name='Playback 6dB Attenuate'

numid=45,iface=MIXER,name='De-emphasis'

numid=46,iface=MIXER,name='Playback Mono Mix'

numid=47,iface=MIXER,name='Playback Phase'

numid=48,iface=MIXER,name='Mic2 Capture Volume'

numid=49,iface=MIXER,name='Mic1 Capture Volume'

numid=50,iface=MIXER,name='DAI Mode'

numid=51,iface=MIXER,name='ADC Data Select'

numid=52,iface=MIXER,name='ROUT2 Phase'

numid=53,iface=MIXER,name='Mic Selection Mux'

numid=54,iface=MIXER,name='Rx Mixer'

numid=55,iface=MIXER,name='Line Mixer'

numid=56,iface=MIXER,name='Line Mono Mux'

numid=57,iface=MIXER,name='Line Right Mux'

numid=58,iface=MIXER,name='Line Left Mux'

numid=59,iface=MIXER,name='ALC Mixer Line Capture Switch'

numid=60,iface=MIXER,name='ALC Mixer Mic2 Capture Switch'

numid=61,iface=MIXER,name='ALC Mixer Mic1 Capture Switch'

numid=62,iface=MIXER,name='ALC Mixer Rx Capture Switch'

numid=63,iface=MIXER,name='Mic Sidetone Mux'

numid=64,iface=MIXER,name='Capture Right Mux'

numid=65,iface=MIXER,name='Capture Left Mux'

numid=66,iface=MIXER,name='Capture Right Mixer'

numid=67,iface=MIXER,name='Capture Left Mixer'

numid=68,iface=MIXER,name='Playback Mixer Voice Capture Sw'

numid=69,iface=MIXER,name='Playback Mixer Left Capture Swi'

numid=70,iface=MIXER,name='Playback Mixer Right Capture Sw'

numid=71,iface=MIXER,name='Out4 Mux'

numid=72,iface=MIXER,name='Out3 Mux'

numid=73,iface=MIXER,name='Mono 2 Mux'

numid=74,iface=MIXER,name='Mono Mixer Left Playback Switch'

numid=75,iface=MIXER,name='Mono Mixer Right Playback Switc'

numid=76,iface=MIXER,name='Mono Mixer Voice Playback Switc'

numid=77,iface=MIXER,name='Mono Mixer Sidetone Playback Sw'

numid=78,iface=MIXER,name='Mono Mixer Bypass Playback Swit'

numid=79,iface=MIXER,name='Right Mixer Voice Playback Swit'

numid=80,iface=MIXER,name='Right Mixer Sidetone Playback S'

numid=81,iface=MIXER,name='Right Mixer Right Playback Swit'

numid=82,iface=MIXER,name='Right Mixer Bypass Playback Swi'

numid=83,iface=MIXER,name='Left Mixer Voice Playback Switc'

numid=84,iface=MIXER,name='Left Mixer Sidetone Playback Sw'

numid=85,iface=MIXER,name='Left Mixer Left Playback Switch'

numid=86,iface=MIXER,name='Left Mixer Bypass Playback Swit'

numid=87,iface=MIXER,name='DAPM Stereo Out Switch'

numid=88,iface=MIXER,name='DAPM GSM Line Out Switch'

numid=89,iface=MIXER,name='DAPM GSM Line In Switch'

numid=90,iface=MIXER,name='DAPM Headset Mic Switch'

numid=91,iface=MIXER,name='DAPM Handset Mic Switch'

numid=92,iface=MIXER,name='DAPM Handset Spk Switch'

numid=93,iface=MIXER,name='Amp State Switch'

numid=94,iface=MIXER,name='Amp Spk Switch'

Four variants of using available Digital Audio Interfaces and DACs/ADC, these correspond to the "DAI Mode" ALSA control values:

Keep in mind: left interface (VXxxx) is connected to BlueTooth, right interface (LRC, BCLK, xxxDAT) is connected to SoC (CPU).
So mode "11" at least seems isn't useful at all for the way Neo HW is built. Mode "10" is suited for (Stereo/mono) output and recording for digital world, whereas Mode "00" is needed for GSM<->BT operation (calls via BT-headset) only.

BT-VoIP-calls and BT-stereo-headphones playback are done via direct USB-connection SoC<->BT in a very usual standard-linux-way, and therefor need no statefile or any other setup of mixer.

We are still wondering what use Mode "01" might have, other than analog mixed mono output (which could as well be done at digital side by feeding L/R with same data)

asound.state

NOTE this will not work with GTA02, as the control numbers have changed
Here [1] is a modified version that is GTA02 compatible,
But lacks the Neo Mode settings which disappeared on GTA02, and does not seem to work.

The state file above does not work for me. I created one gsm_headset.txt that is working for audio playback on the freerunner. I will be updating that file as I get the mic routing working.

The above did not work for me; for some reason, the hifi DAC interface must be exercised once before playing. I have hacked BtHeadset.py to make FR-BTAudio. When paired with GSMBLUETOOTH.txt I get 2-way high quality audio.

I did a lot of this debugging using w8753_dump which is a quick and dirty hack, but quite useful on a large text window.

Bluetooth headset with system audio

For example, using a voip app on the phone with a bt voice headset. This would also be a good way to work on the bluetooth driver without requiring a working GSM and placing a lot of calls.

See ticket 583 for a state file that should route system audio *out* to the headset. The codec does not allow for duplex system audio connected to a headset, so audio in is still using the mic.

NOTE the state file specified does not work for GTA02, and even when modified to be GTA02 compatible still does not route system sound to a BT headset. Modified state file for GTA02 is here
[2]

Multimedia

sound playback to speakers

This is an important mode since it is also required for ringtone
playback

sound playback to headphone

Driver Status

This is working since ASoC 0.13rc2 (-moko6 kernel)

sound playback via A2DP

One way to do this is to use a pulse plugin for bluetooth audio. Pulse would be routed either to the plugin or the default route to the codec. The plugin would watch for headset connect/disconnect events generated by a bluez audio daemon to keep the list of available output devices current.

Driver Status

There is early work on the bluez daemon to handle this. It has been combined with an alsa plugin in the bluez tree but the alsa plugin probably will not be sufficient for neo.

Driver Status

Call recording

This is a nice wishlist item. The user should be able to receive the
full-duplex audio from the wolfson codec, and record it using the
S3C2410 IIS.

recording

It is possible to do PCM recording of a GSM voice call. In fact, it is even possible to record the local microphone (what you speak) and the remote voice (what is spoken on the other end of the call) to separate channels (L and R of the Stereo ADC).

If you want to record a GSM voice call, please adjust your mixer settings as follows

Capture Left Mux: Line or RXP-RXN

this routes the analog voice from the GSM modem to the left DAC channel

Driver Status

playback

If you want to play PCM audio into a GSM call (i.e. make your remote partner of a voice call hear your PCM audio, e.g. your mp3 or ogg files.

If you are inside a voice call (e.g. FSO/zhone), open amixer or load a state file with alsactl and change the following mixer controls:

Mono Mixer Left

this enables audio routing from the Stereo DAC left channel to the Mono Out (GSM Modem)

Mono Mixer Right Playback Switch

this enables audio routing from the Stereo DAC right channel to the Mono Out (GSM Modem)

PCM Level

adjust the PCM Level up to the desired playback volume

Driver Status

UNKNOWN

Recording and Playback .state

Here is a state file that allows both recording and playback from and to a gsm call.
File: File:Callrec.txt

To record just issue:

arecord -D hw:0,0 -r 8000 -f S16_LE -c 2 record.wav

and to inject sound just issue:

aplay -D hw:0,0 record.wav

If you have any problems you can contact me on IRC, TAsn.

P.S
There's a bug concerning the Right and Left mux, you have to change the left after you change the right, loading the state file may cause this issue to show, so just in case, I recommend appending:

A patch (diff gsmhandset.txt callrec-gsmhandset.txt) to apply on every state file, including gsmheadset.state and gsmspeakerout.state.
File:Callrec-gsmhandset-patch.txt

Userspace Sound Control Daemon

The userspace sound control deamon might be a separate process or (more likely) part of some larger general hardware management daemon.

It will provide the following features:

audio playback

In order to provide the desired functionality, the daemon first needs to be capable of doing audio playback.

supported formats

mp3 (libmad)

ogg/vorbis (libtremor)

mod (mikmod)

sid (sidplay)

supported functionality

start and stop playback

interrupt previous sound to play new sound

enqueue new sound at end of previous sound

smooth fade-in/fade-out

audio event management

manage a set of events (basically just a name for each event)

manage a set of audio themes

each theme contains list of event->audio_file_name mappings

themes stored/managed via gconf

manage event sources

built-in event sources, e.g. touchscreen/button press

external event sources (e.g. gsmd, dbus, ...)

audio scenario management

e.g. dialer or even gsmd can request audio subsystem to switch to voicecall mode

this mainly affects codec/amplifier analog audio routing

integrated with bluetooth in case of BT headset or A2DP use

How is this management performed currently?

Important issues/pitfalls

Ringtone while headset playback

If the user is listening to music on the headset, we want to mix the
ring tones only into the headset audio, as we must not interrupt and play it on the speaker. Reason: headset can't be switched off during playback via speaker, so to avoid extremely loud headset playback there must NOT be any speaker playback while headset is inserted.

In expression: loading speakerout.state is deprecated while JACK_INSERT is asserted.

Views

Personal tools

In the center of the Neo1973audio subsystem is the WM8753 (the "Wolfson Codec"), which implements record (ADCs), playback (DACs), and signal mixing. On the stereo output is the LM4857 amplifier, which drives the stereo speakers, the mono earpiece and the headphones. Sound from and to GSM is received from and sent to the GSM modem via analog connections. There's a digital mono interface for sound from and to the Bluetooth chip.

ALSA Channels

The channel numbers shown here are for the Freerunner, not the 1973.
A way more pretty diagram is here

Png version with ALSA control names printed over (these are alsa controls like found in statefiles or amixer commands, alsamixer removes trailing "Playback Volume" and such where it sees fit) Inkscape source:

root@om-gta02:~# amixer controls

numid=1,iface=MIXER,name='PCM Volume'

numid=2,iface=MIXER,name='ADC Capture Volume'

numid=3,iface=MIXER,name='Headphone Playback Volume'

numid=4,iface=MIXER,name='Speaker Playback Volume'

numid=5,iface=MIXER,name='Mono Playback Volume'

numid=6,iface=MIXER,name='Bypass Playback Volume'

numid=7,iface=MIXER,name='Sidetone Playback Volume'

numid=8,iface=MIXER,name='Voice Playback Volume'

numid=9,iface=MIXER,name='Headphone Playback ZC Switch'

numid=10,iface=MIXER,name='Speaker Playback ZC Switch'

numid=11,iface=MIXER,name='Mono Bypass Playback Volume'

numid=12,iface=MIXER,name='Mono Sidetone Playback Volume'

numid=13,iface=MIXER,name='Mono Voice Playback Volume'

numid=14,iface=MIXER,name='Mono Playback ZC Switch'

numid=15,iface=MIXER,name='Bass Boost'

numid=16,iface=MIXER,name='Bass Filter'

numid=17,iface=MIXER,name='Bass Volume'

numid=18,iface=MIXER,name='Treble Volume'

numid=19,iface=MIXER,name='Treble Cut-off'

numid=20,iface=MIXER,name='Sidetone Capture Volume'

numid=21,iface=MIXER,name='Voice Sidetone Capture Volume'

numid=22,iface=MIXER,name='Capture Volume'

numid=23,iface=MIXER,name='Capture ZC Switch'

numid=24,iface=MIXER,name='Capture Switch'

numid=25,iface=MIXER,name='Capture Filter Select'

numid=26,iface=MIXER,name='Capture Filter Cut-off'

numid=27,iface=MIXER,name='Capture Filter Switch'

numid=28,iface=MIXER,name='ALC Capture Target Volume'

numid=29,iface=MIXER,name='ALC Capture Max Volume'

numid=30,iface=MIXER,name='ALC Capture Function'

numid=31,iface=MIXER,name='ALC Capture ZC Switch'

numid=32,iface=MIXER,name='ALC Capture Hold Time'

numid=33,iface=MIXER,name='ALC Capture Decay Time'

numid=34,iface=MIXER,name='ALC Capture Attack Time'

numid=35,iface=MIXER,name='ALC Capture NG Threshold'

numid=36,iface=MIXER,name='ALC Capture NG Type'

numid=37,iface=MIXER,name='ALC Capture NG Switch'

numid=38,iface=MIXER,name='3D Function'

numid=39,iface=MIXER,name='3D Upper Cut-off'

numid=40,iface=MIXER,name='3D Lower Cut-off'

numid=41,iface=MIXER,name='3D Volume'

numid=42,iface=MIXER,name='3D Switch'

numid=43,iface=MIXER,name='Capture 6dB Attenuate'

numid=44,iface=MIXER,name='Playback 6dB Attenuate'

numid=45,iface=MIXER,name='De-emphasis'

numid=46,iface=MIXER,name='Playback Mono Mix'

numid=47,iface=MIXER,name='Playback Phase'

numid=48,iface=MIXER,name='Mic2 Capture Volume'

numid=49,iface=MIXER,name='Mic1 Capture Volume'

numid=50,iface=MIXER,name='DAI Mode'

numid=51,iface=MIXER,name='ADC Data Select'

numid=52,iface=MIXER,name='ROUT2 Phase'

numid=53,iface=MIXER,name='Mic Selection Mux'

numid=54,iface=MIXER,name='Rx Mixer'

numid=55,iface=MIXER,name='Line Mixer'

numid=56,iface=MIXER,name='Line Mono Mux'

numid=57,iface=MIXER,name='Line Right Mux'

numid=58,iface=MIXER,name='Line Left Mux'

numid=59,iface=MIXER,name='ALC Mixer Line Capture Switch'

numid=60,iface=MIXER,name='ALC Mixer Mic2 Capture Switch'

numid=61,iface=MIXER,name='ALC Mixer Mic1 Capture Switch'

numid=62,iface=MIXER,name='ALC Mixer Rx Capture Switch'

numid=63,iface=MIXER,name='Mic Sidetone Mux'

numid=64,iface=MIXER,name='Capture Right Mux'

numid=65,iface=MIXER,name='Capture Left Mux'

numid=66,iface=MIXER,name='Capture Right Mixer'

numid=67,iface=MIXER,name='Capture Left Mixer'

numid=68,iface=MIXER,name='Playback Mixer Voice Capture Sw'

numid=69,iface=MIXER,name='Playback Mixer Left Capture Swi'

numid=70,iface=MIXER,name='Playback Mixer Right Capture Sw'

numid=71,iface=MIXER,name='Out4 Mux'

numid=72,iface=MIXER,name='Out3 Mux'

numid=73,iface=MIXER,name='Mono 2 Mux'

numid=74,iface=MIXER,name='Mono Mixer Left Playback Switch'

numid=75,iface=MIXER,name='Mono Mixer Right Playback Switc'

numid=76,iface=MIXER,name='Mono Mixer Voice Playback Switc'

numid=77,iface=MIXER,name='Mono Mixer Sidetone Playback Sw'

numid=78,iface=MIXER,name='Mono Mixer Bypass Playback Swit'

numid=79,iface=MIXER,name='Right Mixer Voice Playback Swit'

numid=80,iface=MIXER,name='Right Mixer Sidetone Playback S'

numid=81,iface=MIXER,name='Right Mixer Right Playback Swit'

numid=82,iface=MIXER,name='Right Mixer Bypass Playback Swi'

numid=83,iface=MIXER,name='Left Mixer Voice Playback Switc'

numid=84,iface=MIXER,name='Left Mixer Sidetone Playback Sw'

numid=85,iface=MIXER,name='Left Mixer Left Playback Switch'

numid=86,iface=MIXER,name='Left Mixer Bypass Playback Swit'

numid=87,iface=MIXER,name='DAPM Stereo Out Switch'

numid=88,iface=MIXER,name='DAPM GSM Line Out Switch'

numid=89,iface=MIXER,name='DAPM GSM Line In Switch'

numid=90,iface=MIXER,name='DAPM Headset Mic Switch'

numid=91,iface=MIXER,name='DAPM Handset Mic Switch'

numid=92,iface=MIXER,name='DAPM Handset Spk Switch'

numid=93,iface=MIXER,name='Amp State Switch'

numid=94,iface=MIXER,name='Amp Spk Switch'

Four variants of using available Digital Audio Interfaces and DACs/ADC, these correspond to the "DAI Mode" ALSA control values:

Keep in mind: left interface (VXxxx) is connected to BlueTooth, right interface (LRC, BCLK, xxxDAT) is connected to SoC (CPU).
So mode "11" at least seems isn't useful at all for the way Neo HW is built. Mode "10" is suited for (Stereo/mono) output and recording for digital world, whereas Mode "00" is needed for GSM<->BT operation (calls via BT-headset) only.

BT-VoIP-calls and BT-stereo-headphones playback are done via direct USB-connection SoC<->BT in a very usual standard-linux-way, and therefor need no statefile or any other setup of mixer.

We are still wondering what use Mode "01" might have, other than analog mixed mono output (which could as well be done at digital side by feeding L/R with same data)

asound.state

NOTE this will not work with GTA02, as the control numbers have changed
Here [1] is a modified version that is GTA02 compatible,
But lacks the Neo Mode settings which disappeared on GTA02, and does not seem to work.

The state file above does not work for me. I created one gsm_headset.txt that is working for audio playback on the freerunner. I will be updating that file as I get the mic routing working.

The above did not work for me; for some reason, the hifi DAC interface must be exercised once before playing. I have hacked BtHeadset.py to make FR-BTAudio. When paired with GSMBLUETOOTH.txt I get 2-way high quality audio.

I did a lot of this debugging using w8753_dump which is a quick and dirty hack, but quite useful on a large text window.

Bluetooth headset with system audio

For example, using a voip app on the phone with a bt voice headset. This would also be a good way to work on the bluetooth driver without requiring a working GSM and placing a lot of calls.

See ticket 583 for a state file that should route system audio *out* to the headset. The codec does not allow for duplex system audio connected to a headset, so audio in is still using the mic.

NOTE the state file specified does not work for GTA02, and even when modified to be GTA02 compatible still does not route system sound to a BT headset. Modified state file for GTA02 is here
[2]

Multimedia

sound playback to speakers

This is an important mode since it is also required for ringtone
playback

sound playback to headphone

Driver Status

This is working since ASoC 0.13rc2 (-moko6 kernel)

sound playback via A2DP

One way to do this is to use a pulse plugin for bluetooth audio. Pulse would be routed either to the plugin or the default route to the codec. The plugin would watch for headset connect/disconnect events generated by a bluez audio daemon to keep the list of available output devices current.

Driver Status

There is early work on the bluez daemon to handle this. It has been combined with an alsa plugin in the bluez tree but the alsa plugin probably will not be sufficient for neo.

Driver Status

Call recording

This is a nice wishlist item. The user should be able to receive the
full-duplex audio from the wolfson codec, and record it using the
S3C2410 IIS.

recording

It is possible to do PCM recording of a GSM voice call. In fact, it is even possible to record the local microphone (what you speak) and the remote voice (what is spoken on the other end of the call) to separate channels (L and R of the Stereo ADC).

If you want to record a GSM voice call, please adjust your mixer settings as follows

Capture Left Mux: Line or RXP-RXN

this routes the analog voice from the GSM modem to the left DAC channel

Driver Status

playback

If you want to play PCM audio into a GSM call (i.e. make your remote partner of a voice call hear your PCM audio, e.g. your mp3 or ogg files.

If you are inside a voice call (e.g. FSO/zhone), open amixer or load a state file with alsactl and change the following mixer controls:

Mono Mixer Left

this enables audio routing from the Stereo DAC left channel to the Mono Out (GSM Modem)

Mono Mixer Right Playback Switch

this enables audio routing from the Stereo DAC right channel to the Mono Out (GSM Modem)

PCM Level

adjust the PCM Level up to the desired playback volume

Driver Status

UNKNOWN

Recording and Playback .state

Here is a state file that allows both recording and playback from and to a gsm call.
File: File:Callrec.txt

To record just issue:

arecord -D hw:0,0 -r 8000 -f S16_LE -c 2 record.wav

and to inject sound just issue:

aplay -D hw:0,0 record.wav

If you have any problems you can contact me on IRC, TAsn.

P.S
There's a bug concerning the Right and Left mux, you have to change the left after you change the right, loading the state file may cause this issue to show, so just in case, I recommend appending:

A patch (diff gsmhandset.txt callrec-gsmhandset.txt) to apply on every state file, including gsmheadset.state and gsmspeakerout.state.
File:Callrec-gsmhandset-patch.txt

Userspace Sound Control Daemon

The userspace sound control deamon might be a separate process or (more likely) part of some larger general hardware management daemon.

It will provide the following features:

audio playback

In order to provide the desired functionality, the daemon first needs to be capable of doing audio playback.

supported formats

mp3 (libmad)

ogg/vorbis (libtremor)

mod (mikmod)

sid (sidplay)

supported functionality

start and stop playback

interrupt previous sound to play new sound

enqueue new sound at end of previous sound

smooth fade-in/fade-out

audio event management

manage a set of events (basically just a name for each event)

manage a set of audio themes

each theme contains list of event->audio_file_name mappings

themes stored/managed via gconf

manage event sources

built-in event sources, e.g. touchscreen/button press

external event sources (e.g. gsmd, dbus, ...)

audio scenario management

e.g. dialer or even gsmd can request audio subsystem to switch to voicecall mode

this mainly affects codec/amplifier analog audio routing

integrated with bluetooth in case of BT headset or A2DP use

How is this management performed currently?

Important issues/pitfalls

Ringtone while headset playback

If the user is listening to music on the headset, we want to mix the
ring tones only into the headset audio, as we must not interrupt and play it on the speaker. Reason: headset can't be switched off during playback via speaker, so to avoid extremely loud headset playback there must NOT be any speaker playback while headset is inserted.

In expression: loading speakerout.state is deprecated while JACK_INSERT is asserted.