私の単純なオーディオ ストリーミング アプリは 1.6 では完全に動作し、2.1 は 2.2 では動作しません。理由はわかりません。エミュレーターでは問題なく動作しますが、実際の 2.2 デバイスでは、オーディオは約 10 分後に予期せず停止します。携帯電話 (HTC EVO) で logcat を見ると、次のように表示されます。
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
そして突然:
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.
コードは基本的に、Google 自身のドキュメント「Playing from a file or stream」( http://developer.android.com/guide/topics/media/index.html ) から直接作成されています。
ここでも、1.6 と 2.1、および 2.2エミュレーターでは完全に動作しますが、2.2デバイスでは上記のように失敗します。
これは私を夢中にさせています、何かアイデアはありますか?ありがとう。
編集:これは、実行時の私の電話のlogcatの別の例であり、突然の受信がすべて失敗し、サーバーが「なくなった」:
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
繰り返しますが、1.6 と 2.1 および 2.2エミュレーターでは正常に動作しますが、2.2デバイス、特に私の HTC EVO 4G では失敗します。これは、信号が良好な Wi-Fi を使用していることに注意してください。