Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 574
Jay Paroline Avatar asked Nov 06 '22 18:11

Jay Paroline


2 Answers

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?

like image 68
Jim Mitchener Avatar answered Nov 12 '22 19:11

Jim Mitchener


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.

like image 36
jsoverson Avatar answered Nov 12 '22 18:11

jsoverson