Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 14 Dec 2019, 18:33
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to use Puppy as an Internet Radio? (No Monitor)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
murmelbahn

Joined: 15 Mar 2009
Posts: 47

PostPosted: Sat 05 Dec 2009, 16:47    Post subject:  How to use Puppy as an Internet Radio? (No Monitor)  

I've had requests from our family manager for an internet radio in the kitchen.
What I'm thinking to do is use an old PC for the job: box + keyboard + WLAN,
but no monitor + mouse, in order to keep a tidy appearance.
Auto-launch a small script at startup that turns Puppy into an internet radio.
I did manage to make gxine connect to a certain streams upon key press
before I got stuck. Somehow gxine manages to force itself into the foreground
so any subsequent key presses for changing the station are ignored.
Intended behaviour is that keys 1 to 5 do launch a station and any other keys
switch the radio off. Here's the script code:
Code:

#!/bin/bash

while [ 1 ] ; do   # "endless" loop

   read -n 1 KEY   # wait for key being hit
   
# pkill replacement, taken from here:
# www.linuxweblog.com/node/148
   for i in `ps ax | grep "gxine"| cut -d ' ' -f 1`
      do
         kill -9 $i
      done

# www.sr.se/sida/artikel.aspx?programid=2321&artikel=787720   
   case $KEY in
      1)  gxine mms://wm-live.sr.se/SR-P1-High & ;;
      2)  gxine mms://wm-live.sr.se/SR-P2musik-High & ;;
      3)  gxine mms://wm-live.sr.se/SR-P3-High & ;;
      4)  gxine mms://wm-live.sr.se/SR-Radiosporten-High & ;;
      5)  gxine mms://wm-live.sr.se/SR-extra12 & ;;
      *)  break;;
   esac
   
done

wmpoweroff   # Puppy Linux


Is there a way to make gxine behave better?

JR
Back to top
View user's profile Send private message 
Béèm


Joined: 21 Nov 2006
Posts: 11775
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

PostPosted: Sat 05 Dec 2009, 18:11    Post subject: Re: Puppy as Internet Radio (No Monitor)  

murmelbahn wrote:
I've had requests from our family manager for an internet radio in the kitchen.
What I'm thinking to do is use an old PC for the job: box + keyboard + WLAN,
but no monitor + mouse, in order to keep a tidy appearance.
Auto-launch a small script at startup that turns Puppy into an internet radio.
I did manage to make gxine connect to a certain streams upon key press
before I got stuck. Somehow gxine manages to force itself into the foreground
so any subsequent key presses for changing the station are ignored.
Intended behaviour is that keys 1 to 5 do launch a station and any other keys
switch the radio off. Here's the script code:
Code:

#!/bin/bash

while [ 1 ] ; do   # "endless" loop

   read -n 1 KEY   # wait for key being hit
   
# pkill replacement, taken from here:
# www.linuxweblog.com/node/148
   for i in `ps ax | grep "gxine"| cut -d ' ' -f 1`
      do
         kill -9 $i
      done

# www.sr.se/sida/artikel.aspx?programid=2321&artikel=787720   
   case $KEY in
      1)  gxine mms://wm-live.sr.se/SR-P1-High & ;;
      2)  gxine mms://wm-live.sr.se/SR-P2musik-High & ;;
      3)  gxine mms://wm-live.sr.se/SR-P3-High & ;;
      4)  gxine mms://wm-live.sr.se/SR-Radiosporten-High & ;;
      5)  gxine mms://wm-live.sr.se/SR-extra12 & ;;
      *)  break;;
   esac
   
done

wmpoweroff   # Puppy Linux


Is there a way to make gxine behave better?

JR
Nice script.
But I have the same issue with mplayer.
So it should be something else.

_________________
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 8739
Location: qld

PostPosted: Sat 05 Dec 2009, 18:59    Post subject:  

what about this?

1) killall gxine &&; gxine mms//someradiostream &;;
2) killall gxine &&; gxine mms//someotherradiostream &;;

etc.

I don't know if it would work.You wouldn't need to kill the gxine pid at all.

--------------------------------

A little later... look at this line
Code:
ps ax | grep "gxine"| cut -d ' ' -f 1


If I'm running gxine and run that command in a terminal I get 3 empty lines. If I change the "cut" field to 2 [ -f 2 ] I get 3 pids. I then run that "for" loop in aterminal and it kills gxine. Maybe that would work for you instead of changing the cases as I suggest earlier.

Cheers

_________________
Puppy Linux Blog - contact me for access
Back to top
View user's profile Send private message Visit poster's website 
trapster


Joined: 28 Nov 2005
Posts: 2119
Location: Maine, USA

PostPosted: Sun 06 Dec 2009, 07:18    Post subject:  

Maybe other console music players? DRadio, moc, orpheus, etc...
_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog
Back to top
View user's profile Send private message Visit poster's website 
murmelbahn

Joined: 15 Mar 2009
Posts: 47

PostPosted: Sun 06 Dec 2009, 07:41    Post subject:  

Indeed the "pkill" replacement code doesn't work properly - should eliminate
leading spaces first. "killall" is much simpler. Thanks for that!

However the core problem remains: gxine forces itself into the foreground
and gains control so that the script code no longer gets executed.
Any further keys being pressed in order to change channels or shut down
won't work as gxine will receive the key strokes instead of the script.
So how can I force the script back into the foreground (is that the correct term)?

@trapster
Just saw your suggestions, thanks. I'll look at those but if at all possible would prefer
gxine as that's in Puppy already and otherwise working well.

JR
Back to top
View user's profile Send private message 
murmelbahn

Joined: 15 Mar 2009
Posts: 47

PostPosted: Mon 07 Dec 2009, 19:10    Post subject:    

OK, got it! Solution is to use VLC and launch it in daemon mode:
Code:
VLC -d mms://wm-live.sr.se/SR-P1-High

VLC will stay backgrounded, script will retain control.
Maybe I could even use technosaurus' < 1.5 MB no-gui VLC, must check.

Guess this one must be called PNIR Puppy's not an Internet Radio.

Thanks to everybody for their support! Very Happy

JR
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0484s ][ Queries: 11 (0.0052s) ][ GZIP on ]