DeprecatedBuildAndroid » History » Version 16
Denis 'GNUtoo' Carikli, 09/26/2009 08:27 PM
| 1 | 16 | Denis 'GNUtoo' Carikli | Edit: |
|---|---|---|---|
| 2 | We have now a temporary git repository at gitorious: |
||
| 3 | http://gitorious.org/replicant |
||
| 4 | |||
| 5 | 1 | Denis 'GNUtoo' Carikli | == Build system == |
| 6 | 8 | Denis 'GNUtoo' Carikli | * root your phone |
| 7 | * Backup your current system!!! |
||
| 8 | 12 | Denis 'GNUtoo' Carikli | * Check out the Dream Android repository following that howto: [http://source.android.com/documentation/building-for-dream],but be carefull...DO NOT put the files extracted by extract-files.sh in the build system...it would put proprietary files in your build,that you can't even redistribute,but keep wifi firmware for pushing it later if you can stand proprietary firmwares(/system/etc/wifi/Fw1251r1c.bin ) |
| 9 | 1 | Denis 'GNUtoo' Carikli | Android use a custom Makefile based buildsystem |
| 10 | 8 | Denis 'GNUtoo' Carikli | * Add the patches that can be find here [http://groups.fsf.org/wiki/Freest_hardware_comparisons/replicant] |
| 11 | 13 | Denis 'GNUtoo' Carikli | * Add HAVE_HTC_AUDIO_DRIVER := true to BoardConfig.mk |
| 12 | 8 | Denis 'GNUtoo' Carikli | * Add this patch for sound: |
| 13 | {{{ |
||
| 14 | diff --git a/include/hardware_legacy/AudioHardwareInterface.h b/include/hardware_legacy/AudioHardwareInterface.h |
||
| 15 | index 0aa3a95..371ee48 100644 |
||
| 16 | --- a/include/hardware_legacy/AudioHardwareInterface.h |
||
| 17 | +++ b/include/hardware_legacy/AudioHardwareInterface.h |
||
| 18 | -211,8 +211,7 @@ public: |
||
| 19 | int format, |
||
| 20 | int channelCount, |
||
| 21 | uint32_t sampleRate, |
||
| 22 | - status_t *status, |
||
| 23 | - AudioSystem::audio_in_acoustics acoustics) = 0; |
||
| 24 | + status_t *status) = 0; |
||
| 25 | |||
| 26 | /**This method dumps the state of the audio hardware */ |
||
| 27 | virtual status_t dumpState(int fd, const Vector<String16>& args) = 0; |
||
| 28 | diff --git a/libs/audioflinger/A2dpAudioInterface.cpp b/libs/audioflinger/A2dpAudioInterface.cpp |
||
| 29 | index b6d5078..15ce1dd 100644 |
||
| 30 | --- a/libs/audioflinger/A2dpAudioInterface.cpp |
||
| 31 | +++ b/libs/audioflinger/A2dpAudioInterface.cpp |
||
| 32 | -71,8 +71,7 @@ AudioStreamOut* A2dpAudioInterface::openOutputStream( |
||
| 33 | } |
||
| 34 | |||
| 35 | AudioStreamIn* A2dpAudioInterface::openInputStream( |
||
| 36 | - int format, int channelCount, uint32_t sampleRate, status_t *status, |
||
| 37 | - AudioSystem::audio_in_acoustics acoustics) |
||
| 38 | + int format, int channelCount, uint32_t sampleRate, status_t *status) |
||
| 39 | { |
||
| 40 | if (status) |
||
| 41 | *status = -1; |
||
| 42 | diff --git a/libs/audioflinger/A2dpAudioInterface.h b/libs/audioflinger/A2dpAudioInterface.h |
||
| 43 | index 7901a8c..e67f05f 100644 |
||
| 44 | --- a/libs/audioflinger/A2dpAudioInterface.h |
||
| 45 | +++ b/libs/audioflinger/A2dpAudioInterface.h |
||
| 46 | -58,8 +58,7 @@ public: |
||
| 47 | int format, |
||
| 48 | int channelCount, |
||
| 49 | uint32_t sampleRate, |
||
| 50 | - status_t *status, |
||
| 51 | - AudioSystem::audio_in_acoustics acoustics); |
||
| 52 | + status_t *status); |
||
| 53 | |||
| 54 | protected: |
||
| 55 | virtual status_t doRouting(); |
||
| 56 | diff --git a/libs/audioflinger/AudioDumpInterface.h b/libs/audioflinger/AudioDumpInterface.h |
||
| 57 | index 9a94102..42204d6 100644 |
||
| 58 | --- a/libs/audioflinger/AudioDumpInterface.h |
||
| 59 | +++ b/libs/audioflinger/AudioDumpInterface.h |
||
| 60 | -78,9 +78,8 @@ public: |
||
| 61 | virtual status_t setParameter(const char* key, const char* value) |
||
| 62 | {return mFinalInterface->setParameter(key, value);} |
||
| 63 | |||
| 64 | - virtual AudioStreamIn* openInputStream( int format, int channelCount, uint32_t sampleRate, status_t *status, |
||
| 65 | - AudioSystem::audio_in_acoustics acoustics) |
||
| 66 | - {return mFinalInterface->openInputStream( format, channelCount, sampleRate, status, acoustics);} |
||
| 67 | + virtual AudioStreamIn* openInputStream( int format, int channelCount, uint32_t sampleRate, status_t *status) |
||
| 68 | + {return mFinalInterface->openInputStream( format, channelCount, sampleRate, status);} |
||
| 69 | |||
| 70 | virtual status_t dump(int fd, const Vector<String16>& args) { return mFinalInterface->dumpState(fd, args); } |
||
| 71 | |||
| 72 | diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp |
||
| 73 | index 43df7dd..f376b67 100644 |
||
| 74 | --- a/libs/audioflinger/AudioFlinger.cpp |
||
| 75 | +++ b/libs/audioflinger/AudioFlinger.cpp |
||
| 76 | -2435,8 +2435,7 @@ bool AudioFlinger::AudioRecordThread::threadLoop() |
||
| 77 | input = mAudioHardware->openInputStream(mRecordTrack->format(), |
||
| 78 | mRecordTrack->channelCount(), |
||
| 79 | mRecordTrack->sampleRate(), |
||
| 80 | - &mStartStatus, |
||
| 81 | - (AudioSystem::audio_in_acoustics)(mRecordTrack->mFlags >> 16)); |
||
| 82 | + &mStartStatus); |
||
| 83 | if (input != 0) { |
||
| 84 | inBufferSize = input->bufferSize(); |
||
| 85 | inFrameCount = inBufferSize/input->frameSize(); |
||
| 86 | diff --git a/libs/audioflinger/AudioHardwareGeneric.cpp b/libs/audioflinger/AudioHardwareGeneric.cpp |
||
| 87 | index 62beada..e455186 100644 |
||
| 88 | --- a/libs/audioflinger/AudioHardwareGeneric.cpp |
||
| 89 | +++ b/libs/audioflinger/AudioHardwareGeneric.cpp |
||
| 90 | -93,8 +93,7 @@ void AudioHardwareGeneric::closeOutputStream(AudioStreamOutGeneric* out) { |
||
| 91 | } |
||
| 92 | |||
| 93 | AudioStreamIn* AudioHardwareGeneric::openInputStream( |
||
| 94 | - int format, int channelCount, uint32_t sampleRate, status_t *status, |
||
| 95 | - AudioSystem::audio_in_acoustics acoustics) |
||
| 96 | + int format, int channelCount, uint32_t sampleRate, status_t *status) |
||
| 97 | { |
||
| 98 | AutoMutex lock(mLock); |
||
| 99 | |||
| 100 | -108,7 +107,7 @@ AudioStreamIn* AudioHardwareGeneric::openInputStream( |
||
| 101 | |||
| 102 | // create new output stream |
||
| 103 | AudioStreamInGeneric* in = new AudioStreamInGeneric(); |
||
| 104 | - status_t lStatus = in->set(this, mFd, format, channelCount, sampleRate, acoustics); |
||
| 105 | + status_t lStatus = in->set(this, mFd, format, channelCount, sampleRate); |
||
| 106 | if (status) { |
||
| 107 | *status = lStatus; |
||
| 108 | } |
||
| 109 | -247,8 +246,7 @@ status_t AudioStreamInGeneric::set( |
||
| 110 | int fd, |
||
| 111 | int format, |
||
| 112 | int channels, |
||
| 113 | - uint32_t rate, |
||
| 114 | - AudioSystem::audio_in_acoustics acoustics) |
||
| 115 | + uint32_t rate) |
||
| 116 | { |
||
| 117 | // FIXME: remove logging |
||
| 118 | LOGD("AudioStreamInGeneric::set(%p, %d, %d, %d, %u)", hw, fd, format, channels, rate); |
||
| 119 | diff --git a/libs/audioflinger/AudioHardwareGeneric.h b/libs/audioflinger/AudioHardwareGeneric.h |
||
| 120 | index c949aa1..64e0396 100644 |
||
| 121 | --- a/libs/audioflinger/AudioHardwareGeneric.h |
||
| 122 | +++ b/libs/audioflinger/AudioHardwareGeneric.h |
||
| 123 | -69,8 +69,7 @@ public: |
||
| 124 | int mFd, |
||
| 125 | int format, |
||
| 126 | int channelCount, |
||
| 127 | - uint32_t sampleRate, |
||
| 128 | - AudioSystem::audio_in_acoustics acoustics); |
||
| 129 | + uint32_t sampleRate); |
||
| 130 | |||
| 131 | uint32_t sampleRate() const { return 8000; } |
||
| 132 | virtual size_t bufferSize() const { return 320; } |
||
| 133 | -115,8 +114,7 @@ public: |
||
| 134 | int format, |
||
| 135 | int channelCount, |
||
| 136 | uint32_t sampleRate, |
||
| 137 | - status_t *status, |
||
| 138 | - AudioSystem::audio_in_acoustics acoustics); |
||
| 139 | + status_t *status); |
||
| 140 | |||
| 141 | void closeOutputStream(AudioStreamOutGeneric* out); |
||
| 142 | void closeInputStream(AudioStreamInGeneric* in); |
||
| 143 | diff --git a/libs/audioflinger/AudioHardwareStub.cpp b/libs/audioflinger/AudioHardwareStub.cpp |
||
| 144 | index b13cb1c..683af04 100644 |
||
| 145 | --- a/libs/audioflinger/AudioHardwareStub.cpp |
||
| 146 | +++ b/libs/audioflinger/AudioHardwareStub.cpp |
||
| 147 | -57,10 +57,10 @@ AudioStreamOut* AudioHardwareStub::openOutputStream( |
||
| 148 | |||
| 149 | AudioStreamIn* AudioHardwareStub::openInputStream( |
||
| 150 | int format, int channelCount, uint32_t sampleRate, |
||
| 151 | - status_t *status, AudioSystem::audio_in_acoustics acoustics) |
||
| 152 | + status_t *status) |
||
| 153 | { |
||
| 154 | AudioStreamInStub* in = new AudioStreamInStub(); |
||
| 155 | - status_t lStatus = in->set(format, channelCount, sampleRate, acoustics); |
||
| 156 | + status_t lStatus = in->set(format, channelCount, sampleRate); |
||
| 157 | if (status) { |
||
| 158 | *status = lStatus; |
||
| 159 | } |
||
| 160 | -143,8 +143,7 @@ status_t AudioStreamOutStub::dump(int fd, const Vector<String16>& args) |
||
| 161 | |||
| 162 | // ---------------------------------------------------------------------------- |
||
| 163 | |||
| 164 | -status_t AudioStreamInStub::set(int format, int channels, uint32_t rate, |
||
| 165 | - AudioSystem::audio_in_acoustics acoustics) |
||
| 166 | +status_t AudioStreamInStub::set(int format, int channels, uint32_t rate) |
||
| 167 | { |
||
| 168 | if ((format == AudioSystem::PCM_16_BIT) && |
||
| 169 | (channels == channelCount()) && |
||
| 170 | diff --git a/libs/audioflinger/AudioHardwareStub.h b/libs/audioflinger/AudioHardwareStub.h |
||
| 171 | index d406424..24736ed 100644 |
||
| 172 | --- a/libs/audioflinger/AudioHardwareStub.h |
||
| 173 | +++ b/libs/audioflinger/AudioHardwareStub.h |
||
| 174 | -43,7 +43,7 @@ public: |
||
| 175 | |||
| 176 | class AudioStreamInStub : public AudioStreamIn { |
||
| 177 | public: |
||
| 178 | - virtual status_t set(int format, int channelCount, uint32_t sampleRate, AudioSystem::audio_in_acoustics acoustics); |
||
| 179 | + virtual status_t set(int format, int channelCount, uint32_t sampleRate); |
||
| 180 | virtual uint32_t sampleRate() const { return 8000; } |
||
| 181 | virtual size_t bufferSize() const { return 320; } |
||
| 182 | virtual int channelCount() const { return 1; } |
||
| 183 | -81,8 +81,7 @@ public: |
||
| 184 | int format, |
||
| 185 | int channelCount, |
||
| 186 | uint32_t sampleRate, |
||
| 187 | - status_t *status, |
||
| 188 | - AudioSystem::audio_in_acoustics acoustics); |
||
| 189 | + status_t *status); |
||
| 190 | |||
| 191 | protected: |
||
| 192 | virtual status_t doRouting() { return NO_ERROR; } |
||
| 193 | diff --git a/libaudio/AudioHardware.cpp b/libaudio/AudioHardware.cpp |
||
| 194 | index 0ece3f7..88dd46f 100644 |
||
| 195 | --- a/libaudio/AudioHardware.cpp |
||
| 196 | +++ b/libaudio/AudioHardware.cpp |
||
| 197 | -36,12 +36,51 @@ |
||
| 198 | #define LOG_SND_RPC 0 // Set to 1 to log sound RPC's |
||
| 199 | |||
| 200 | namespace android { |
||
| 201 | -static int audpre_index, tx_iir_index; |
||
| 202 | -static void * acoustic; |
||
| 203 | const uint32_t AudioHardware::inputSamplingRates[] = { |
||
| 204 | 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 |
||
| 205 | }; |
||
| 206 | + |
||
| 207 | + |
||
| 208 | + |
||
| 209 | // ---------------------------------------------------------------------------- |
||
| 210 | +static int snd_get_endpoint( int cnt,msm_snd_endpoint * ept) |
||
| 211 | +{ |
||
| 212 | + int fd; |
||
| 213 | + int status; |
||
| 214 | + fd = open("/dev/msm_snd",O_RDWR); |
||
| 215 | + if (fd < 0) |
||
| 216 | + { |
||
| 217 | + perror("Cannot open msm_snd device"); |
||
| 218 | + close(fd); |
||
| 219 | + return -1; |
||
| 220 | + } |
||
| 221 | + status = ioctl(fd,SND_GET_ENDPOINT, ept); |
||
| 222 | + close(fd); |
||
| 223 | + return status; |
||
| 224 | +} |
||
| 225 | + |
||
| 226 | +static int snd_get_num() |
||
| 227 | +{ |
||
| 228 | + int fd; |
||
| 229 | + int status; |
||
| 230 | + int mNumSndEndpoints; |
||
| 231 | + fd = open("/dev/msm_snd",O_RDWR); |
||
| 232 | + if (fd < 0) |
||
| 233 | + { |
||
| 234 | + perror("Cannot open msm_snd device"); |
||
| 235 | + return -1; |
||
| 236 | + } |
||
| 237 | + |
||
| 238 | + if(ioctl(fd,SND_GET_NUM_ENDPOINTS,&mNumSndEndpoints)<0 ) |
||
| 239 | + { |
||
| 240 | + perror("get number of endpoints error"); |
||
| 241 | + close(fd); |
||
| 242 | + return -1; |
||
| 243 | + } |
||
| 244 | + close(fd); |
||
| 245 | + return mNumSndEndpoints; |
||
| 246 | + |
||
| 247 | +} |
||
| 248 | |||
| 249 | AudioHardware::AudioHardware() : |
||
| 250 | mInit(false), mMicMute(true), mBluetoothNrec(true), mBluetoothId(0), |
||
| 251 | -54,44 +93,22 @@ AudioHardware::AudioHardware() : |
||
| 252 | SND_DEVICE_HEADSET(-1), |
||
| 253 | SND_DEVICE_HEADSET_AND_SPEAKER(-1) |
||
| 254 | { |
||
| 255 | - |
||
| 256 | - int (*snd_get_num)(); |
||
| 257 | - int (*snd_get_endpoint)(int, msm_snd_endpoint *); |
||
| 258 | - int (*set_acoustic_parameters)(); |
||
| 259 | + LOGE("inside AudioHardware::AudioHardware()"); |
||
| 260 | + //int snd_get_num(); |
||
| 261 | + //int snd_get_endpoint(int cnt,msm_snd_endpoint *ept); |
||
| 262 | + //int (*snd_get_num)(); |
||
| 263 | + //int (*snd_get_endpoint)(int, msm_snd_endpoint *); |
||
| 264 | |||
| 265 | struct msm_snd_endpoint *ept; |
||
| 266 | - |
||
| 267 | - acoustic = ::dlopen("/system/lib/libhtc_acoustic.so", RTLD_NOW); |
||
| 268 | - if (acoustic == NULL ) { |
||
| 269 | - LOGE("Could not open libhtc_acoustic.so"); |
||
| 270 | - return; |
||
| 271 | - } |
||
| 272 | - |
||
| 273 | - set_acoustic_parameters = (int (*)(void))::dlsym(acoustic, "set_acoustic_parameters"); |
||
| 274 | - if ((*set_acoustic_parameters) == 0 ) { |
||
| 275 | - LOGE("Could not open set_acoustic_parameters()"); |
||
| 276 | - return; |
||
| 277 | - } |
||
| 278 | - |
||
| 279 | - int rc = set_acoustic_parameters(); |
||
| 280 | - if (rc < 0) { |
||
| 281 | - LOGE("Could not set acoustic parameters to share memory: %d", rc); |
||
| 282 | -// return; |
||
| 283 | - } |
||
| 284 | - |
||
| 285 | - snd_get_num = (int (*)(void))::dlsym(acoustic, "snd_get_num_endpoints"); |
||
| 286 | - if ((*snd_get_num) == 0 ) { |
||
| 287 | - LOGE("Could not open snd_get_num()"); |
||
| 288 | -// return; |
||
| 289 | - } |
||
| 290 | - |
||
| 291 | + LOGE("before"); |
||
| 292 | mNumSndEndpoints = snd_get_num(); |
||
| 293 | + LOGE("after"); |
||
| 294 | LOGD("mNumSndEndpoints = %d", mNumSndEndpoints); |
||
| 295 | mSndEndpoints = new msm_snd_endpoint[mNumSndEndpoints]; |
||
| 296 | mInit = true; |
||
| 297 | LOGV("constructed %d SND endpoints)", mNumSndEndpoints); |
||
| 298 | - ept = mSndEndpoints; |
||
| 299 | - snd_get_endpoint = (int (*)(int, msm_snd_endpoint *))::dlsym(acoustic, "snd_get_endpoint"); |
||
| 300 | + ept = mSndEndpoints; //LOOK AT mSndEndpoints type... |
||
| 301 | + |
||
| 302 | if ((*snd_get_endpoint) == 0 ) { |
||
| 303 | LOGE("Could not open snd_get_endpoint()"); |
||
| 304 | return; |
||
| 305 | -121,7 +138,6 @@ AudioHardware::~AudioHardware() |
||
| 306 | delete mInput; |
||
| 307 | delete mOutput; |
||
| 308 | delete [] mSndEndpoints; |
||
| 309 | - ::dlclose(acoustic); |
||
| 310 | mInit = false; |
||
| 311 | } |
||
| 312 | |||
| 313 | -168,8 +184,7 @@ void AudioHardware::closeOutputStream(AudioStreamOutMSM72xx* out) { |
||
| 314 | } |
||
| 315 | |||
| 316 | AudioStreamIn* AudioHardware::openInputStream( |
||
| 317 | - int format, int channelCount, uint32_t sampleRate, status_t *status, |
||
| 318 | - AudioSystem::audio_in_acoustics acoustic_flags) |
||
| 319 | + int format, int channelCount, uint32_t sampleRate, status_t *status) |
||
| 320 | { |
||
| 321 | mLock.lock(); |
||
| 322 | // input stream already open? |
||
| 323 | -182,7 +197,7 @@ AudioStreamIn* AudioHardware::openInputStream( |
||
| 324 | } |
||
| 325 | |||
| 326 | AudioStreamInMSM72xx* in = new AudioStreamInMSM72xx(); |
||
| 327 | - status_t lStatus = in->set(this, format, channelCount, sampleRate, acoustic_flags); |
||
| 328 | + status_t lStatus = in->set(this, format, channelCount, sampleRate); |
||
| 329 | if (status) { |
||
| 330 | *status = lStatus; |
||
| 331 | } |
||
| 332 | -449,6 +464,42 @@ static int count_bits(uint32_t vector) |
||
| 333 | return bits; |
||
| 334 | } |
||
| 335 | |||
| 336 | +static int msm72xx_enable_audpp (uint16_t enable_mask) |
||
| 337 | +{ |
||
| 338 | + int fd; |
||
| 339 | + |
||
| 340 | +// if (!audpp_filter_inited) |
||
| 341 | +// return -1; |
||
| 342 | + |
||
| 343 | + fd = open ("/dev/msm_pcm_ctl", O_RDWR); |
||
| 344 | + if (fd < 0) |
||
| 345 | + { |
||
| 346 | + perror ("Cannot open audio device"); |
||
| 347 | + return -1; |
||
| 348 | + } |
||
| 349 | + |
||
| 350 | + if (enable_mask & ADRC_ENABLE) |
||
| 351 | + enable_mask &= ~ADRC_ENABLE; |
||
| 352 | + if (enable_mask & EQ_ENABLE) |
||
| 353 | + enable_mask &= ~EQ_ENABLE; |
||
| 354 | + if (enable_mask & RX_IIR_ENABLE) |
||
| 355 | + enable_mask &= ~RX_IIR_ENABLE; |
||
| 356 | + |
||
| 357 | + printf ("msm72xx_enable_audpp: 0x%04x", enable_mask); |
||
| 358 | + if (ioctl (fd, AUDIO_ENABLE_AUDPP, &enable_mask) < 0) |
||
| 359 | + { |
||
| 360 | + perror ("enable audpp error"); |
||
| 361 | + close (fd); |
||
| 362 | + return -1; |
||
| 363 | + } |
||
| 364 | + |
||
| 365 | + close (fd); |
||
| 366 | + return 0; |
||
| 367 | +} |
||
| 368 | + |
||
| 369 | + |
||
| 370 | + |
||
| 371 | + |
||
| 372 | status_t AudioHardware::doRouting() |
||
| 373 | { |
||
| 374 | Mutex::Autolock lock(mLock); |
||
| 375 | -460,8 +511,7 @@ status_t AudioHardware::doRouting() |
||
| 376 | " picking closest possible route...", routes); |
||
| 377 | } |
||
| 378 | } |
||
| 379 | - int (*msm72xx_enable_audpp)(int); |
||
| 380 | - msm72xx_enable_audpp = (int (*)(int))::dlsym(acoustic, "msm72xx_enable_audpp"); |
||
| 381 | + |
||
| 382 | status_t ret = NO_ERROR; |
||
| 383 | if (routes & AudioSystem::ROUTE_BLUETOOTH_SCO) { |
||
| 384 | LOGI("Routing audio to Bluetooth PCM\n"); |
||
| 385 | -700,14 +750,12 @@ bool AudioHardware::AudioStreamOutMSM72xx::checkStandby() |
||
| 386 | AudioHardware::AudioStreamInMSM72xx::AudioStreamInMSM72xx() : |
||
| 387 | mHardware(0), mFd(-1), mState(AUDIO_INPUT_CLOSED), mRetryCount(0), |
||
| 388 | mFormat(AUDIO_HW_IN_FORMAT), mChannelCount(AUDIO_HW_IN_CHANNELS), |
||
| 389 | - mSampleRate(AUDIO_HW_IN_SAMPLERATE), mBufferSize(AUDIO_HW_IN_BUFFERSIZE), |
||
| 390 | - mAcoustics((AudioSystem::audio_in_acoustics)0) |
||
| 391 | + mSampleRate(AUDIO_HW_IN_SAMPLERATE), mBufferSize(AUDIO_HW_IN_BUFFERSIZE) |
||
| 392 | { |
||
| 393 | } |
||
| 394 | |||
| 395 | status_t AudioHardware::AudioStreamInMSM72xx::set( |
||
| 396 | - AudioHardware* hw, int format, int channelCount, uint32_t sampleRate, |
||
| 397 | - AudioSystem::audio_in_acoustics acoustic_flags) |
||
| 398 | + AudioHardware* hw, int format, int channelCount, uint32_t sampleRate) |
||
| 399 | { |
||
| 400 | LOGV("AudioStreamInMSM72xx::set(%d, %d, %u)", format, channelCount, sampleRate); |
||
| 401 | if (mFd >= 0) { |
||
| 402 | -763,26 +811,7 @@ status_t AudioHardware::AudioStreamInMSM72xx::set( |
||
| 403 | mHardware = hw; |
||
| 404 | mHardware->setMicMute_nosync(false); |
||
| 405 | mState = AUDIO_INPUT_OPENED; |
||
| 406 | - audpre_index = calculate_audpre_table_index(sampleRate); |
||
| 407 | - tx_iir_index = (audpre_index * 2) + (hw->checkOutputStandby() ? 0 : 1); |
||
| 408 | - LOGD("audpre_index = %d, tx_iir_index = %d\n", audpre_index, tx_iir_index); |
||
| 409 | - |
||
| 410 | - /** |
||
| 411 | - * If audio-preprocessing failed, we should not block record. |
||
| 412 | - */ |
||
| 413 | - int (*msm72xx_set_audpre_params)(int, int); |
||
| 414 | - msm72xx_set_audpre_params = (int (*)(int, int))::dlsym(acoustic, "msm72xx_set_audpre_params"); |
||
| 415 | - status = msm72xx_set_audpre_params(audpre_index, tx_iir_index); |
||
| 416 | - if (status < 0) |
||
| 417 | - LOGE("Cannot set audpre parameters"); |
||
| 418 | - |
||
| 419 | - int (*msm72xx_enable_audpre)(int, int, int); |
||
| 420 | - msm72xx_enable_audpre = (int (*)(int, int, int))::dlsym(acoustic, "msm72xx_enable_audpre"); |
||
| 421 | - mAcoustics = acoustic_flags; |
||
| 422 | - status = msm72xx_enable_audpre((int)acoustic_flags, audpre_index, tx_iir_index); |
||
| 423 | - if (status < 0) |
||
| 424 | - LOGE("Cannot enable audpre"); |
||
| 425 | - |
||
| 426 | + |
||
| 427 | return NO_ERROR; |
||
| 428 | |||
| 429 | Error: |
||
| 430 | -811,7 +840,7 @@ ssize_t AudioHardware::AudioStreamInMSM72xx::read( void* buffer, ssize_t bytes) |
||
| 431 | uint8_t* p = static_cast<uint8_t*>(buffer); |
||
| 432 | |||
| 433 | if (mState < AUDIO_INPUT_OPENED) { |
||
| 434 | - if (set(mHardware, mFormat, mChannelCount, mSampleRate, mAcoustics) != NO_ERROR) { |
||
| 435 | + if (set(mHardware, mFormat, mChannelCount, mSampleRate) != NO_ERROR) { |
||
| 436 | return -1; |
||
| 437 | } |
||
| 438 | } |
||
| 439 | diff --git a/libaudio/AudioHardware.h b/libaudio/AudioHardware.h |
||
| 440 | index 047bad3..2111e16 100644 |
||
| 441 | --- a/libaudio/AudioHardware.h |
||
| 442 | +++ b/libaudio/AudioHardware.h |
||
| 443 | -128,8 +128,8 @@ public: |
||
| 444 | int format, |
||
| 445 | int channelCount, |
||
| 446 | uint32_t sampleRate, |
||
| 447 | - status_t *status, |
||
| 448 | - AudioSystem::audio_in_acoustics acoustics); |
||
| 449 | + status_t *status |
||
| 450 | + ); |
||
| 451 | |||
| 452 | void closeOutputStream(AudioStreamOutMSM72xx* out); |
||
| 453 | void closeInputStream(AudioStreamInMSM72xx* in); |
||
| 454 | -190,8 +190,8 @@ private: |
||
| 455 | status_t set(AudioHardware* mHardware, |
||
| 456 | int format, |
||
| 457 | int channelCount, |
||
| 458 | - uint32_t sampleRate, |
||
| 459 | - AudioSystem::audio_in_acoustics acoustics); |
||
| 460 | + uint32_t sampleRate |
||
| 461 | + ); |
||
| 462 | virtual size_t bufferSize() const { return mBufferSize; } |
||
| 463 | virtual int channelCount() const { return mChannelCount; } |
||
| 464 | virtual int format() const { return mFormat; } |
||
| 465 | -210,7 +210,7 @@ private: |
||
| 466 | int mChannelCount; |
||
| 467 | uint32_t mSampleRate; |
||
| 468 | size_t mBufferSize; |
||
| 469 | - AudioSystem::audio_in_acoustics mAcoustics; |
||
| 470 | + |
||
| 471 | }; |
||
| 472 | |||
| 473 | static const uint32_t inputSamplingRates[]; |
||
| 474 | }}} |
||
| 475 | 15 | Aaron Williamson - | |
| 476 | The RIL (radio library) can be replaced with the Openmoko RIL. Use the following patch to enable phone-unlock PIN entry (FIXME: add information on where to get OpenMoko RIL and how to add it to Android build): |
||
| 477 | {{{ |
||
| 478 | Index: replicant/hardware/ril/reference-ril/reference-ril.c |
||
| 479 | =================================================================== |
||
| 480 | --- replicant.orig/hardware/ril/reference-ril/reference-ril.c |
||
| 481 | +++ replicant/hardware/ril/reference-ril/reference-ril.c |
||
| 482 | -1152,7 +1152,7 @@ static void requestEnterSimPin(void* d |
||
| 483 | } else |
||
| 484 | goto error; |
||
| 485 | |||
| 486 | - err = at_send_command_singleline(cmd, "+CPIN:", &p_response); |
||
| 487 | + err = at_send_command(cmd, &p_response); |
||
| 488 | free(cmd); |
||
| 489 | |||
| 490 | if (err < 0 || p_response->success == 0) { |
||
| 491 | -1802,6 +1802,13 @@ static void onUnsolicited (const char *s |
||
| 492 | /* Ignore unsolicited responses until we're initialized. |
||
| 493 | * This is OK because the RIL library will poll for initial state |
||
| 494 | */ |
||
| 495 | + if(strStartsWith(s, "+PB_READY") ) { |
||
| 496 | + setRadioState(RADIO_STATE_SIM_READY); |
||
| 497 | + LOGD("REMOVE_THAT: SIM IS READY\n"); |
||
| 498 | + return; |
||
| 499 | + //sim is now ready |
||
| 500 | + } |
||
| 501 | + |
||
| 502 | if (sState == RADIO_STATE_UNAVAILABLE) { |
||
| 503 | return; |
||
| 504 | } |
||
| 505 | }}} |
||
| 506 | |||
| 507 | 5 | Denis 'GNUtoo' Carikli | Build process: |
| 508 | Let's say that our build directory is ~/replicant |
||
| 509 | * Add that file: |
||
| 510 | {{{ |
||
| 511 | TARGET_PRODUCT := htc_dream |
||
| 512 | }}} |
||
| 513 | To ~/replicant/buildspec.mk |
||
| 514 | * Then type |
||
| 515 | {{{ |
||
| 516 | cd ~/replicant |
||
| 517 | export ANDROID_JAVA_HOME=$JAVA_HOME |
||
| 518 | make |
||
| 519 | }}} |
||
| 520 | 12 | Denis 'GNUtoo' Carikli | * The files to flash are in ~/replicant/out/target/product/dream,flash them and then clear the cache |
| 521 | * boot and push the wifi firmware if you want it |
||
| 522 | 5 | Denis 'GNUtoo' Carikli | |
| 523 | 1 | Denis 'GNUtoo' Carikli | |
| 524 | |||
| 525 | |||
| 526 | == Status == |
||
| 527 | 4 | Denis 'GNUtoo' Carikli | * web browser crashes |
| 528 | 14 | Denis 'GNUtoo' Carikli | * ril seem to work(I made some calls and received sms,but can't receive calls) |
| 529 | 12 | Denis 'GNUtoo' Carikli | * sound on the application cpu(the baseband cpu has sound too) now works |