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 18 Nov 2017, 12:18
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
The Headless MP3 Player
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
CainRam

Joined: 10 May 2008
Posts: 2

PostPosted: Sat 26 Dec 2009, 20:16    Post subject:  The Headless MP3 Player
Subject description: Should've posted around Halloween
 

Hey, all - Long time listener, first time caller.

Here's what I want to do - configure a Puppy hard-disk installation to start playing my music library randomly on boot. I'm installing this in my workshop at work and want to just tuck the box away with no monitor and push power to start the music and push it again to stop it.

I've been using Puppy since early 3 series so I know pretty much how it works. I'm looking for things like application suggestions, command line tricks, scripting advice, whatever will get the job done. Specifically, how do I automatically run a command on boot?

Thanks in advance,
Ramsey
Back to top
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Tue 29 Dec 2009, 01:42    Post subject:  

Here's a command that should play just about any type of song from the command line.
Code:
ffmpeg -i "/dir/file" -f au - | aplay -D plughw


If that's too ugly, you could compile mpg321 or something similar. You can set the volume level from the command line using the amixer command.

You'll have to script the random song part. You can google for examples, such as this one. http://www.gilesorr.com/code/randsong.html

If you want the power button to shut down automatically you'll probably need acpid. http://www.murga-linux.com/puppy/viewtopic.php?t=38173

There's a few ways you can make it automatically start. The way I would do it, is edit /etc/profile. At the bottom where it says "exec xwin", I would put "exec /bin/RandomSongScript.sh" (or whatever you named it). That will prevent X windows from starting, but you shouldn't need it anyway since there's no monitor. Also with fewer processes running, less can go wrong.

Another thing you might consider is mounting your disks read-only to hopefully help prevent any file system corruption since the data shouldn't change, and you never want to have to do any maintenance. That way if it ever refuses to power off, you can pull the plug without worries.
Back to top
View user's profile Send private message Visit poster's website 
CainRam

Joined: 10 May 2008
Posts: 2

PostPosted: Tue 29 Dec 2009, 15:39    Post subject: Thanks!  

I've looked into mpg123 and have the commands I need for that figured out.
I've been playing with /etc/init.d (I think) and the /etc/profile thing sounds more like what I'm looking for.
Can I mark my entire partition read only and still boot and run normally? I had considered this but wasn't sure if I'd be getting weird errors?

thanks so much for the advice!!

cainram
Back to top
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Tue 29 Dec 2009, 16:01    Post subject:  

hmmm, I actually haven't messed with a read-only save file. It probably would be a bit of a pain. However, you could easily Ramboot if you have enough ram.
http://www.murga-linux.com/puppy/viewtopic.php?t=48465

You wouldn't want to put the MP3s in your save file in that case. You can just save them on the hard drive, on their own partition, outside the save file, and then add an entry to the /etc/fstab file to mount the mp3 partition read-only.
Back to top
View user's profile Send private message Visit poster's website 
murmelbahn

Joined: 15 Mar 2009
Posts: 47

PostPosted: Tue 29 Dec 2009, 16:43    Post subject:  

CainRam,

if you're managing your "blind" jukebox from a central bash script and call
a music player from within that script, control will go over to the player
(whose window is now in focus), at least until the song finished playing --
unless you're running command line / outside X that is.
You can avoid this by using vlc and invoking it in daemon mode (vlc -d).

And when you've h(e)a(r)d enough, wmpoweroff will shut down.

Good luck.

JR
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
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.0371s ][ Queries: 14 (0.0044s) ][ GZIP on ]