views:

380

answers:

4

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 those 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.

+1  A: 

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?

jcm
You might be on to something, but I can't reproduce this. If I use firebug and embed using this code <EMBED src="http://staging.api.grooveshark.com/collinSong.mp3" autostart=false hidden=false> I can watch FF grab the file but both get normal 200s...
Jay Paroline
+1  A: 

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.

jsoverson
Alas, I can't seem to find any way to make it run through a proxy, either. The only info I've found online (admittedly my google-fu is weak) is for running the emulator through a proxy, but the problem doesn't exist on the emulator so I don't think that will help much...
Jay Paroline
How many droids have you tried? Have you tried clearing the cache? What if you use a different browser (dolphin, e.g.), or install an app that lets you download the file to an sdcard to determine further where the problem might lie.
jsoverson
We have 3 Droids in the office, all exhibit the same behavior, and users have complained as well. I'm testing using the built in player because our app has the same problem, but using the built in player proves that it's not a problem with our app, but some incompatibility between our lighttpd server and the droid.Plays perfectly fine from the SD card as well as from Apache.
Jay Paroline
A: 

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.

Gregory Pakosz
Thanks for posting this. I got similar results via firebug. Nothing significantly different as far as I can tell...I have a feeling it must be something with how lighttpd actually sends the result that is hitting a bug in the Droid; chunk size? I have no idea, and don't really know how to find out...
Jay Paroline
i don't have an android phone at hands unfortunately
Gregory Pakosz
A: 

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.

Robin
Interesting! We definitely experienced the problems before the 2.0.1 update, so 2.0.1 probably won't break it for you either. Milestone firmware is a bit different from Droid fw (multitouch support, maybe other things?) so perhaps I should try putting the milestone firmware on my droid to see if that fixes it. Obviously we can't tell our customers to do that but it will help narrow down the problem.
Jay Paroline