Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-29-2008, 06:08 PM
|
#1
|
Member
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900
Rep:
|
Suggestions for a noninteractive music jukebox?
Hi all,
I have an idea for something I'd like to set up, but am having trouble finding anything that exactly matches my needs, so I thought I'd ask here to see if anyone had any ideas to help out.
The situation is pretty simple: I have a whole load of music files (all kinds of formats, mp3, ogg vorbis, flac, aac, wma, mpc), and I have a spare old computer (PII or so). What I want to do is make the computer into a headless, networkless, non-interactive jukebox. The idea would be that I would connect the computer to a hifi, and when I pressed the power button it would turn on and start playing music at random from the collection. When I pressed the button again it would shut itself down. No further interaction or communication with other devices required.
At the moment I'm thinking along the lines of a minimal (X-less) Gentoo install, as that way I can set things up without any unneeded stuff, and hopefully keep the boot time down. I can write a script to launch a music player once the machine has finished booting, but the real problem is choosing/finding a suitable music playing program.
There are two big problems in finding something suitable. The first is the range of formats: ideally I'd like something that plays all the formats listed above. The second is that there are a huge amount of files (in the region of 17000), so randomising the playlist is not trivial. I tried out music123, as that can be configured to play all the above formats (probably excluding wma), but on a 3GHz P4 it died after spending a few minutes trying to get started.
So, do any of you helpful people have any suggestions? Obviously, if you know of a walkthrough for this exact problem that would be great, but I'm only expecting/hoping to get some tips for things to check out.
In the interest of keeping the system as fast as possible, I'm thinking about sticking to command line only, although if the only possibility requires X I would consider it. Also, while I know they're meant well, responses along the lines of "buy a Squeezebox" aren't very useful, because (a) I'm poor and (b) this is a geeky project for the fun of it / to reuse an old computer! There are a fair few guides on how to set up a simple Jukebox server on Linux out there, but they all seem to be focused on either accessing network shares, or including some kind of GUI and monitor so that people can control the playlist.
Thanking you all in advance for your help!
P.S. By the way, should I manage to come to some solution to this problem, I will put up a walkthrough, giving credit where it is due of course!
Last edited by Gethyn; 12-29-2008 at 06:11 PM.
Reason: Slight rewording
|
|
|
12-29-2008, 06:34 PM
|
#2
|
Senior Member
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313
|
I would suggest VLC as the player, it covers many formats to begin with, and it works via commandline. Here's more info: http://wiki.videolan.org/Documentati..._Line_Examples
|
|
|
12-29-2008, 07:34 PM
|
#3
|
Member
Registered: Jan 2007
Location: Pennsylvania
Distribution: Ubuntu 8.10 Server/9.04 Desktop, openSUSE 11.1
Posts: 154
Rep:
|
look into mpg123 to play your music. It is all command line and very simple. Like most players, it might have trouble with some files, so ffmpeg to convert files from one format to another is a thought.
I understand that you want the simplicity of a standalone box, but if you can network the box, it might be a good idea to set up your music folder as a samba share so you can access it from another computer to add music.
If you are familiar with smalltalk as a programming language, I have a jukebox program I wrote that runs on a single linux server, but is able to be interacted with via its webserver.
- Jim
|
|
|
12-30-2008, 05:14 PM
|
#4
|
Member
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900
Original Poster
Rep:
|
Thanks for the suggestions. I'm familiar with mpg123 - it's the program music123 uses as a backend to play mp3s - but as you can imagine, re-ripping/transcoding 17000 tracks into mp3 is something I'd like to avoid if possible. I'm also not sure that mpg123 would do any better than music123 at shuffling the playlist. Also, while I appreciate the advice about network connectivity, it just isn't practical, I don't have wireless and using ethernet would involve running a 30+ metre cable to the jukebox! I've thought about updating the library, and I could put the music on an external drive which would be automounted by the jukebox, but which I could then move to another computer from time to time to update the library. Failing that, moving an internal hard drive out every few months to update it wouldn't be too much of a problem.
I had a go at using vlc, but I couldn't get it to do what I wanted - quite possibly down to my own ignorance, but there you go. First I tried feeding it a playlist, using the command
Code:
vlc --random --aout alsa --no-interact --no-show-intf -I rc --playlist-autostart /mnt/music/audio/00-all_music-playlist.m3u
but it didn't shuffle, just started playing the first track in the playlist. I then tried feeding it the music directory and telling it to recurse using the command
Code:
vlc --random --aout alsa --no-interact --no-show-intf -I rc --recursive expand --ignore-filetypes "txt,jpg,sfv,nfo,png,bmp,gif,m3u,exe,dll" /mnt/music/audio/
but that was pretty unreliable. It started playing once out of four or five attempts, the rest of the time it just sat there for a couple of minutes without doing much, at which point I killed it. That was on an Athlon 3400+ system, which while not exactly new is a lot faster than a PII, so I'm not too confident it would work on the intended system either (assuming that the problem was just in finding/shuffling all the files).
Since it would really be a question of setting things up just once at the beginning, I'm wondering if there is some kind of command line based player that includes a database. If so, I could populate when doing the initial setup without worrying if it took a long time, and it could be used on subsequent boots. A lot of the problems (other than ignorance) I'm having with the things I've tried seem to be related to the initial find/sort for so many tracks. I know that Amarok can be set to use mysql for large music collections, but I'm not sure about command line media players.
Thanks for the suggestions so far, any further ideas?
|
|
|
12-31-2008, 08:58 PM
|
#5
|
Senior Member
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313
|
Maybe setup an Icecast or Shoutcast server, use a commandline player to connect to it, take a feed from line out/speaker out then input it to your stereo. I did that using a pair of desktop speakers connected to the server, so when I powered them on, instant music. You will of course need to make the Icecast/Shoutcast server startup as a service, then script the rest to start sequentially for the initial first boot.
These are what I used for my implementation of my jukebox: sc_serv, sc_trans_linux (available from the shoutcast website).
|
|
|
01-04-2009, 09:03 AM
|
#6
|
Member
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900
Original Poster
Rep:
|
Thanks, that sounds interesting. I've also heard about mpd, which sounds like it might be the right sort of thing. I'll try out these ideas and let you know how it goes...
|
|
|
All times are GMT -5. The time now is 02:03 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|