Open GoogleCodeExporter opened 9 years ago
I forgot to mention that I'm running PMS r772 on Mac OSX 10.7 (Lion) from
within the Eclipse debug mode.
Original comment by Patrick....@gmail.com
on 30 Jul 2011 at 11:11
Added a logger to HttpServerPipelineFactory.java and found out that
getPipeline() is called twice.
To listen in on the ChannelEvents going on, the following code can be added to
RequestHandlerV2.java:
-------8<-----------------------------------------------------------------
@Override
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception {
// Log all channel events.
logger.trace("Channel upstream event: " + e);
super.handleUpstream(ctx, e);
}
-------8<-----------------------------------------------------------------
This gave me the following logging (edited):
-------8<-----------------------------------------------------------------
[New I/O server boss #1 ([id: 0x63f796d0, /192.168.0.16:5001])] TRACE
23:16:38.475 Channel upstream event: [id: 0x5d8a2977, /192.168.0.13:55013 =>
/192.168.0.16:5001] OPEN
[New I/O server boss #1 ([id: 0x63f796d0, /192.168.0.16:5001])] TRACE
23:16:38.475 Channel upstream event: [id: 0x5d8a2977, /192.168.0.13:55013 =>
/192.168.0.16:5001] BOUND: /192.168.0.16:5001
[New I/O server boss #1 ([id: 0x63f796d0, /192.168.0.16:5001])] TRACE
23:16:38.475 Channel upstream event: [id: 0x5d8a2977, /192.168.0.13:55013 =>
/192.168.0.16:5001] CONNECTED: /192.168.0.13:55013
[New I/O server worker #1-7] TRACE 23:16:38.476 Channel upstream event: [id:
0x5d8a2977, /192.168.0.13:55013 => /192.168.0.16:5001] RECEIVED:
DefaultHttpRequest(chunked: false) GET /get/0$0$6/big_buck_bunny_1080p_h264.mov
HTTP/1.1 User-Agent: Lavf52.54.0 Accept: */* Range: bytes=0- Host:
192.168.0.16:5001 Authorization: Basic Connection: close
[New I/O server worker #1-7] TRACE 23:16:38.476 Opened request handler on
socket /192.168.0.13:55013 // Playstation 3
...
[New I/O server boss #1 ([id: 0x63f796d0, /192.168.0.16:5001])] TRACE
23:16:38.481 Channel upstream event: [id: 0x4c84f665, /192.168.0.13:55014 =>
/192.168.0.16:5001] OPEN
[New I/O server boss #1 ([id: 0x63f796d0, /192.168.0.16:5001])] TRACE
23:16:38.482 Channel upstream event: [id: 0x4c84f665, /192.168.0.13:55014 =>
/192.168.0.16:5001] BOUND: /192.168.0.16:5001
[New I/O server boss #1 ([id: 0x63f796d0, /192.168.0.16:5001])] TRACE
23:16:38.482 Channel upstream event: [id: 0x4c84f665, /192.168.0.13:55014 =>
/192.168.0.16:5001] CONNECTED: /192.168.0.13:55014
[New I/O server worker #1-8] TRACE 23:16:38.484 Channel upstream event: [id:
0x4c84f665, /192.168.0.13:55014 => /192.168.0.16:5001] RECEIVED:
DefaultHttpRequest(chunked: false) GET /get/0$0$6/big_buck_bunny_1080p_h264.mov
HTTP/1.1 User-Agent: Lavf52.54.0 Accept: */* Range: bytes=0- Host:
192.168.0.16:5001 Authorization: Basic Connection: close
[New I/O server worker #1-8] TRACE 23:16:38.484 Opened request handler on
socket /192.168.0.13:55014 // Playstation 3
-------8<-----------------------------------------------------------------
Looks like the boss gets two ChannelEvents and dispatches two workers to handle
the same request.
Original comment by Patrick....@gmail.com
on 2 Aug 2011 at 9:23
for iPad and iPhone - try using the AirPlayer app.
http://www.ps3mediaserver.org/forum/viewtopic.php?f=15&t=11520
See if you get the same results.
Original comment by deflanko...@gmail.com
on 19 Aug 2011 at 6:58
Issue 1282 has been merged into this issue.
Original comment by chocol...@cpan.org
on 6 Nov 2011 at 4:27
I think I've found the problem:
"ExecutionHandler is often used when your ChannelHandler performs a blocking
operation that takes long time or accesses a resource which is not CPU-bound
business logic such as DB access. Running such operations in a pipeline without
an ExecutionHandler will result in unwanted hiccup during I/O because an I/O
thread cannot perform I/O until your handler returns the control to the I/O
thread."
Quoted from:
http://netty.io/docs/3.2.6.Final/api/org/jboss/netty/handler/execution/Execution
Handler.html
We currently do not use any ExecutionHandler, so it is very well possible that
is the reason we experience hiccups.
However, when I try the attached patch, the PS3 no longer connects. :-(
Outcomment the "pipeline.addLast("handler", executionHandler);" in
HttpServerPipelineFactory.java and it works again. Looks like the handler
blocks a bit too much.
Ideas, anyone?
Original comment by Patrick....@gmail.com
on 6 Nov 2011 at 10:19
Attachments:
Does that only affect HTTP Engine V2? It's a while since I last looked at this,
but I think I had this problem with HTTP Engine V1 (I don't use V2 apart from
the occasional test).
Original comment by chocol...@cpan.org
on 6 Nov 2011 at 10:29
I should have added that all of the logging above has been based on testing
with HTTP Engine V2 only.
That's not to say something similar couldn't be happening with HTTP Engine V1.
I just haven't looked into that.
Original comment by Patrick....@gmail.com
on 7 Nov 2011 at 7:12
Change the patched code to "pipeline.addLast("executor", executionHandler);"
and the PS3 will connect.
However, the TRACE logfile still shows the same behavior:
-------8<-----------------------------------------------------------------
[New I/O server boss #1 ([id: 0x57398cac, /192.168.0.16:5001])] TRACE
19:29:06.812 Creating new pipeline
[pool-3-thread-18] TRACE 19:29:06.813 Opened request handler on socket
/192.168.0.13:52925 // Playstation 3
[pool-3-thread-18] TRACE 19:29:06.813 Request: HTTP/1.1 : GET :
get/0$1$8/big_buck_bunny_1080p_h264.mov
[pool-3-thread-18] TRACE 19:29:06.813 Received on socket: Accept-Encoding:
identity
[pool-3-thread-18] TRACE 19:29:06.813 Received on socket: Connection: Keep-Alive
[pool-3-thread-18] TRACE 19:29:06.813 Received on socket: Host:
192.168.0.16:5001
[pool-3-thread-18] TRACE 19:29:06.813 Received on socket:
TimeSeekRange.dlna.org: npt=0.000-
[pool-3-thread-18] TRACE 19:29:06.813 Received on socket:
transferMode.dlna.org: Streaming
[pool-3-thread-18] TRACE 19:29:06.813 Received on socket: User-Agent:
PLAYSTATION 3
[pool-3-thread-18] TRACE 19:29:06.814 Recognized media renderer Playstation 3
[pool-3-thread-18] TRACE 19:29:06.814 HTTP:
get/0$1$8/big_buck_bunny_1080p_h264.mov / 0-0
[pool-3-thread-18] TRACE 19:29:06.814 Asked stream chunk : TimeRange
[start=0.0, end=null] of big_buck_bunny_1080p_h264.mov and player MEncoder
[pool-3-thread-18] INFO 19:29:06.814 Starting transcode/remux of
big_buck_bunny_1080p_h264.mov
...
[pool-3-thread-18] TRACE 19:29:12.937 Sent to socket: Accept-Ranges: bytes
[pool-3-thread-18] TRACE 19:29:12.937 Sent to socket: Connection: keep-alive
[pool-3-thread-18] TRACE 19:29:12.937 Sent to socket: Server:
Mac_OS_X-x86_64-10.7.2, UPnP/1.0, PMS/1.50.0
[pool-3-thread-18] TRACE 19:29:12.937 Sent to socket: TimeSeekRange.dlna.org:
npt=00:00:00.00-00:09:56.00/00:09:56.00
[pool-3-thread-18] TRACE 19:29:12.937 Sent to socket: TransferMode.DLNA.ORG:
Streaming
[pool-3-thread-18] TRACE 19:29:12.937 Sent to socket: X-Seek-Range:
npt=00:00:00.00-00:09:56.00/00:09:56.00
[Thread-91] TRACE 19:29:13.451 Successfully grown buffer from 50,000,000 bytes
to 419,430,400 bytes.
[New I/O server worker #1-15] TRACE 19:29:14.863 Ready to Stop: true
[New I/O server boss #1 ([id: 0x57398cac, /192.168.0.16:5001])] TRACE
19:29:14.864 Creating new pipeline
[pool-3-thread-8] TRACE 19:29:14.865 Opened request handler on socket
/192.168.0.13:52924 // Playstation 3
[pool-3-thread-8] TRACE 19:29:14.865 Request: HTTP/1.1 : GET :
get/0$1$8/big_buck_bunny_1080p_h264.mov
[pool-3-thread-8] TRACE 19:29:14.865 Received on socket: Accept-Encoding:
identity
[pool-3-thread-8] TRACE 19:29:14.865 Received on socket: Connection: Keep-Alive
[pool-3-thread-8] TRACE 19:29:14.865 Received on socket: Host: 192.168.0.16:5001
[pool-3-thread-8] TRACE 19:29:14.865 Received on socket:
TimeSeekRange.dlna.org: npt=0.000-
[pool-3-thread-8] TRACE 19:29:14.865 Received on socket: transferMode.dlna.org:
Streaming
[pool-3-thread-8] TRACE 19:29:14.865 Received on socket: User-Agent:
PLAYSTATION 3
[pool-3-thread-8] TRACE 19:29:14.865 Recognized media renderer Playstation 3
[pool-3-thread-8] TRACE 19:29:14.865 HTTP:
get/0$1$8/big_buck_bunny_1080p_h264.mov / 0-0
[pool-3-thread-8] TRACE 19:29:14.866 Asked stream chunk : TimeRange [start=0.0,
end=null] of big_buck_bunny_1080p_h264.mov and player MEncoder
[pool-3-thread-8] TRACE 19:29:14.867 Ready to Stop: false
[pool-3-thread-8] TRACE 19:29:14.870 Sent to socket: Accept-Ranges: bytes
[pool-3-thread-8] TRACE 19:29:14.870 Sent to socket: Connection: keep-alive
[pool-3-thread-8] TRACE 19:29:14.870 Sent to socket: Server:
Mac_OS_X-x86_64-10.7.2, UPnP/1.0, PMS/1.50.0
[pool-3-thread-8] TRACE 19:29:14.870 Sent to socket: TimeSeekRange.dlna.org:
npt=00:00:00.00-00:09:56.00/00:09:56.00
[pool-3-thread-8] TRACE 19:29:14.870 Sent to socket: TransferMode.DLNA.ORG:
Streaming
[pool-3-thread-8] TRACE 19:29:14.870 Sent to socket: X-Seek-Range:
npt=00:00:00.00-00:09:56.00/00:09:56.00
-------8<-----------------------------------------------------------------
A new pipeline is created and thread-18 starts to process the request. About 8
seconds later another new pipeline is created and thread-8 starts to process
the exact same request. Well, technically the socket is different:
192.168.0.13:52925 versus 192.168.0.13:52924.
I don't know how to stop the same host from creating a fresh pipeline and use
the existing one instead. (Obviously a different host should be able to have
its own pipeline and not be blocked by the first one.)
Original comment by Patrick....@gmail.com
on 7 Nov 2011 at 7:03
The link in comment 5 doesn't work any more. This one works:
http://docs.jboss.org/netty/3.2/api/org/jboss/netty/handler/execution/ExecutionH
andler.html
Original comment by Patrick....@gmail.com
on 16 Nov 2011 at 10:42
I think I may have fixed this for HTTP V2, fix committed in
https://github.com/Raptor399/ps3mediaserver/commit/ae0273230c8e1cc7d9f87c1420ed8
705b64f4017
Original comment by Patrick....@gmail.com
on 10 Dec 2011 at 9:44
Issue 1318 has been merged into this issue.
Original comment by Patrick....@gmail.com
on 10 Dec 2011 at 10:12
sorry for replying to this but can someone link me on how to add those .java
files into which ever file i need to? i downloaded the files but have no idea
where i'm supposed to place them or what file i may put it into...
Original comment by flbes...@gmail.com
on 18 Dec 2011 at 4:32
Original issue reported on code.google.com by
Patrick....@gmail.com
on 30 Jul 2011 at 11:07