Unable to Play Sounds or Show Projector Shadow on Nexus 7 (Tegra3)

I have engine sounds that are not playing on the Nexus 7. They play fine in the editor and on a Nook Color. I have tried MP3s, OGG, and Wav. It’s strange that a music MP3 plays fine in the project across all devices but these particular sounds do not.

Here is the main part of my engine sounds script:

for (int i = sounds.Length - 1; i >= 0; i--)
{
    if (rpm > sounds[i].rpm)
    {
        currentDiff = rpm - sounds[i].rpm;
        soundsDiff = sounds[i].Difference(sounds[i + 1]);

        highRatioVolume = volumeCurve.Evaluate(Math.Abs((currentDiff) / (soundsDiff)));
        lowRatioVolume = 1 - highRatioVolume;

        lowRatioPitch = pitchCurve.Evaluate(currentDiff / sounds[0].rpm) * pitchMultiplier;
        highRatioPitch = pitchCurve.Evaluate(currentDiff / sounds[0].rpm) * pitchMultiplier;

        low = sounds[i];
        high = sounds[i + 1];

        if (!lowerLoad.clip.Equals(sounds[i].clip))
        {
            lowerLoad.clip = sounds[i].clip;
            lowerLoad.Play();
        }
        if (!higherLoad.clip.Equals(sounds[i + 1].clip))
        {
            higherLoad.clip = sounds[i + 1].clip;
            higherLoad.Play();
        }

        break;
    }
}

It evaluates the current rpm and then assigns the correct sound clips to the AudioSources (higherLoad, lowerLoad). I’m not sure where to turn here as I’ve tried everything I can thing of.

My other Nexus 7 related issue is that the projector shadow I get using the CharacterShadow script is not showing. My guess is the RenderTexture is not formatted correctly or maybe the shader scripts are not compatible with the Tegra. Again, this works fine on a Nook Color and in the editor.

Here are the shader scripts from CharacterShadow.cs:

private static string shadowMatString =
@"Shader ""Hidden/ShadowMat"" {
	Properties {
		_Color (""Color"", Color) = (0,0,0,0)
	}
	SubShader {
		Pass {
			ZTest Greater Cull Off ZWrite Off
			Color [_Color]
			SetTexture [_Dummy] { combine primary }
		}
	}
	Fallback off
}";

private static string projectorMatString =
@"	Shader ""Hidden/ShadowProjectorMultiply"" { 
	Properties {
		_ShadowTex (""Cookie"", 2D) = ""white"" { TexGen ObjectLinear }
		_FalloffTex (""FallOff"", 2D) = ""white"" { TexGen ObjectLinear	}
	}
	Subshader {
		Pass {
			ZWrite off
			Offset -1, -1
			Fog { Color (1, 1, 1) }
			AlphaTest Greater 0
			ColorMask RGB
			Blend DstColor Zero
			SetTexture [_ShadowTex] {
				combine texture, ONE - texture
				Matrix [_Projector]
			}
			SetTexture [_FalloffTex] {
				constantColor (1,1,1,0)
				combine previous lerp (texture) constant
				Matrix [_ProjectorClip]
			}
		}
	}
}";

I did quite a lot of Googling and forum searching for this problem with no luck.

Thanks.

Okay. The shadows seem to be working with ETC texture override selected from the build menu and 32 bit display buffer checked in the Player Settings. Is there something I can change to not have to use the 32 bit display buffer? It warns you that it hurts performance.

I finally got the sound working. It seems that Android devices don’t when you use audio.Play(). Something about calling Play too many times in a short amount of time before the previous clip was done playing.
I even tried this code to make sure that a new clip wouldn’t start until the old one was finished and no go:

if (!lowerLoad.clip.Equals(sounds[i].clip)  !lowerLoad.isPlaying)
{
     lowerLoad.clip = sounds[i].clip;
     lowerLoad.Play();
}

if (!higherLoad.clip.Equals(sounds[i + 1].clip)  !higherLoad.isPlaying)
{
     higherLoad.clip = sounds[i + 1].clip;
     higherLoad.Play();
}

So I refactored my code to use audio.PlayOneShot() and it’s working. Finally! I hope this will help someone else with the same issue.