Adding a few debug statements to audio_route.c, I noticed that the 
"Playback Switch" is wrongly set to a value of "9", which is out of range:

V/audio_hw_primary(   75): Path: speaker, length: 3
V/audio_hw_primary(   75):   0: Playback Switch -> 9
V/audio_hw_primary(   75):   1: CODEC Power Switch -> 1
V/audio_hw_primary(   75):   2: Sampling Rate Switch -> 10
V/audio_hw_primary(   75): change mixer ctl 9 - new: 9, old: 0
E/audio_hw_primary(   75): failed to set mixer value; ctl 9 - value 9 (ret 
-1)

This is what I have in my mixer_paths.xml:

  <path name="speaker">
    <ctl name="Playback Switch" value="Speaker_normal" />
    <ctl name="CODEC Power Switch" value="1" />
    <ctl name="Sampling Rate Switch" value="44.1kHz" />
  </path>

And these are the control definitions in the kernel driver:

static const char *in_sw_control_texts[] = {
    "OFF", "MIC_normal", "MIC_ringtone", "MIC_incall", "Headset_normal", 
"Headset_ringtone", "Headset_incall"
};
static const char *fs_sw_control_texts[] = {
    "7.35kHz", "8kHz", "11.025kHz", "12kHz", "14.7kHz", "16kHz",
    "22.05kHz", "24kHz", "29.4kHz", "32kHz", "44.1kHz", "48kHz"
};
static const char *out_sw_control_texts[] = {
    "OFF", "Speaker_normal", "Speaker_ringtone", "Speaker_incall", 
"Earpiece_ringtone", "Earpiece_incall", "Headset_normal", 
"Headset_ringtone", "Headset_incall"
};

So, I expected "Playback Switch" to be set to a value of 1 (0="OFF", 
1="Speaker_normal"). Note how 9 is one more than the last value, as if the 
xml parsing didn't find the "Speaker_normal" and set the value to last 
element+1.

But I can't see what's wrong!


On Thursday, 8 November 2012 14:42:21 UTC+1, ffxx68 wrote:
>
> Hi
>
> I'm trying to port a ICS implementation of ALSA audio to JB, or a tablet 
> device, under this project:
>
> Mainly, I have the following to integrate (which I have the patch for ICS):
>
> external/alsa-lib
> hardware/alsa_sound
>
> plus some other smaller fix around, but I want to understand first of all 
> what to do with these two first. 
>
> For example, I have the some files with the same names in both 
> hardware/alsa_sound and hardware/libhardware_legacy/
> audio (from AOSP), but their content is very different in the two 
> locations.
>
> If I keep the ones from hardware/alsa_sound, build fails.
> If I copy them from hardware/libhardware_legacy/audio to 
> hardware/alsa_sound, I can build but I get a crash during boot.
>
> Which one should I keep and compile? 
> Once compiled, which libraries should I use from alsa_sound or 
> libhardware_legacy/audio?
>
> Basically, I don't know the approach to follow, with the ALSA integration. 
> I couldn't find any guide, or tutorial, so any help in that sense is 
> welcome too.
>
> Thanks in advance
> Fabio
>

-- 
-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to