Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-alsa_sound: Commit

hardware/alsa_sound


Commit MetaInfo

Révision4aedfad24855f6100b7a0d6c4bf1b6118527f2ec (tree)
l'heure2010-09-01 16:06:11
AuteurSean McNeil <sean.mcneil@wind...>
CommiterSean McNeil

Message de Log

Support no ALSA mixing.

When no ALSA controls can be found, do not treat as a fatal condition.
Instead, report back to callers that the operation is not supported.
This will cause Audioflinger to perform software volume mixing instead.

Change-Id: I2843433c2cd3ed45e4888000f823aa5f34d3b5f7

Change Summary

Modification

--- a/ALSAMixer.cpp
+++ b/ALSAMixer.cpp
@@ -1,6 +1,6 @@
11 /* ALSAMixer.cpp
22 **
3- ** Copyright 2008-2009 Wind River Systems
3+ ** Copyright 2008-2010 Wind River Systems
44 **
55 ** Licensed under the Apache License, Version 2.0 (the "License");
66 ** you may not use this file except in compliance with the License.
@@ -169,6 +169,8 @@ ALSAMixer::ALSAMixer()
169169
170170 for (int i = 0; i <= SND_PCM_STREAM_LAST; i++) {
171171
172+ if (!mMixer[i]) continue;
173+
172174 mixer_info_t *info = mixerMasterProp[i].mInfo = new mixer_info_t;
173175
174176 property_get (mixerMasterProp[i].propName,
--- a/AudioHardwareALSA.cpp
+++ b/AudioHardwareALSA.cpp
@@ -1,6 +1,6 @@
11 /* AudioHardwareALSA.cpp
22 **
3- ** Copyright 2008-2009 Wind River Systems
3+ ** Copyright 2008-2010 Wind River Systems
44 **
55 ** Licensed under the Apache License, Version 2.0 (the "License");
66 ** you may not use this file except in compliance with the License.
@@ -117,10 +117,13 @@ AudioHardwareALSA::~AudioHardwareALSA()
117117
118118 status_t AudioHardwareALSA::initCheck()
119119 {
120- if (mALSADevice && mMixer && mMixer->isValid())
121- return NO_ERROR;
122- else
120+ if (!mALSADevice)
123121 return NO_INIT;
122+
123+ if (!mMixer || !mMixer->isValid())
124+ LOGW("ALSA Mixer is not valid. AudioFlinger will do software volume control.");
125+
126+ return NO_ERROR;
124127 }
125128
126129 status_t AudioHardwareALSA::setVoiceVolume(float volume)
Afficher sur ancien navigateur de dépôt.