Page 19 of 20

Posted: Sun 02 Jun 2013, 18:05
by sc0ttman
starhawk wrote:@goingnuts -- go for it! Anything that can substitute for Flash Player (more or less) and work on the CPi meets my needs ;)
VLC with no gui is only about 2.5mb, and can play youtube stuff, if it's compiled with lua support (lua doesnt need to be installed once its compiled as far as i can tell..) ... and old VLC, like 0.8.6, compiled with lua and without qt gui might be a solution too... (and there's vlc-gtk as a frontend for it too)...

Posted: Sun 02 Jun 2013, 18:28
by starhawk
Anyone know how that'll perform on a P2 300MHz with 128mb RAM and 384mb swap?

Posted: Tue 04 Jun 2013, 16:05
by goingnuts
I could not get VLC running, nor gnash and although flasm decompress the swf ffplay/mplayer wont play...

Some scripts out there for mplayer but that seems to be based on youtube serving flv-format in the past.

I followed technosaurus idea here and got a working draft based on ffplay and a gtkdialog1 script. Video is working (some gives "Protocol not supported" though...) but I cant get sound out of the thing. Guess its a ffplay compile thing - maybe.
I do not use youtube enough to spend days fine tunning the thing so just drop the draft here for better minds or times...

Code: Select all

#!/bin/ash
#pmtube-0.1.
#demo script for gtkdialog1 sort of poor mans youtube viewer.
#June2013 goingnuts
#draft!

[[ -x ../../src/gtkdialog1 ]] && PATH=../../src:$PATH

rm -f tablelist test.html test2.html

#ash function file
echo '

get_me () {
	rm -f test.html
	if [ ! "${ENTRY}" = "" ]; then
		#need formating the query
		query=$(echo "${ENTRY}" | sed "s/ /+/g")
		busybox wget -O test.html -U firefox "http://m.youtube.com/results?gl=US&client=mv-google&hl=en&q="${query}"&submit=Search"
	else
		return
	fi
	#construct list of findings
	grep "<a accesskey=" test.html | grep -v "#" | cut -d " " -f3- | tr -d ">" > tablelist
}

list_me () {
	if [ -f tablelist ]; then
		cat tablelist | cut -d " " -f3-
	fi	
}

play_me () {
	#check status - are we playing?
	if [ ! "$(pgrep ffplay)" = "" ]; then 
		kill -CONT $(cat mypid)
		return	
	else
		rm -f mypid
		#do not play empty list...
		if [ ! "${LIST}" = "" ]; then	
			#first find link to the selection
			link=$(grep "${LIST}" tablelist | cut -d " " -f1 | cut -d ";" -f4 | tr -d "\"")

			#get the link
			busybox wget -O test2.html -U firefox "http://m.youtube.com/watch?gl=US&client=mv-google&hl=en&"${link}""
			wait

			play_url=$(grep -m1 "rtsp" test2.html | cut -d "\"" -f2)
		
			#now play it
			./ffplay -x 200 -y 200 -autoexit -window_title "${LIST}" "${play_url}" &
			echo $! > mypid
		fi
	fi
}

pause_me () {
if [ -f mypid ]; then
   	speakPID=$(cat mypid)
	kill -STOP $speakPID
fi
}	

stop_me () {
if [ -f mypid ]; then
    ffplayPID=$(cat mypid)
	kill -CONT $ffplayPID
	kill $ffplayPID
	killall ffplay
	rm -f mypid
fi
}	


' > /tmp/pmtube_ash


export MAIN_DIALOG='
<wtitle>pmtube 0.1</wtitle>
<vbox>
	<hbox>
		<entry>
			<variable>ENTRY</variable>
		</entry>
		<button>
			<label>Search</label>
			<action>get_me</action>
			<action clear>LIST</action>
			<action refresh>LIST</action>
		</button>
		<button>
			<label>Play selected</label>
			<action>play_me</action>
		</button>
		<button>
			<label>Pause</label>
			<tooltip>Pause</tooltip>
			<action>pause_me</action>
		</button>
		<button>
			<label>Stop</label>	
			<action>stop_me</action>
		</button>
		<button>
			<label>Quit</label>
			<action>exit</action>
		</button>
	</hbox>
	<hbox>
		<list>
			<input>list_me</input>
			<variable>LIST</variable>
		</list>
	</hbox>
</vbox>
'

gtkdialog1 -d --center --wmclass pmtube --program=MAIN_DIALOG -i /tmp/pmtube_ash

rm -f /tmp/pmtube_ash  tablelist test.html test2.html mypid
killall ffplay

exit

Posted: Thu 06 Jun 2013, 21:42
by Ibidem
goingnuts wrote:I could not get VLC running, nor gnash and although flasm decompress the swf ffplay/mplayer wont play...

Some scripts out there for mplayer but that seems to be based on youtube serving flv-format in the past.

I followed technosaurus idea here and got a working draft based on ffplay and a gtkdialog1 script. Video is working (some gives "Protocol not supported" though...) but I cant get sound out of the thing. Guess its a ffplay compile thing - maybe.
Re: "Protocol not supported": try youtube-dl, make sure you have librtmp/rtmpdump compiled with an SSL library...

Re: no sound:
strace ffplay <somefile.wav> 2>&1 >/dev/null |grep /dev
If it plays, try with an mp3/mp4 file you know has audio.

Note the order of redirection in the example above! Reverse it, and it's silent. But this way, stdout is silenced and stderr becomes stdout.

Posted: Fri 07 Jun 2013, 14:22
by goingnuts
Ibidem: thx...
I did look at "youtube-dl" but seems to be python-based and I could not get it running in P412.
My ffplay plays wav & mp3 files ok from disk...
Output of the suggested command:

Code: Select all

strace ./ffplay test.wav 2>&1 >/dev/null |grep /dev 
stat("/dev/sound", 0xbfb1e4e0)          = -1 ENOENT (No such file or directory)
open("/dev/dsp", O_WRONLY|O_NONBLOCK)   = 7
Maybe another app could take care of the sound - although this adds to the complexity - any youtube audio-only players out there?

Posted: Sun 23 Jun 2013, 00:27
by technosaurus
I did a new implementation of the startup commands using only jwm

Code: Select all

