Difference between revisions of "Fun with PCast"
|Line 147:||Line 147:|
Revision as of 00:23, 14 August 2006
Based on work by -, Robert Fenerty, frontalot, and nix.
Originally by nix at Linkstationwiki.org
Fun with PCast
This article tries to shed some light on the detailed workings of PCast. The information has been obtained using a mipsel-hdhlan LinkStation. It should apply equally to all LinkStations.
LinkStation users have surely noticed the PCast entry in the LinkStation's web configuration. PCast is apparently some server intended to work together with Buffalo's LinkTheater (a multimedia player). The question is, what does PCast exactly do, and can it be used for something other than the LinkStation?
This article is based on the rather old PCast version 1.00, as it comes with the mipsel-hdhlan 2.05 firmware. Firmware 2.22 contains an updated version of PCast. Depending on which source one believes, the PCast version in 2.22 is either 1.10-final, or 1.10-beta. Version 1.10 is supposed to provide more feature, the details need further investigation.
New Version | There appears to be a newer version of PCast, 2.00, included with the 1.51 Japanese firmware. I have not investigated any new features.
What is PCast?
PCast is a media server. Contrary to popular (for some value of popular in the small world of LinkStation hackers) belief, PCast is not a UPnP Media Server. PCast uses UPnP at some point, but is in no way compliant to the UPnP Media Server specification.
Instead, PCast is based on the Syabas myi technology. Syabas is a relatively unknown company which produces OEM products that are the core of many network media centers. One of Syabas' OEM product is the myiBox. This is a hardware device which converts streaming data from a network into TV signals. Buffalo sells some TV devices in Japan which look remarkably like a Buffalo-branded myiBox.
The myiBox or any other device using Syabas technology, e.g. Buffalo's LinkTheater, needs a server which delivers the media (e.g. an MP3 stream). PCast is such a server. The myiBox also needs a server which provides the user interface (which it then just displays on the TV). PCast does this, too: The box can be controlled via a remote control and displays a navigation menu on the TV. The navigation menu can be used to browse the data available on the network. This menu comes directly from the PCast server and is not built into the box. myiBox-based products are rather popular in Japan. There is an active development community which provides customized user interface skins or custom implementations of the needed server.
Syabas' own server software is called myiHome. It can be installed on many different computers, including Windows desktop machines, since it is written in Java. Buffalo's PCast server is, however, a native binary for LinkStations/TeraStations and isn't in any way based on Java. PCast just provides the bare basics necessary to convert a device into a server for the myiBox technology.
How PCast 1.00 works
PCast listens on 2 ports in standard configuration:
PCast uses port 1900 for UPnP, the standard UPnP port. It uses UPnP's SSDP  for peering with a LinkTheater. Via SSDP the two devices can learn about each other. Actually, the LinkTheater is supposed to learn about existing media servers via UPnP. From the current investigation it is believed that PCast is not a fully compliant UPnP node. It does just enough UPnP in order to be found by a LinkTheater.
PCast runs a mini web server on port 8000. That server is responsible for delivering the myiBox navigation menu to select some media; it also is responsible for streaming the media. The server runs HTTP so a normal web browser can connect to it. However, the HTML (web pages) delivered by the server contain myiBox specific extensions (attributes in tags, meta data), which are not known to a normal web browser. Also, the provided HTML is designed for a fixed resolution of 670x560 - well suited to be converted for display on a 4:3 TV, but rather badly laid out in a normal web browser. PCast also comes with a second set of HTML files apparently designed for display on a 16:9 TV set. It is not known how PCast is supposed to switch to the 16:9 HTML - which looks as bad in a normal web browser as the 4:3 user interface.
The media which PCast can serve via port 8000 are audio, video, and image files of different types. It doesn't do so unless the URLs to access the media are specifically constructed. The server does not start to stream media once some media is selected via the web page. Instead, the server responds with descriptive text data. This data includes the URL under which the server streams the media. Unfortunately, normal browsers can't make any sense of the text description data. They just display it as text.
How to use PCast 1.00
The simple answer is that it probably doesn't make much sense to use PCast for media streaming unless someone owns a LinkTheater, some myiBox-based product, or some myiBox clone.
The longer answer is that the best way would be to use a special browser for accessing the server. Such a browser would have to make sense out of the specific HTML and the textual media descriptions coming from the server. The present author is not aware of such a particular browser.
If the correct URLs are typed in manually into a player like WinAMP, the data is streamed correctly and WinAMP plays. This is a rather inconvenient way to use the server.
PCasts UPnP support needs further investigation. Apparently PCast is not configurable or able to be queried via UPnP.
PCast 1.00 Configuration
PCast is configured via the file /etc/pcast/pcast.conf. The configuration parameters are not documented. Some investigation reveals that PCast 1.00 seems to understand the following configuration parameters:
media : root directory of media files
limit_media : root directory of access-limited (secret) media
limit_pass : password for access to limited media
flag_daemon : true or false: Run as daemon
flag_debug_log_output : true or false: Write debug log file
debug_log_filename : Name of debug log file (default /tmp/pcastd_debug.log)
server_name : Name
server_port : Port
client_language_code : sjis?
server_language_code : ?
auto : ?
skin_root : Root of the data for the HTML user interface
sort_rule : none?
flag_decode_samba_hex_and_cap : ?
flag_unknown_extention_file_hide : Only show files with known file name extensions
flag_filename_cut_parenthesis_area : ?
flag_filename_cut_same_directory_name : Don't show directory names
flag_allplay_filelist_adjust : ?
access_allow : ?
allow_user_agent : Limit access to HTML user agents (browsers) of a particular kind
secret_directory : ?
PCast URL format
PCast expects commands and parameters embedded in HTTP GET request URLs. For example:
would respond with single-play information for the file "some directory/latest hit.mp3". As already mentioned, it would not stream the file. It would deliver information which includes the URL under which PCast would stream the file.
These PCast commands are not documented. The known commands are:
page= : Which page of a directory listing (ten entries per page) should be displayed
action= : singleplay Return text description for playing file one time
- allplay Return text description for playing all files in a directory
- randomplay Return text description for playing random files from directory
- singlephoto Return text description for showing a single photo
- allphoto Return text description for showing all photos in a directory
- randomphoto Return text description for showing random photos from a directory
option= : ?
filter= : 1 Show list of video files
- 2 Show list of music files
- 3 Show list of photo files
file= : File or directory name
cmdOK= : ?
txtPasswd= : Password for access to limited area
One of the biggest changes between PCast 1.0 and 1.10 seems to be the support for the Buffalo [PC-MV7DX/U2 ]. The PC-MV7DX/U2 is a hardware analog-to-digital video converter from Buffalo Japan. It is supposed to feed digital video to a LinkStation via USB.
There seems to be some 'TV' software available which can be used to manage streams from the LinkStation. It may be worth investigating this software to see if it supports normal streaming from the LinkStation.
Up to 2 PC-MV7DX/U2 units can be connected to a LinkStation, and up to 4 PC-MV7DX/U2 units to a TeraStation.
PCast > 1.10
There are reports that later PCasts do use the LinkStation's thttpd web server for serving the media data instead of relying on PCasts internal web server for this purpose.
- Install TwonkyVision UPnP Media Server [from here] (commercial software, but a cheap classic)
- Install SlimServer [Slimserver]
- Use the LinkStation for what it was originally intended - a file server. Just navigate to a share with your favorite media player software like WinAMP and open a media file in the player.
- You could try to install [Icecast], a shoutcast-compatible streaming server.
- [WizD] - a Media Server Daemon for Linux (documentation in Japanese only)
- :Universal Plug 'n' Play
- Simple Service Discovery Protocol