某些文件不会从 lighttpd 流式传输到 Droid
我们在应用程序中流式传输某些文件时遇到了一些奇怪的问题。经过大量测试后,我们将问题范围缩小到了 lighttpd 和 Droid 之间的某种问题,这不仅是我们的应用程序的问题,也是内置播放器的问题。
如果您将 Droid 浏览器指向 http://stream29l.grooveshark.com/collinSong.mp3它不起作用。托管在 Apache 上的相同文件 http://staging.api.grooveshark.com/collinSong.mp3 完美传输。这些文件是相同的。这两个 URL 适用于运行 1.5 和 1.6 的其他手机以及运行 2.0.1 的模拟器。
无论是通过 wifi 还是通过 3G 播放,lighttpd URL 都会失败。
我的猜测是,在网络级别发生了一些 Droid 无法容忍的奇怪的事情,但我已经无法调试了。有什么想法吗?
更新:我在运行 CentOS 的笔记本电脑上安装了 lighttpd,并将其设置为提供相同的文件(抱歉,外界无法访问),并且 Droid 可以很好地提供这些文件。这肯定是我们服务器的特定配置问题,或者 lighttpd 版本的差异。现在我的笔记本电脑运行的是 1.4.22,我们的生产服务器运行的是 1.5.0。我们的生产服务器还设置了以下配置,这给我在笔记本电脑上的设置带来了问题(注意:我可能缺少模块等):
server.max-fds = 7000
server.network-backend = "gthread-aio"
server.stat-cache-engine = "fam"
服务器还安装了这些附加模块:
"mod_proxy_core",
"mod_proxy_backend_http",
"mod_proxy_backend_fastcgi",
我将尝试获取模块和配置以匹配100%,看看明天是否会重现该问题。如果没有,我会尝试将我的笔记本电脑升级到 1.5.0,看看是否可以。
与此同时,有人知道与上述配置相关的问题吗?
更新2: 我在笔记本电脑上升级到 1.5.0,流式传输 collinSong.mp3 仍然有效。 添加: server.network-backend =“gthread-aio” 没有中断流媒体。 然而这一行做了: server.stat-cache-engine = "fam"
注释掉上面的行可以使流式传输在我的笔记本电脑上工作,并且启用它会使其无法工作。我实际上让我们的管理员从配置中删除了该行并重新启动 lighty (他说我们无论如何都不需要该设置),但问题仍然存在。
接下来,我尝试在笔记本电脑上注释掉 stat-cache-engine 并添加以下行: “mod_proxy_core”, “mod_proxy_backend_http”, “mod_proxy_backend_fastcgi” 启用这些功能后,我的笔记本电脑上的流媒体再次中断,当我关闭它们时,流媒体可以正常工作。不幸的是,这些显然是我们在服务器上使用的线程模型所必需的,因此我无法尝试在生产中关闭它们。我不知道这是否能为其他人提供任何线索,但这就是我所拥有的一切。
我很想与摩托罗拉的开发人员联系,因为这似乎是该平台的一个错误;在其他 Android 设备、PC、iPhone、黑莓和诺基亚手机上运行良好,但在 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我真的没有答案给你,但经过一些非常基本的检查后,我可以告诉你,staging (Apache) 返回的是整个文件的 200,stream29l (lighttpd) 返回的是部分文件的 206。也许 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?
我不再拥有 Droid,因此无法自己进行测试,但一个好的方法是设置代理并配置 Droid 以使用它,以便您可以检查来自两台服务器的请求和响应。从 Firefox 进行的快速测试并没有显示出响应之间有任何大的差异,因此看起来只有从 droid 进行测试才会有帮助。
Fiddler 是一个优秀的代理,它允许您检查客户端-服务器事务的各个方面。
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.
以下是返回的 HTTP 标头。至少它们返回相同的内容长度。
http://stream29l.grooveshark.com/collinSong.mp3 返回:
http://staging.api.grooveshark.com/collinSong.mp3 返回
请参阅 Rex Swain 的 HTTP 查看器。
Here are the HTTP headers returned. At least they return the same content length.
http://stream29l.grooveshark.com/collinSong.mp3 returns:
http://staging.api.grooveshark.com/collinSong.mp3 returns
See Rex Swain's HTTP Viewer.
在运行 2.0 的 Motorola Milestone(欧洲 UMTS Droid)上,两个流都可以正常工作。
收到 2.0.1 更新后,我将重新测试此页面。
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.