User(s) browsing this thread:
|
controlling popcorn from windows
|
|
11-30-2008, 11:51 AM
(This post was last modified: 12-03-2008 01:00 AM by Frater.)
|
|||
|
|||
|
controlling popcorn from windows
Yay, I finally made my popcorn do what I want: play movies when i point at them on my windows box.
![]() Thanks to all of you who have helped out with pointers, you make my day. ![]() My setup: Hardware PCH A-100 with laptop drive and a silent fan mod. Server 2003 box hosting all my files and also doing work as media center for playing low def stuff with VLC & MPC. Projector (panasonic PT-AE3000) Receiever (Marantz SR7500) ATI Remote Wonder wireless remote control Software Working telnet on the popcorn. (http://www.sendspace.com/file/oj3yb5 works fine if you have an internal harddrive) EventGhost free event triggered automation software. Lundmands excellent llink Netcat batch files... The proj is connected to both media server and popcorn, switching source is done via remote commands over the handy serial port, same goes for the reciever. All control events goes through EventGhost. Llink is using my video library as source (big fat DFS directory structure with loads of subcategories sitting on various disk sets) Using plain old windows explorer I right klick on any given movie and select play with either VLC, MPC or Popcorn. Play with popcorn launches a batch file witch rudely telnets the popcorn, kills gaya and starts mono with the llink web server and media path as target. At the end of the batch file Eventghost is signalled to switch A/V sources in my home theater whereupon HD cinema ensues. Pressing stop on the wireless remote terminates mono and switches me back to the server desktop where I can pick a new movie, surf the web (or in this case post happy messages on this forum ).Below you can see the two bat files who do the dirty deeds to the pch: (Hehe... No I'm not running for the gold medal in sleek batch programming.) pchplay.bat Code: echo offpchstop.bat Code: echo offI use NetCat as telnet client since the crappy one coming with windows does not support scripting, be aware that netcat is a monstrous security hole if left accessible for remote excution. Before running the batchfile we need to create a symlink connecting nohup to busybox26. This will enable us to run mono as a background process, otherwise it would die as soon as the telnet session exits... (Telnet the popcorn) cd /opt/sybhttpd/localhost.drives/HARD_DISK/bin/ ln -s busybox26 nohup ls -l (should show nohup as a link now) Thats it, no more trudging around in gaya. Replace paths and IP numbers as needed if you want to give it a spin, I put the batch files in the llink folder for nothing but lazy reasons. Edit: Oh and the ~15 number in line 3 needs to be changed to whatever is the character count in your llink ROOT path +2
|
|||
|
12-02-2008, 04:46 PM
(This post was last modified: 12-02-2008 05:26 PM by wsoderberg.)
|
|||
|
|||
|
RE: controlling popcorn from windows
Nice little guide. I've done everything except installing netcat. Can't find a client to install for Windows Vista. Instead I changed the command to telnet (instead of nc). I've enabled the Vista telnet too. However nothing happens when I play the audio file. I've changed the string to -audio instead of -single like you said.
output in control.txt file: killall gaya /opt/sybhttpd/localhost.drives/HARD_DISK/bin/nohup mono -audio "http://192.168.1.65:8001/am/Music/Techno/Top 100 Trance and Techno Party Songs of All Time.2008.www.lokotorrents.com/Banana Inc. - Club Kink.www.lokotorrents.com.mp3" -dram 1 & exit Edit: Also, I totally fail to see where the pchstop.bat script jumps in. 0.o Edit2: I'm trying to launch the audio files with Rightclicking and choosing "Open with: pchplay.bat". Edit3: I downloaded nc.exe (google) and put it in system32 dir. Now NetCat works. The script still doesn't work though. |
|||
|
12-03-2008, 12:46 AM
(This post was last modified: 12-03-2008 01:05 AM by Frater.)
|
|||
|
|||
|
RE: controlling popcorn from windows
Ok, I have found two problems that need to be adressed with my guide in order to enable audio playback.
First: I'm a lazy programmer so I have put static string replacements in the batch file. ![]() Second: Apparently audio playback of single files won't work without the -bgimg tag. (we learn something new every day) To fix the first problem (string replacement): In the third line you can see the %gaga:~15% part, the number 15 is the number of characters cut from the beginning of the file path that is sent as a parameter to the batch file when using the Open With function in windows, this number needs to match whatever is your ROOT path in llink +2. Look closely at your own control.txt file and you will see [8001/am/Music] indicating that your file path has been wrongly truncated, that folder is not named "am" is it? Twiddle that ~number until you have the correct path in the control file. (to fully understand what is going on in the character replacement parts of the batch file i suggest a trip To Rob Van Der Woude's absolutely essential online docs on batch scripting, it's a goldmine) The second problem is easier: The correct mono launch parameters for single audio files are "mono -audio -bgimg -single" To accomodate both video and audio playback i suggest putting these changes into a new batch file with a different name. I included the pchstop batch file in order to show a complete solution, I run this script from eventghost triggered with a buttonpress on my remote. It can certainly be triggered in any number of ways of your choosing. Ps A nice way of checking how the popcorn launches media is to start the playback, telnet into popcorn and tell it "ps -w". This will give you a full process listing including how every process was called. Great for debugging! |
|||
|
12-03-2008, 11:38 PM
|
|||
|
|||
|
RE: controlling popcorn from windows
Thanks for the reply! I'll try it as soon as I reinstalled Windows. I failed completely yesterday and chrashed it for good. Will give you feedback asap. I'm running Linux atm.
|
|||
|
12-03-2008, 11:43 PM
|
|||
|
|||
|
RE: controlling popcorn from windows
Have you already tried the UPnP AV approach? It requires no hacking of the PCH.
|
|||
|
12-05-2008, 08:46 PM
|
|||
|
|||
RE: controlling popcorn from windows
(12-03-2008 11:43 PM)nprnncbl Wrote: Have you already tried the UPnP AV approach? It requires no hacking of the PCH. I tried Kinsky with twonky but it would not find the twonky at all, never tried all that hard since kinsky kept crashing for me and the interface was pretty klunky. The only problem I have now is that my damn PCH keeps stopping in mid movie. sound dies then it refuses to restart movies. This problem crops up even when running vanilla with the gaya interface, so either my pch is packing up or there is a power issue with the added drive and fans... |
|||
|
12-06-2008, 04:12 PM
(This post was last modified: 12-06-2008 04:13 PM by lordy.)
|
|||
|
|||
|
RE: controlling popcorn from windows
Hi, just in case you're interested you may be able to replace
$ /opt/sybhttpd/localhost.drives/HARD_DISK/bin/nohup "some command" with $ ( cd / ; "some command" < /dev/null > /dev/null 2>&1 & ) Removing dependency on external program. Oversight: Jukebox | FeedTime: Automatic nzbs |
|||
|
12-09-2008, 10:41 PM
(This post was last modified: 12-09-2008 10:42 PM by wsoderberg.)
|
|||
|
|||
RE: controlling popcorn from windows
(12-06-2008 04:12 PM)ydrol Wrote: Hi, just in case you're interested you may be able to replace Phew. This is starting to get troublesome even for me. Can't you just develop a well running software for this? Start an open source project with java or something maybe. Multiplatform. I can imagine normal users having a pain of diving in among this bunch of usermade scripts just to be able to remote control their PCH. ![]() I've reformated now so I'll try to get this running. I'll get back to you with more questions, I'm sure. (12-05-2008 08:46 PM)Frater Wrote: I tried Kinsky with twonky but it would not find the twonky at all, never tried all that hard since kinsky kept crashing for me and the interface was pretty klunky. And Frater. Kinsky, twonky and klunky. Are you making these words up as you write or is the actual applications named like this?
|
|||
|
12-10-2008, 12:54 AM
(This post was last modified: 12-10-2008 01:00 AM by Frater.)
|
|||
|
|||
RE: controlling popcorn from windows
(12-09-2008 10:41 PM)wsoderberg Wrote: Phew. This is starting to get troublesome even for me. Can't you just develop a well running software for this? Start an open source project with java or something maybe. Multiplatform. I can imagine normal users having a pain of diving in among this bunch of usermade scripts just to be able to remote control their PCH. Well, if syabas supplied us with a device we could talk with out of the box we wouldnt have this problem to begin with. Still, it is fairly straightforward to get the telnet stuff up and running with the nice installer that the russian guy made (thanks). What happened with your box, did my instruction mess it up so badly that you had to reinstall?! ![]() (12-09-2008 10:41 PM)wsoderberg Wrote: And Frater. Kinsky, twonky and klunky. Are you making these words up as you write or is the actual applications named like this? Heh, I do make up words now and then, but in this case they are real McCoys. ![]() Meet Kinsky, Twonky and klunky[sic] |
|||
|
12-10-2008, 01:07 PM
|
|||
|
|||
RE: controlling popcorn from windows
(12-05-2008 08:46 PM)Frater Wrote: I tried Kinsky with twonky but it would not find the twonky at all, never tried all that hard since kinsky kept crashing for me and the interface was pretty klunky. I tried Kinsky, too, but also found it clunky, and didn't quite get it working-- Cidero works better for me. I haven't tried Twonky, but between ushare, gmediaserver, fuppes, and mediatomb, ushare is the one I managed to get working, with some modifications to support flac. But it seems that ultimately UPnP isn't all that it could be on the PCH. |
|||
|
12-10-2008, 08:55 PM
(This post was last modified: 12-10-2008 10:42 PM by wsoderberg.)
|
|||
|
|||
|
RE: controlling popcorn from windows
Naaah. It wasen't your fault I had to reformat. It wasen't even my PCH that needed reformating. I was playing around with newSID on my Vista installation and I completely messed up my one and only admin account.
Anywho, I actually managed to start playback from my computer to the PCH with your help! ![]() Thing is, it failed the second time. The second time was from a subdirectory. Do you want me to run ps -w and give you the output? Also, the PCH stops responding to any commands issued by the remote control when the chosen file doesn't launch. Not good that I have to pull the power cord everytime it fails. pchstop.bat doesn't work to set it right. Edit: Yeah, it works like a charm when I'm launching the file from the root llink category! However if we start venturing into subfolders the script fails and I have to pull the pwr cord in order to start using the PCH again. This is how my file looks like: echo off set gaga=%1 set gaga=/opt/sybhttpd/localhost.drives/HARD_DISK/bin/nohup mono -audio -bgimg -single "http://192.168.1.65:8001/%gaga:~23% -dram 1 echo killall gaya > C:\llink\control.txt echo %gaga:\=/% ^& >> C:\llink\control.txt echo exit >> C:\llink\control.txt C:\llink\nc 192.168.1.69 23 < C:\llink\control.txt >nul "C:\Program Files\EventGhost\eventghost" -e pchplay Edit 2: Ok. Now I've used the script for some 30min and the problems I'm having is that at some point the playback fails and the PCH locks up. Forcing me to pull the power cord in order to get it working again. I would also think that a script that successfully plays a playlist (a playlist with the files on your computer) would be awesome. I hope we can further develop this to get it running smoothly. =) Thank you for the help so far Frater! Edit 3: When the script finally fails; I started a ftp transfer between the computer and the PCH. The transfer was much slower than usual. I was experiencing 2mb/s. It's usually atleast 6.5mb/s over ftp. I've tried using the script and ftp at the same time and it's working as usual then. The speed only drops significantly when the script fails. |
|||
|
12-11-2008, 12:31 AM
|
|||
|
|||
RE: controlling popcorn from windows
(12-10-2008 08:55 PM)wsoderberg Wrote: Naaah. It wasen't your fault I had to reformat. It wasen't even my PCH that needed reformating. I was playing around with newSID on my Vista installation and I completely messed up my one and only admin account.Epic fail. ![]() (12-10-2008 08:55 PM)wsoderberg Wrote: Thing is, it failed the second time. The second time was from a subdirectory. Yes please do. both a copy of the control.txt and the relevant (last)part of ps -w. check for differences in the mono line between the two outputs. Be aware that paths or file names with extended characters like "&" will break the script. One thing to note is that the output on ps -w only shows the first 106 characters of the calling string if it is too long. The player still runs fine, just that the process manager runs out of space in the name field or whatnot. Any linux junkie feels up to explaining that? (12-10-2008 08:55 PM)wsoderberg Wrote: Also, the PCH stops responding to any commands issued by the remote control when the chosen file doesn't launch. Not good that I have to pull the power cord everytime it fails. pchstop.bat doesn't work to set it right. Well gaya is allready killed and mono probably never started properly, so noone is listening to the remote. Telnetting the following message to the PCH should start gaya again, thanks Ydrol ![]() ( cd / ; gaya < /dev/null > /dev/null 2>&1 & ) Your batch file looks fine from what I can see... The last line with eventghost is not needed, unless you run eventghost for controlling audio source on your receiver ![]() (12-10-2008 08:55 PM)wsoderberg Wrote: Edit 2: Ok. Now I've used the script for some 30min and the problems I'm having is that at some point the playback fails and the PCH locks up. Forcing me to pull the power cord in order to get it working again. I would also think that a script that successfully plays a playlist (a playlist with the files on your computer) would be awesome. I hope we can further develop this to get it running smoothly. =) This sounds like the random lockups I have been experiencing when playing movies this way, interesting with the FTP bit... Could it be that the PCH runs into a memory leak issue causing it to run out of available resources? Any clever developers out there who have seen this or know where we should start looking? Mono supports playlists but I have not tried it out yet. This thread has some juicy stuff going about creating playlists. |
|||
|
12-11-2008, 02:34 PM
(This post was last modified: 12-11-2008 03:10 PM by wsoderberg.)
|
|||
|
|||
|
RE: controlling popcorn from windows
Thanks for the wonderful feedback!
I've no longer got a problem with subdirectories, it's running smoothly now. Don't really know what solved it. All I did was remove the eventghost line as you said. Don't think eventghost was the thief though. The lockup is the only issue I'm experiencing now. I'll look into the playlist feature later on. ![]() Edit: Sometimes when I play a file it doesn't work. The thing is, nothing seems to be happening in the PCH when I play it. It just stops responding to the commands?? Control.txt output: killall gaya /opt/sybhttpd/localhost.drives/HARD_DISK/bin/nohup mono -audio -bgimg -single "http://192.168.1.65:8001//House of Pain - Jump Around [Cypress Hill remix].mp3" -dram 1 & exit ps -w output: ![]() After I've run the: cd / ; gaya < /dev/null > /dev/null 2>&1 & command the issue is the same. Although I can control the PCH with the remote now when it locks up, that's good. ![]() When the PCH didn't listen to the script anymore, I tried to start playback with the remote on the PCH. Got the message: Could not play. |
|||
|
12-11-2008, 04:15 PM
|
|||
|
|||
RE: controlling popcorn from windows
(12-11-2008 02:34 PM)wsoderberg Wrote: After I've run the: Sending the reboot command in a telnet session will restart the PCH by the way, then you wont have to reach for the power cable. ![]() Before I found out about faking the remote with the "echo 212 > /tmp/irkey" command i used the kill command, this always made the next mono player unhappy since there was old crud left over from the earlier player. Could be that once mono has choked on a media file and exited it leaves messy droppings in a similar manner. Could be that some buffering helps with the music playback, You can try dropping in "-audio -prebuf 100 -bgimg -single" as parameters for Mono. |
|||
|
12-11-2008, 06:45 PM
|
|||
|
|||
|
RE: controlling popcorn from windows
Buffering did not help.
![]() Reboot command via telnet helps alot tho. Feels alot safer then plugging the power cable... |
|||
|
« Next Oldest | Next Newest »
|

Twitter
Facebook
NMT Wiki
Search
Member List
Help
[19. June 2013] Soundcloud® available now





).
![[+]](images/collapse_collapsed.gif)






![[Image: UraeNAuDH.jpg]](http://pici.se/pictures/UraeNAuDH.jpg)