Nirmal
Nirmal

Reputation: 41

Audio Codec For Android

Following is the code I came through while making some changes in the audio files. Can you please tell what exactly does this code do and what does "RX" in the following code specify. Any leads would be great

SectionDevice
Name "OutputLime"
Comment "Rx Lime jack output"

EnableSequence
    'SLIM_0_RX Channels':0:Two
    'RX3 MIX1 INP1':0:RX1
    'RX5 MIX1 INP1':0:RX2
    'RX4 DSM MUX':0:CIC_OUT
    'RX6 DSM MUX':0:CIC_OUT
            'LINEOUT1 Volume':1:66
            'LINEOUT2 Volume':1:66
            'LINEOUT3 Volume':1:66
            'LINEOUT4 Volume':1:66
EndSequence

DisableSequence
    'RX3 MIX1 INP1':0:ZERO
    'RX5 MIX1 INP1':0:ZERO
    'RX4 DSM MUX':0:DSM_INV
    'RX6 DSM MUX':0:DSM_INV
            'LINEOUT1 Volume':1:0
            'LINEOUT2 Volume':1:0
            'LINEOUT3 Volume':1:0
            'LINEOUT4 Volume':1:0
EndSequence

Upvotes: 1

Views: 1382

Answers (1)

Michael
Michael

Reputation: 58427

what does "RX" in the following code specify

Output devices or paths are typically labeled RX; and conversly input devices/paths are labeled TX. You can remember that by thinking of an RX device as something that Recieves audio data from the system (e.g. a speaker), and a TX device as something that Transmits audio data to the system (e.g. a microphone).

What this code does is define an audio output device named "OutputLime" (is that a typo of "OutputLine" btw?), and the actions that should be taken by the ALSA Usecase Manager when that device is enabled or disabled.

Each line in the enable/disable sequences specifies an ALSA control (on the ALSA card corresponding to your codec, which typically would be card 0), and what value to write to the control.

SLIM_0_RX refers to a channel on the SLIMBus connecting the DSP and the codec. Typically you'll see a corresponding 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1 in the verbs in your UCM file that refer to playback that should be routed through the codec, which basically says that anything written to MultiMedia1 (pcmC0D0p) should go to SLIM_0_RX.

So the code is setting this up as a stereo output device. Looks a lot like the loudspeaker device actually.
I don't remember exactly what all those other controls represent. Some are volumes obviously, and it's not a wild guess that the others are for specifying which channel on the physcial stereo device should get the left output and which should get the right output.
Perhaps you can look it up in the codec data sheet if you've got one. Otherwise you can check if the driver source code for your codec is available and look there for clues (or perhaps in the msm-pcm-routing code, assuming that this is a Qualcomm platform).

Upvotes: 1

Related Questions