La transmisión de audio básica funciona en 2.1 pero no en 2.2
Mi aplicación de transmisión de audio simple funciona perfectamente en 1.6 y 2.1 no funciona en 2.2. No tengo idea de por qué. Funciona bien en el emulador, en dispositivos 2.2 reales el audio se detiene inesperadamente después de unos 10 minutos más o menos. Cuando miré a logcat en mi teléfono (HTC EVO) veo esto:
I/HTTPStream( 65): 1358 Bytes read, progress 34346/65536
I/HTTPStream( 65): 1358 Bytes read, progress 35704/65536
I/HTTPStream( 65): 1359 Bytes read, progress 37063/65536
I/HTTPStream( 65): 1358 Bytes read, progress 38421/65536
I/HTTPStream( 65): 1358 Bytes read, progress 39779/65536
I/HTTPStream( 65): 1359 Bytes read, progress 41138/65536
I/HTTPStream( 65): 2716 Bytes read, progress 43854/65536
I/HTTPStream( 65): 1359 Bytes read, progress 45213/65536
I/HTTPStream( 65): 1358 Bytes read, progress 46571/65536
y luego, de repente:
E/HTTPStream( 65): recv failed, errno = 11 (Try again)
I/HTTPDataSource( 65): Retry ... 0 times left
W/HTTPStream( 65): Calling connect()...
I/AudioHardwareQSD( 65): AudioHardware pcm playback is going to standby.
D/StreamProcess( 65): OutputStreamProcess::ResetAOLC()
W/HTTPStream( 65): Returned from connect()...
E/HTTPDataSource( 65): retrying connection failed
V/MediaPlayerService( 65): [2] notify (0x355d0, 4, 0, 0)
I/MediaPlayer( 1719): MediaPlayer handleMessage what=4
I/Prefetcher( 65): [0x3db60] cache below low water mark, filling cache.
W/HTTPStream( 65): Calling connect()...
W/HTTPStream( 65): Returned from connect()...
V/MediaPlayerService( 65): [2] notify (0x355d0, 4, 0, 0)
I/MediaPlayer( 1719): MediaPlayer handleMessage what=4
I/Prefetcher( 65): [0x3db60] cache below low water mark, filling cache.
E/HTTPStream( 65): recv failed, errno = 9 (Bad file number)
V/MediaPlayerService( 65): [2] notify (0x355d0, 4, 0, 0)
I/MediaPlayer( 1719): MediaPlayer handleMessage what=4
I/Prefetcher( 65): [0x3db60] cache below low water mark, filling cache.
E/HTTPStream( 65): recv failed, errno = 9 (Bad file number)
V/MediaPlayerService( 65): [2] notify (0x355d0, 4, 0, 0)
I/MediaPlayer( 1719): MediaPlayer handleMessage what=4
I/Prefetcher( 65): [0x3db60] cache below low water mark, filling cache.
El código es básicamente directamente de los propios documentos de Google "Reproducción desde un archivo o transmisión" aquí:http://developer.android.com/guide/topics/media/index.html.
Nuevamente funciona perfectamente en 1.6 y 2.1 y el 2.2emulador, pero falla como arriba en 2.2dispositivos.
Esto me está volviendo loco, ¿alguna idea? Gracias.
EDITAR: Aquí hay otro ejemplo del logcat en mi teléfono cuando se ejecuta, de repente la recepción falla y el servidor se "ha ido":
I/HTTPStream( 65): 29329 Bytes read, progress 29329/65536
I/HTTPStream( 65): 1448 Bytes read, progress 30777/65536
I/HTTPStream( 65): 1448 Bytes read, progress 32225/65536
I/HTTPStream( 65): 2896 Bytes read, progress 35121/65536
I/HTTPStream( 65): 1448 Bytes read, progress 36569/65536
I/HTTPStream( 65): 2896 Bytes read, progress 39465/65536
I/HTTPStream( 65): 5792 Bytes read, progress 45257/65536
I/HTTPStream( 65): 1448 Bytes read, progress 46705/65536
I/HTTPStream( 65): 4344 Bytes read, progress 51049/65536
I/HTTPStream( 65): 7240 Bytes read, progress 58289/65536
I/HTTPStream( 65): 5792 Bytes read, progress 64081/65536
I/HTTPStream( 65): 1448 Bytes read, progress 65529/65536
I/HTTPStream( 65): 7 Bytes read, progress 65536/65536
I/HTTPStream( 65): 21713 Bytes read, progress 21713/65536
I/HTTPStream( 65): 1448 Bytes read, progress 23161/65536
I/HTTPStream( 65): 5792 Bytes read, progress 28953/65536
I/HTTPStream( 65): 4344 Bytes read, progress 33297/65536
I/HTTPStream( 65): 1448 Bytes read, progress 34745/65536
I/HTTPStream( 65): 5792 Bytes read, progress 40537/65536
I/HTTPStream( 65): 1448 Bytes read, progress 41985/65536
I/HTTPStream( 65): 5792 Bytes read, progress 47777/65536
I/HTTPStream( 65): 5792 Bytes read, progress 53569/65536
I/HTTPStream( 65): 1448 Bytes read, progress 55017/65536
I/HTTPStream( 65): 2896 Bytes read, progress 57913/65536
I/HTTPStream( 65): 4344 Bytes read, progress 62257/65536
I/HTTPStream( 65): 1448 Bytes read, progress 63705/65536
I/HTTPStream( 65): 1831 Bytes read, progress 65536/65536
I/HTTPStream( 65): 31473 Bytes read, progress 31473/65536
I/HTTPStream( 65): 1448 Bytes read, progress 32921/65536
I/HTTPStream( 65): 23168 Bytes read, progress 56089/65536
I/HTTPStream( 65): 1448 Bytes read, progress 57537/65536
I/HTTPStream( 65): 4344 Bytes read, progress 61881/65536
I/HTTPStream( 65): 2896 Bytes read, progress 64777/65536
I/HTTPStream( 65): 759 Bytes read, progress 65536/65536
I/HTTPStream( 65): 36889 Bytes read, progress 36889/65536
I/HTTPStream( 65): 1448 Bytes read, progress 38337/65536
I/HTTPStream( 65): 4344 Bytes read, progress 42681/65536
I/HTTPStream( 65): 10136 Bytes read, progress 52817/65536
I/HTTPStream( 65): 12719 Bytes read, progress 65536/65536
I/HTTPStream( 65): 3209 Bytes read, progress 3209/65536
E/HTTPStream( 65): recv failed, server is gone, total received: 3209 bytes
De nuevo, funciona bien en 1.6 y 2.1 y el 2.2emulador, simplemente falla en un 2.2dispositivo, específicamente mi HTC EVO 4G. Tenga en cuenta que esto está usando Wi-Fi con una excelente señal.