开发者

Some files won't stream from lighttpd to Droid

We are running into some odd issues with streaming certain files in our app. After lots and lots of testing we've narrowed it down to what seems like some sort of issue between lighttpd and Droid, and it's not just our app but the built in player as well.

If you point the Droid browser to http://stream29l.grooveshark.com/collinSong.mp3 it does not work. The same file hosted on Apache at http://staging.api.grooveshark.com/collinSong.mp3 streams perfectly. The files are identical. Both URLs work on other phones running 1.5 and 1.6, and on the emulator running 2.0.1.

The lighttpd URL fails whether playing over wifi or over 3G.

My guess is that there's something funky going on at the network level that Droid is not tolerant of, but I'm at the end of what I can debug. Any ideas?

UPDATE: I installed lighttpd on my laptop running CentOS and set it up to serve thos开发者_如何学Ce same files (sorry, not accessible to the outside world) and the Droid can serve them fine. It's got to be a specific configuration issue with our server, or a difference in lighttpd versions. Right now my laptop is running 1.4.22 and our production server is running 1.5.0. Our production server also has the following configs set that gave me problems setting on my laptop (note: I may be missing modules, etc):

server.max-fds = 7000
server.network-backend = "gthread-aio"
server.stat-cache-engine = "fam"

the server also has these additional modules installed:

                            "mod_proxy_core",
                            "mod_proxy_backend_http",
                            "mod_proxy_backend_fastcgi",

I'm going to try getting modules and configs to match 100% and see if that reproduces the problem tomorrow. If not, I'll try upgrading my laptop to 1.5.0 and see if that does it.

In the meantime, does anyone know of issues related to the above configs?

UPDATE 2: I upgraded to 1.5.0 on my laptop, streaming collinSong.mp3 still worked. Adding: server.network-backend = "gthread-aio" did not break streaming. However this line did: server.stat-cache-engine = "fam"

Commenting out the above line makes streaming work from my laptop, and having it enabled makes it not work. I actually got our admin to remove that line from the config and restart lighty (he said we didn't need that setting anyway), but the problem persists.

So next I tried leaving stat-cache-engine commented out on my laptop and adding these lines: "mod_proxy_core", "mod_proxy_backend_http", "mod_proxy_backend_fastcgi" Once again streaming on my laptop broke after enabling these, and works when I turn them off. Unfortunately, these are apparently needed for the threading model we are using on the server, so I can't experiment with turning them off in production. I don't know if this gives any sort of clues to anyone else, but it's all I have.

I'd love to get in touch with a developer at Motorola because it seems to be a bug with the platform; works fine on other android devices, PCs, iPhones, Blackberries, and Nokia phones, but not Droid.


I don't really have an answer for you but after some very basic inspection I can tell you that staging (Apache) is returning a 200 with the entire file and stream29l (lighttpd) is returning a 206 with a partial file. Perhaps droid doesn't support streaming?


I no longer have the Droid so I can't test this myself, but a good way to do it would be to set up a proxy and configure the Droid to use it so you can inspect the request and response from both servers. Quick testing from firefox doesn't show any big difference between the responses, so it looks like only testing from a droid would be helpful.

Fiddler is an excellent proxy that allows you to examine every aspect of the client-server transaction.


Here are the HTTP headers returned. At least they return the same content length.

http://stream29l.grooveshark.com/collinSong.mp3 returns:

HTTP/1.1·200·OK(CR)(LF)
Content-Type:·audio/mpeg(CR)(LF)
ETag:·"3368448790"(CR)(LF)
Accept-Ranges:·bytes(CR)(LF)
Last-Modified:·Tue,·22·Dec·2009·17:27:55·GMT(CR)(LF)
Content-Length:·3854464(CR)(LF)
Connection:·close(CR)(LF)
Date:·Sat,·02·Jan·2010·19:01:18·GMT(CR)(LF)
Server:·lighttpd/1.5.0(CR)(LF)
(CR)(LF)

http://staging.api.grooveshark.com/collinSong.mp3 returns

HTTP/1.1·200·OK(CR)(LF)
Date:·Sat,·02·Jan·2010·19:02:30·GMT(CR)(LF)
Server:·Apache/2.2.14·(EL)(CR)(LF)
Last-Modified:·Mon,·21·Dec·2009·22:13:36·GMT(CR)(LF)
ETag:·"ac811e-3ad080-47b446696e400"(CR)(LF)
Accept-Ranges:·bytes(CR)(LF)
Content-Length:·3854464(CR)(LF)
Connection:·close(CR)(LF)
Content-Type:·audio/mpeg(CR)(LF)
X-Pad:·avoid·browser·bug(CR)(LF)
(CR)(LF)

See Rex Swain's HTTP Viewer.


On the Motorola Milestone (European UMTS Droid) running 2.0 both streams work without problems. I will retest this page after I receive my 2.0.1 update.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