Hi, I am facing a similar issue with Donut release using kernel 2.6.27. Even when I run A2DP at 921Kbps, I am getting "write blocked for %ms" error. See this log snippet below. I have tried changing the bitpool down to 35, but that hasn't helped.
Earlier, when I used Cupcake build, I could breakfree music even with 460Kbps on the same platform. Looking at the code, I saw that liba2dp.c (external/bluez/utils/audio) has changed and so has the Audioflinger part since Android 1.6. Is this issue of A2DP glitches a known problem with Donut? ============================================================================================================== D/BluetoothDeviceService( 655): found 0 bonded devices D/BluetoothDeviceService( 655): Bluetooth state 1 -> 2 D/A2dpAudioInterface( 629): setParameter bluetooth_enabled,true D/A2dpAudioInterface( 629): setBluetoothEnabled 1 I/bluetooth_ScoSocket.cpp( 709): Listening SCO socket... W/BluetoothHeadset( 857): Proxy not attached to service W/BluetoothHeadset( 857): Proxy not attached to service W/BluetoothHeadset( 857): Proxy not attached to service W/BluetoothHeadset( 857): Proxy not attached to service D/dalvikvm( 712): GC freed 888 objects / 38672 bytes in 66ms D/dalvikvm( 857): GC freed 4789 objects / 208352 bytes in 68ms D/dalvikvm( 655): GC freed 8824 objects / 380952 bytes in 112ms I/BluetoothEventLoop.cpp( 655): DiscoveryCompleted signal received I/BluetoothEventLoop.cpp( 655): DiscoveryStarted signal received D/BluetoothDeviceService( 655): 00:13:17:70:53:DB bond state 0 -> 2 (0) I/BluetoothEventLoop.cpp( 655): DiscoveryCompleted signal received D/BluetoothDeviceService( 655): 00:13:17:70:53:DB bond state 2 -> 1 (0) D/BT HSHFP( 709): Loaded priority 00:13:17:70:53:DB = 0 D/BT HSHFP( 709): Saved priority 00:13:17:70:53:DB = 100 D/BT HSHFP( 709): Headset state 0 -> 1, result = 1 D/BT HSHFP( 709): Handsfree SDP request D/dalvikvm( 857): GC freed 9346 objects / 547312 bytes in 73ms D/BT HSHFP( 709): SDP request returned 2 (882 ms) I/BT HSHFP( 709): Created RFCOMM socket fd 33. I/BT HSHFP( 709): async connect is in progress (Operation now in progress) I/BT HSHFP( 709): Successful RFCOMM socket connect. D/BT HSHFP( 709): RFCOMM connection attempt took 825 ms D/BT HSHFP( 709): Rfcomm connected D/BT HSHFP( 709): Headset state 1 -> 2, result = 1 D/BluetoothA2dpService( 655): connectSink(00:13:17:70:53:DB) D/BluetoothA2dpService( 655): new bluez sink: 00:13:17:70:53:DB (/org/ bluez/audio/device0) D/A2dpAudioInterface( 629): setParameter bt_headset_name,Jabra BT620s D/BluetoothA2dpService( 655): state 00:13:17:70:53:DB (/org/bluez/ audio/device0) 0->1 D/A2dpAudioInterface( 629): setParameter bt_headset_nrec,on I/Bluetooth AT recv( 709): AT+BRSF=27 I/Bluetooth AT sent( 709): +BRSF: 99 I/Bluetooth AT sent( 709): OK I/Bluetooth AT recv( 709): AT+CIND=? I/Bluetooth AT sent( 709): +CIND: ("service",(0-1)),("call",(0-1)), ("callsetup",(0-3)),("callheld",(0-2)),("signal",(0-5)),("roam",(0-1)), ("battchg",(0-5)) I/Bluetooth AT sent( 709): OK I/Bluetooth AT recv( 709): AT+CIND? I/Bluetooth AT sent( 709): +CIND: 0,0,0,0,5,0,5 I/Bluetooth AT sent( 709): OK I/Bluetooth AT recv( 709): AT+CMER=3, 0, 0, 1 I/Bluetooth AT sent( 709): OK I/Bluetooth AT recv( 709): AT+CHLD=? I/Bluetooth AT sent( 709): +CHLD: (0,1,2,3) I/Bluetooth AT sent( 709): OK I/Bluetooth AT recv( 709): AT+CCWA=1 I/Bluetooth AT sent( 709): OK I/Bluetooth AT recv( 709): AT+NREC=0 D/A2dpAudioInterface( 629): setParameter bt_headset_nrec,off I/Bluetooth AT sent( 709): OK D/A2dpAudioInterface( 629): setParameter a2dp_sink_address, 00:13:17:70:53:DB D/A2DP ( 629): bluetooth_init D/A2DP ( 629): bluetooth_configure D/AudioFlinger( 629): set output to A2DP D/BluetoothA2dpService( 655): state 00:13:17:70:53:DB (/org/bluez/ audio/device0) 1->2 D/A2DP ( 629): bluetooth_a2dp_hw_params sending configuration: D/A2DP ( 629): channel_mode: JOINT STEREO D/A2DP ( 629): frequency: 44100 D/A2DP ( 629): allocation_method: LOUDNESS D/A2DP ( 629): subbands: 8 D/A2DP ( 629): block_length: 16 D/A2DP ( 629): min_bitpool: 2 D/A2DP ( 629): max_bitpool: 50 D/A2DP ( 629): MTU: 895 D/A2DP ( 629): frame_duration: 2902 us D/A2DP ( 629): allocation=0 D/A2DP ( 629): subbands=1 D/A2DP ( 629): blocks=3 D/A2DP ( 629): bitpool=50 I/Bluetooth AT recv( 709): AT+VGS=07 D/VolumePanel( 655): onVolumeChanged(streamType: 6, flags: 0) I/Bluetooth AT sent( 709): OK W/KeyCharacterMap( 712): No keyboard for id 0 W/KeyCharacterMap( 712): Using default keymap: /system/usr/keychars/ qwerty.kcm.bin D/dalvikvm( 712): GC freed 192 objects / 6576 bytes in 62ms W/KeyCharacterMap( 712): No keyboard for id 0 W/KeyCharacterMap( 712): Using default keymap: /system/usr/keychars/ qwerty.kcm.bin I/ActivityManager( 655): Starting activity: Intent { act=android.intent.action.MAIN cat= [android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.music/.MusicBrowserActivity } I/ActivityManager( 655): Start proc com.android.music for activity com.android.music/.MusicBrowserActivity: pid=881 uid=10013 gids={3003, 1015} D/installd( 636): DexInv: --- BEGIN '/system/app/Music.apk' --- D/dalvikvm( 628): GC freed 283 objects / 10816 bytes in 75ms D/dalvikvm( 628): GC freed 50 objects / 2216 bytes in 61ms D/dalvikvm( 628): GC freed 2 objects / 48 bytes in 82ms D/dalvikvm( 888): DexOpt: load 58ms, verify 187ms, opt 8ms D/installd( 636): DexInv: --- END '/system/app/Music.apk' (success) --- I/ActivityManager( 655): Displayed activity com.android.music/.MusicBrowserActivity: 1173 ms (total 1173 ms) W/KeyCharacterMap( 881): No keyboard for id 0 W/KeyCharacterMap( 881): Using default keymap: /system/usr/keychars/ qwerty.kcm.bin I/ActivityManager( 655): Starting activity: Intent { act=android.intent.action.PICK dat= typ=vnd.android.cursor.dir/track cmp=com.android.music/.TrackBrowserActivity } I/ActivityManager( 655): Displayed activity com.android.music/.TrackBrowserActivity: 121 ms (total 121 ms) D/dalvikvm( 778): GC freed 2485 objects / 171032 bytes in 68ms D/dalvikvm( 857): GC freed 6318 objects / 384656 bytes in 70ms D/dalvikvm( 712): GC freed 297 objects / 10840 bytes in 59ms I/vold ( 626): New MMC card 'SD01G' (serial 3288757336) added @ / devices/MMC/mmc_host/mmc1/mmc1:b368 I/vold ( 626): Disk (blkdev 179:8), 1961984 secs (958 MB) 4 partitions I/vold ( 626): New blkdev 179.8 on media SD01G, media path / devices/MMC/mmc_host/mmc1/mmc1:b368, Dpp 1 W/vold ( 626): Skipping partition 8 I/vold ( 626): Partition (blkdev 179:9), 1961729 secs (957 MB) type 0x0 I/vold ( 626): New blkdev 179.9 on media SD01G, media path / devices/MMC/mmc_host/mmc1/mmc1:b368, Dpp 0 D/dalvikvm( 881): GREF has increased to 201 D/dalvikvm( 881): GC freed 4078 objects / 251472 bytes in 70ms D/dalvikvm( 778): GREF has increased to 201 D/AndroidRuntime( 901): D/AndroidRuntime( 901): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<< D/AndroidRuntime( 901): CheckJNI is ON D/AndroidRuntime( 901): --- registering native functions --- D/AndroidRuntime( 901): Shutting down VM D/ ( 881): unable to unlink '/data/data/com.android.music/ shared_prefs/Music.xml.bak': No such file or directory (errno=2) D/dalvikvm( 901): DestroyJavaVM waiting for non-daemon threads to exit D/dalvikvm( 901): DestroyJavaVM shutting VM down D/dalvikvm( 901): HeapWorker thread shutting down D/dalvikvm( 901): HeapWorker thread has shut down D/jdwp ( 901): JDWP shutting down net... D/dalvikvm( 901): VM cleaning up I/ActivityManager( 655): Starting activity: Intent { cmp=com.android.music/.ScanningProgress } D/dalvikvm( 901): LinearAlloc 0x0 used 684732 of 4194304 (16%) I/ARMAssembler( 655): generated scanline__00000077:03515104_00001001_00000000 [ 64 ipp] (84 ins) at [0x256d58:0x256ea8] in 0 ns D/MediaScannerService( 778): start scanning volume external V/MediaProvider( 778): /sdcard volume ID: 1522521131 I/ActivityManager( 655): Displayed activity com.android.music/.ScanningProgress: 188 ms (total 188 ms) I/MediaProvider( 778): Upgrading media database from version 0 to 76, which will destroy all old data V/MediaProvider( 778): Attached volume: external V/MediaScanner( 778): pruneDeadThumbnailFiles... android.database.sqlite.sqlitecur...@4393c718 V/MediaScanner( 778): /pruneDeadThumbnailFiles... android.database.sqlite.sqlitecur...@4393c718 D/MediaScanner( 778): prescan time: 22ms D/MediaScanner( 778): scan time: 5222ms D/MediaScanner( 778): postscan time: 6ms D/MediaScanner( 778): total time: 5250ms D/MediaScannerService( 778): done scanning volume external I/ActivityManager( 655): Stopping service: com.android.providers.media/.MediaScannerService D/A2DP ( 629): bluetooth_start D/dalvikvm( 655): GC freed 10752 objects / 431624 bytes in 94ms I/ActivityManager( 655): Starting activity: Intent { act=com.android.music.PLAYBACK_VIEWER flg=0x4000000 cmp=com.android.music/.MediaPlaybackActivity } D/dalvikvm( 881): GC freed 4049 objects / 307800 bytes in 66ms I/ActivityManager( 655): Displayed activity com.android.music/.MediaPlaybackActivity: 350 ms (total 350 ms) E/A2dpAudioInterface( 629): a2dp_write failed err: -110 W/AudioFlinger( 629): write blocked for 529 msecs E/A2dpAudioInterface( 629): a2dp_write failed err: -110 W/AudioFlinger( 629): write blocked for 519 msecs D/BluetoothA2dpService( 655): state 00:13:17:70:53:DB (/org/bluez/ audio/device0) 2->4 W/AudioFlinger( 629): write blocked for 221 msecs ==================================================================================================================== Thanks, Sidharth On Nov 16, 9:24 am, Mike <mikebro...@gmail.com> wrote: > Hi Ash, > Please find the answer to the questions you have asked. > > You are able to get the bluetooth on with 460800/921600 > baud-rate > > using hciattach?? > yes. I mean hciattach is working with the above > baud rates > > >But you want to change the baud-rate using hciconfig > too?? > No, I am doing hciconfig hci0 up I am getting > the followin error. > I am getting Can't init device hci0 : Connection Timed Out (110). > But the things are working perfectly with 115200 Baud rate. > hciattach with 115200 speed > hciconfig hci0 up > ====> Working > > hciattach with 460800 or 921600 baud-rate - > working > hciconfig hci0 up -> not working Connection timed Out error. > > Thanks, > Jaya Chandra > > On Nov 14, 3:54 pm, Ash <ashoks...@gmail.com> wrote: > > > > > And what error are you getting when you do hciconfig with other baud- > > rate configurations?? > > > On Nov 14, 3:49 pm, Ash <ashoks...@gmail.com> wrote: > > > > Hi Mike, > > > > Let me understand your problem clearly. > > > > You are able to get the bluetooth on with 460800/921600 baud-rate > > > using hciattach?? > > > But you want to change the baud-rate using hciconfig too?? > > > > On Nov 13, 7:12 am, Mike <mikebro...@gmail.com> wrote: > > > > > HiAsh, > > > > Thanks for the reply. > > > > Yeah I checked the hciattch.c file, there is baud rate change code for > > > > 460800 as well as 921600. > > > > And I am able to do hciattach with the above configurations but the > > > > hciconfig hci0 up is not working. > > > > Please lemme know ... > > > > > On Nov 12, 8:46 pm,Ash<ashoks...@gmail.com> wrote: > > > > > > One more thing about: > > > > > > "If yes please let me know how can I do that since hciconfig hci0 up > > > > > is > > > > > not working with baud rate more than 115200." > > > > > > To resolve this erify that you platform specific code in hciattch has > > > > > required code to do the baudrate change. > > > > > > On Nov 12, 8:42 pm,Ash<ashoks...@gmail.com> wrote: > > > > > > > Hi Mike, > > > > > > > Yes, you need to increase the baud rate, chanding bit pool value > > > > > > will > > > > > > not help you definately. Ideally high qualityA2DPaudio data needs > > > > > > 320-350Kbps of band width. For running this you would need baud-rate > > > > > > of 460.8Kbps which will run basic audio(80% audio data) for you, > > > > > > but i > > > > > > would suggest you to use 921.6Kbps. > > > > > > > Changing the baud-rate will depend platform you are using. In BlueZ > > > > > > baud-rate is configured using hciattach tool during bluetooth on > > > > > > process. hciattach has platform specific code which does the vendor > > > > > > specific initialization and baud-rate change. > > > > > > > By the way which platform are you working on? > > > > > > > I am not sure hci0 up would work, i will verify and come back to > > > > > > you. > > > > > > If you are working on source code you can check in hciattach, > > > > > > whether > > > > > > it is possible or not. And intial configuration for hciattach is > > > > > > taken > > > > > > from init.trout.rc, you can set the configuration in there. > > > > > > > On Nov 11, 7:08 am, Mike <mikebro...@gmail.com> wrote: > > > > > > > > Hi All, > > > > > > > I am working on the eclair code base. And I just started enabling > > > > > > > BlueZ and started working on it. > > > > > > > The basic profiles seems to be working fine. But When I play > > > > > > > media on > > > > > > > my headset there is a time delay oocured when playing the media on > > > > > > > headset and hence after 2 seconds of play it stops for 2 seconds > > > > > > > and > > > > > > > plays again. > > > > > > > During this process I saw error message "a2dp_write failed err: > > > > > > > -110". > > > > > > > > 1-01 00:09:48.980: INFO/AudioHardwareALSA(1991): Initialized ALSA > > > > > > > PLAYBACK device AndroidPlayback_Speaker_normal > > > > > > > 01-01 00:09:48.980: DEBUG/AudioHardwareALSA(1991): Set PLAYBACK > > > > > > > PCM > > > > > > > format to S16_LE (Signed 16 bit Little Endian) > > > > > > > 01-01 00:09:48.985: DEBUG/AudioHardwareALSA(1991): Using 2 > > > > > > > channels > > > > > > > for PLAYBACK. > > > > > > > 01-01 00:09:48.985: DEBUG/A2DP(1991): ********** a2dp_write > > > > > > > ********** > > > > > > > 01-01 00:09:48.990: DEBUG/A2DP(1991): bluetooth_start > > > > > > > 01-01 00:09:49.000: DEBUG/AudioHardwareALSA(1991): Set PLAYBACK > > > > > > > sample > > > > > > > rate to 44100 HZ > > > > > > > 01-01 00:09:49.000: DEBUG/AudioHardwareALSA(1991): Buffer size: > > > > > > > 4096 > > > > > > > 01-01 00:09:49.000: DEBUG/AudioHardwareALSA(1991): Latency: 92879 > > > > > > > 01-01 00:09:49.080: INFO/vold(3225): Android Volume Daemon > > > > > > > version 2.0 > > > > > > > 01-01 00:09:49.465: WARN/AudioFlinger(1991): OutputTrack::write() > > > > > > > 0x23cc0 no more overflow buffers > > > > > > > 01-01 00:09:49.490: DEBUG/A2DP(1991): wait_for_start: 500575 us > > > > > > > 01-01 00:09:49.490: ERROR/A2dpAudioInterface(1991): a2dp_write > > > > > > > failed > > > > > > > err: -110 > > > > > > > 01-01 00:09:49.500: WARN/AudioFlinger(1991): write blocked for 512 > > > > > > > msecs, thread 0x23658 > > > > > > > 01-01 00:09:49.500: DEBUG/A2DP(1991): ********** a2dp_write > > > > > > > ********** > > > > > > > 01-01 00:09:49.705: WARN/AudioFlinger(1991): OutputTrack::write() > > > > > > > 0x23cc0 no more overflow buffers > > > > > > > 01-01 00:09:49.820: WARN/AudioFlinger(1991): OutputTrack::write() > > > > > > > 0x23cc0 no more overflow buffers > > > > > > > 01-01 00:09:49.930: DEBUG/A2DP(1991): Received BT_RESPONSE - > > > > > > > BT_START_STREAM > > > > > > > 01-01 00:09:49.930: DEBUG/A2DP(1991): Received BT_RESPONSE - > > > > > > > BT_NEW_STREAM > > > > > > > 01-01 00:09:49.930: DEBUG/A2DP(1991): wait_for_start: 431150 us > > > > > > > 01-01 00:09:49.930: DEBUG/A2DP(1991): poll: 20 us > > > > > > > 01-01 00:09:49.930: DEBUG/A2DP(1991): send: 189 us > > > > > > > 01-01 00:09:49.930: DEBUG/A2DP(1991): avdtp_write: 297 us > > > > > > > > I tried reducing the bitpool till 20 and tried but I did not see > > > > > > > any > > > > > > > variation in the performance. > > > > > > > As of now I am using the Baud rate of 115200 should I increase the > > > > > > > baud rate. > > > > > > > If yes please let me know how can I do that since hciconfig hci0 > > > > > > > up is > > > > > > > not working with baud rate more than 115200. > > > > > > > waiting for ur reply guys > > > > > > > Thnaks in Advance!- Hide quoted text - > > - Show quoted text - -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting