pUPnGO 2012

A home for all kinds of Puppy related projects
Message
Author
User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#361 Post 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)...
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#362 Post by starhawk »

Anyone know how that'll perform on a P2 300MHz with 128mb RAM and 384mb swap?

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#363 Post 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
Attachments
snap0005.png
playing...
(141.8 KiB) Downloaded 1070 times

Ibidem
Posts: 549
Joined: Wed 26 May 2010, 03:31
Location: State of Jefferson

#364 Post 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.

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#365 Post 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?

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#366 Post 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;
}
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#367 Post 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) .

PANZERKOPF
Posts: 282
Joined: Wed 16 Dec 2009, 21:38
Location: Earth

#368 Post 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).
SUUM CUIQUE.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#369 Post 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

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#370 Post by rcrsn51 »

I believe that "export -f" requires the bash shell. Try changing the top line from "/bin/sh" to "/bin/bash".

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#371 Post 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
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#372 Post 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.

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#373 Post 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!

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#374 Post 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.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#375 Post 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
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

bark_bark_bark
Posts: 1885
Joined: Tue 05 Jun 2012, 12:17
Location: Wisconsin USA

#376 Post 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?
....

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#377 Post by starhawk »

Just curious, bark_bark_bark, what's your idea...?

bark_bark_bark
Posts: 1885
Joined: Tue 05 Jun 2012, 12:17
Location: Wisconsin USA

#378 Post 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.
....

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#379 Post 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...

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#380 Post 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.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply