hardware/alsa_sound
Révision | 4aedfad24855f6100b7a0d6c4bf1b6118527f2ec (tree) |
---|---|
l'heure | 2010-09-01 16:06:11 |
Auteur | Sean McNeil <sean.mcneil@wind...> |
Commiter | Sean McNeil |
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
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* ALSAMixer.cpp |
2 | 2 | ** |
3 | - ** Copyright 2008-2009 Wind River Systems | |
3 | + ** Copyright 2008-2010 Wind River Systems | |
4 | 4 | ** |
5 | 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
6 | 6 | ** you may not use this file except in compliance with the License. |
@@ -169,6 +169,8 @@ ALSAMixer::ALSAMixer() | ||
169 | 169 | |
170 | 170 | for (int i = 0; i <= SND_PCM_STREAM_LAST; i++) { |
171 | 171 | |
172 | + if (!mMixer[i]) continue; | |
173 | + | |
172 | 174 | mixer_info_t *info = mixerMasterProp[i].mInfo = new mixer_info_t; |
173 | 175 | |
174 | 176 | property_get (mixerMasterProp[i].propName, |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* AudioHardwareALSA.cpp |
2 | 2 | ** |
3 | - ** Copyright 2008-2009 Wind River Systems | |
3 | + ** Copyright 2008-2010 Wind River Systems | |
4 | 4 | ** |
5 | 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
6 | 6 | ** you may not use this file except in compliance with the License. |
@@ -117,10 +117,13 @@ AudioHardwareALSA::~AudioHardwareALSA() | ||
117 | 117 | |
118 | 118 | status_t AudioHardwareALSA::initCheck() |
119 | 119 | { |
120 | - if (mALSADevice && mMixer && mMixer->isValid()) | |
121 | - return NO_ERROR; | |
122 | - else | |
120 | + if (!mALSADevice) | |
123 | 121 | 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; | |
124 | 127 | } |
125 | 128 | |
126 | 129 | status_t AudioHardwareALSA::setVoiceVolume(float volume) |