<StartupCommand>
for x in /root/Startup/*;do $x & done
</StartupCommand>
Also a wait4x program that uses xcb vs x11

Code: Select all

#include <stdlib.h>
#include <xcb/xcb.h>

int die(void){exit(1);}

int main(void){
int i=1000;
while((int)xcb_connect(NULL,NULL)<0 && i-- || die())
    usleep(10000);
return 0;
}

Posted: Sun 23 Jun 2013, 07:49
by Karl Godt
goingnuts wrote:Ibidem: thx...
I did look at "youtube-dl" but seems to be python-based and I could not get it running in P412.
My ffplay plays wav & mp3 files ok from disk...
Output of the suggested command:

Code: Select all

strace ./ffplay test.wav 2>&1 >/dev/null |grep /dev 
stat("/dev/sound", 0xbfb1e4e0)          = -1 ENOENT (No such file or directory)
open("/dev/dsp", O_WRONLY|O_NONBLOCK)   = 7
Maybe another app could take care of the sound - although this adds to the complexity - any youtube audio-only players out there?
Older Puppy kernels have a static /dev/snd/ directory .
Just looked into it by loopmounting a pup-430.sfs but /dev/sound and /dev/dsp are not in /dev/snd/ .
/dev/dsp is in /dev/ .
Probably make a symlink /dev/sound/ -> /dev/snd/ .

Actual Puppy rc.sysinit deletes /dev/snd folder and uses the nodes dynamically created by the sound drivers (+udev) .

Posted: Mon 24 Jun 2013, 15:27
by PANZERKOPF
Karl Godt wrote: Just looked into it by loopmounting a pup-430.sfs but /dev/sound and /dev/dsp are not in /dev/snd/ .
/dev/dsp is in /dev/ .
Probably make a symlink /dev/sound/ -> /dev/snd/ .
/dev/snd/* are ALSA standard devices whereas /dev/sound/[dsp|mixer|etc..] (or /dev/[dsp|mixer|etc..]) are emulated OSS devices.
We need to load additional modules for OSS emulation (snd-pcm-oss, snd-mixer-oss,snd-seq-oss).

Posted: Tue 25 Jun 2013, 19:22
by greengeek
I have been wanting to try PeasyMP3 on pUPnGO2012 (just because I like tinkering and I like the "Carousel" drag n' drop randomiser...) and if I try to run it in a terminal I get an error message something like "-f" is an illegal operation.

If I remove the several instances of "-f" parameter from the programme (eg in the line: "export -f PAUSE") I do not get any further errors, but the programme obviously doesn't do anything productive either.

My uneducated guess is this is an issue with gtk version. Can anyone suggest a way around it? (or is this just a stupid thing to try...)

PeasyMP3 : http://murga-linux.com/puppy/viewtopic.php?t=86654

Posted: Tue 25 Jun 2013, 21:10
by rcrsn51
I believe that "export -f" requires the bash shell. Try changing the top line from "/bin/sh" to "/bin/bash".

Posted: Wed 26 Jun 2013, 04:11
by technosaurus
Gtkdialog can source functions using the -i flag. Rather than using bash and exporting functions, I would recomend separating the functions to a file.

... I think it is -i anyways

Posted: Wed 26 Jun 2013, 07:36
by greengeek
rcrsn51 wrote:Try changing the top line from "/bin/sh" to "/bin/bash".
When I do this I get a "peasymp3 not found" message.
(I tried using the "./peasymp3" syntax as well as just "peasymp3").

Maybe bash is an add-on for pupngo2012? - I thought I read that once but can't now find the comment.

Posted: Wed 26 Jun 2013, 14:37
by goingnuts
greengeek: There is no bash in pupngo. I posted a static bash version in the old pupngo thread. But that wont get the PeasyMP3 running in pupngo alone. The gtkdialog version is GTK1.2 and over a year old so it wont accept much newer gtkdialog syntax. A rewrite is only way out...

technosaurus: The new implementation of the startup commands using only jwm if quite nice!
For GTK functions I fully agree on the sourcing of functions principle - and keep the gtk-GUI stuff as simple as possible using the sourced functions.

Karl Godt & PANZERKOPF: Thanks for input on the sound issue!

Posted: Wed 26 Jun 2013, 17:31
by technosaurus

Code: Select all

while ([ ! -S /tmp/.X11-unix/X0 ]) do sleep .1;done
jwm -display :0
A shell only version of wait4x that works for the common case to minimize the time waiting for the desktop.

Posted: Sat 27 Jul 2013, 19:25
by technosaurus
In case anyone is interested, I wrote my own compiler independent partial c library for compiling smaller/faster _static_ apps:
Technically its not a "library" as it is built as a single header file called libc.h and has very minimal overhead (~500b)

It is here:
http://www.murga-linux.com/puppy/viewto ... 660#715660

Posted: Tue 27 Aug 2013, 15:08
by bark_bark_bark
Hello, I have a really ludicrous idea about a puppy derivative. I need to know, how can I get the current code in the woof build system into the original pUPnGo. Also how to a compile a glibc from scratch?

Posted: Tue 27 Aug 2013, 15:27
by starhawk
Just curious, bark_bark_bark, what's your idea...?

Posted: Tue 27 Aug 2013, 16:17
by bark_bark_bark
The idea I had, was my vision of a modular puppy distro.

There will be:

-different kernel options
-different base tool chains
-different desktop options

while having a big online repo and having some unity no matter what modules you have loaded. I want this to be distro that will benefit all (whether want to use on a P3 system, Atom netbook, or on some thousand core gaming system), there will be something for everyone.

Posted: Wed 28 Aug 2013, 07:28
by greengeek
In order to ever make that work I imagine you would have to have a very tightly written set of definitions and parameters that different people could work to. And then lots of testing, bug fixing, and rewriting of the definitions and parameters..

I don't know if thats gonna fly...

Posted: Thu 29 Aug 2013, 12:20
by technosaurus
It is possible, not too difficult and has been done (mostly via zdrv.sfs), but dont expect all apps from other distros to work with other kernel versions, they dont all build packages against a lowest common denominator ... Fyi If you build packages against Linux 2.32, glibc-2.6ish and gtk2.12 (and corresponding dependencies) they are pretty likely to work on other distros... Basically build against the oldest version that will build it if you can. There are other considerations like stack smashing, etc... Someone really should post a portability howto wiki somewhere for other builders.