XMMS ImprovementsForum: DSL Ideas and Suggestions Topic: XMMS Improvements started by: reid_geo Posted by reid_geo on Nov. 27 2005,21:03
DSL would be just about perfect if WMA support was automatically supported in XMMS. I don't know what licensing issues are involved. Both MP3 and WMA plugins are available for XMMS for other Linux distros - and oddly MP3 is built into the XMMS that comes with DSL, even though other distros claim that is illegal.Many of us trying to leave the Microsoft environment, (well me anyway) have large numbers of wma files that we want to take with us. It seems like this would be a relatively easy plugin to port to DSL, since it already exists as a .deb package for some other Debian-based distro. I have had some success using a package from rarewares: WMA support works, but the install is not clean. Posted by friedgold on Nov. 27 2005,23:03
I made a DSL extension for WMA in XMMS a while ago but never submitted it as I wasn't sure about the legalities (stupid software patents). If the DSL developers are OK about hosting it in their repositary I'll happily submit it.
Posted by chickenman on Nov. 28 2005,02:49
Man I hate WMA, mpg or ogg for me (and only because of mp3's extremely wide use). WMA has all this stupid crap built into it to stop piracy dosent it? - what advantage does it have over open source stuff?, I can only presume you have a stack of wma's or something...</bitch> Posted by davide on Nov. 28 2005,16:27
while I wouldn't recommend having a wma plug-in available in the base distro, a wma extension would be great to help people leave the winblows environment.a LOTof people have wma music stored in their PCs Posted by modderxmaniac on Nov. 28 2005,17:52
hey, genius, mp3 is MPEG-Layer 3. I am a Windows user, and linux seems scary, especially this distro. and will probably stay that way for a few more years... Anything along the lines of better media management in this distro is worth it, I'm a media freak, which is why Windows and MacOS have won me over...pity... Posted by cbagger01 on Nov. 28 2005,18:06
mplayer has the ability to play wma files with a simple download of a codec pack.since you are already downloading the codec pack anyways, you might as well download mplayer too. It's only a few MB. It's not that hard. There are so many other more important things that can be added to the base iso besides WMA support, I would not have enough room to type them all here. Posted by lesliek on May 17 2006,06:09
Because I was searching for related information, I happened on this thread and am taking the liberty of adding something to it very late, in case it should help someone else.I downloaded an RPM of xmms-wma v 1.0.5 from the developer's website and extracted from it the file libwma.so. I installed that lone file in /usr/lib/xmms/Input and now my xmms (in DSL v 2.2b) plays wma files. I would like to be able to convert those wma files into mp3 files and have found some bash scripts which are said to do that. However, they unfortunately depend on using mplayer, rather than xmms. I can't get the mplayer.dsl to work. I did find the following statement on the Web, "[W]hat you need to do is play the WMA file through something that understands WMA (mplayer, xmms-wma etc) and get the raw PCM output. And then run this raw PCM output through lame ... to get the desired encoding." That suggests to me that xmms with wma support could be used instead of mplayer, but I haven't the skill to achieve the substitution. If anyone else does and were willing to do it, that'd be great. Posted by mikshaw on May 17 2006,15:50
Use the "disk writer" output in Xmms, which will output to a file instead of just playing the audio. Posted by lesliek on May 18 2006,00:51
Thanks very much for drawing my attention to "disk writer", mikshaw. I'll now give that a go.
Posted by mikshaw on May 18 2006,02:09
If you can't play wma with xmms (i have no idea how difficult it is), you might also be able to accomplish the same task with mplayer:
or
or
Use the command mplayer -ao help to see if the pcm/wave file writer was compiled into mplayer Posted by lesliek on May 18 2006,06:01
Thanks for your further post, mikshaw.Acting on your first post, when I changed the XMMS output plugin to "disk writer", I got, as you'd foreshadowed, a .wav file added to my existing .wma file. I then used lame.dsl on the .wav file, which produced a third file, which was an .mp3. So I got what I'd hoped for, but in a labour- and space-intensive way. As to using mplayer instead of XMMS for the conversion, while I've found bash scripts using mplayer to convert .wmas to .mp3s, I couldn't get mplayer.dsl to work. Everything I tried returned the message "illegal instruction". In a way, my not being able to use mplayer is a good thing, since I'm pretty pressed for space anyway. The only disadvantage of using XMMS is that no one's written a bash script using it in the conversion process. I looked at the documentation for XMMS and there seems no way to change the output plugin from the command line in XMMS. I did, however, discover, in ~/.xmms/config, a line naming the current output plugin. What I know about bash scripting could be written on the back of a postage stamp with lots of room to spare, but I'm wondering whether one can, in a bash script, search the config file and, if the named output plugin isn't disk writer, change it to that and, only then, run XMMS. That would overcome the absence of an output plugin option internal to XMMS. If that can be done and then reversed afterwards, then it seems to me that the process could be automated satisfactorily. I'd welcome your further advice. Thanks again, Leslie Posted by mikshaw on May 18 2006,15:56
Xmms seems to be one of those applications that is not really built for automation. Of course you can do what you're suggesting, but to me it sounds very messy.For scripting and batch processing, it's usually better to stick with applications that can be fully controlled from the commandline. In this case mplayer really is the most appropriate tool....the problems you had with it can most likely be tracked down by examining the script and checking what features are supported by mplayer.dsl Another possible option is Sox, although I'm pretty sure the one made for DSL does not support wma. Posted by lesliek on May 18 2006,19:06
Thanks yet again, mikshaw.At least for me, it wasn't a case of the wma to mp3 conversion script I was trying not working because some feature of mplayer required by the script was not present in mplayer.dsl. Instead, it was a case of mplayer not working at all. After my last post (gee, that sounds ominous, doesn't it?), I kept searching for further information about this and finally came across http://wiki.ltsp.org/twiki/bin/view/Ltsp/ManagingUserConfiguration. At that page is a part of a login script which changes the output plugin of xmms from OSS to ESD. Before I start to bang my head against the wall trying to get mplayer.dsl to work for me (I know already that sox won't do the job), I'm going to try to integrate the bit of script I just referred to into the conversion script I already have and see if that'll work for me. If I do get it to work, I'd be happy to post it here, just in case it could help someone else trying to do the same thing as me, but I don't know the etiquette about such things. Would that be appropriate? Best wishes, Leslie Posted by mikshaw on May 18 2006,21:39
That script looks like it's pretty much exactly what you described earlier. It simply replaces the string "libOSS.so" with the string "libesdout.so". The "-i" parameter of sed allows you to edit the file directly rather than first making a temp file. I forgot about that parameter, which is one reason I was thinking it'd be messy. The main reason, though, is that you still need to reverse the process when you want to just play music. Perhaps a script could be written that makes the change, runs the conversion, and then returns the config file to its original state.
Posted by lesliek on May 18 2006,22:00
Thank you for telling me what the -i option for sed does! When I found that script and noticed the crucial sed command, I started looking for a beginner's sed tutorial, since pretty much all I know about bash scripts is at the "Hello world" level. I found some, but none of them that I saw mentioned -i. I suppose the information is in a man or info page about sed, but I was trying to get myself spoon-fed.As to automatically changing the output plugin back to the original OSS after the .wav file is or the .wav files are created, I already had that in mind, as I'd mentioned earlier. Thank you for all your help over this. Posted by jot on May 19 2006,22:30
This is my first post so there it goes 'Hello all' lesliek if You wish I can help You with this script. Ok, so first thing, if You want to substitute the output plugin in 'config' file You can do it like this: sed -i '/output_plugin/s/OSS/disk_writer/' /home/dsl/.xmms/config then xmms -p "$1" when it ends You will have to close xmms manually the next line : lame "${1/wma/wav}" "${1/wma/mp3}" to restore the old config : sed -i '/output_plugin/s/disk_writer/OSS/' /home/dsl/.xmms/config But i don't think you can fully automate it with just bare xmms... unless You use < xmmsctrl > , You can find rpm here: [url="http://rpm.pbone.net/index.php3/stat/4/idpl/1521354/com/xmmsctrl-1.8-1mdk.i586.rpm.html"]xmmsctrl RPMs[\url]. It gives you more commandline control over xmms. I'll try to write a script with use of xmmsctrl and post it here. If You have more questions, just ask. @mikshaw : i know sed a bit , but the i option is new to me, and I'm glad You've mentioned it. Previousl I used: sed 's/x/y' file > a ; mv a file Now life will be easier Thanks Posted by mikshaw on May 19 2006,22:55
Or you can add the command killall xmms to the script. This may be a harsh way to close it (i don't understand signals very well), but it works. Posted by lesliek on May 20 2006,02:24
Many thanks to both jot and mikshaw, whose posts I've just been able to read. I'm away from my DSL computer for the next 24 hours, but will get back to this as soon as I'm with the computer again.Leslie Posted by lesliek on May 21 2006,09:45
Well, I've now had some time to play with this and have reached the following point:#!/bin/bash sed -i "s/libOSS.so/libdisk_writer.so/g" ~/.xmms/config #process=xmms #t=`pidof $process` for i in *.wma do filename=`basename "$i" .wma` echo "Ripping $i" xmms "$i" #kill $t killall xmms lame "${i/wma/wav}" "${i/wma/mp3}" done sed -i "s/libdisk_writer.so/libOSS.so/g" ~/.xmms/config I already knew that the opening and closing lines worked properly to change the XMMS output plugin from OSS to Disk Writer and then back again and so I didn't try jot's alternative. I did, however, use his line for lame, changing the 1 to an i, since I'd already been using i. The most serious problem I have with the rest of the script is that I can't yet stop XMMS from within the script. I tried mikshaw's suggestion of killall xmms (the way the script above is written). It didn't work for me. I tried something else from a bash script I found on the Web called kill-process.sh, which I've commented out above, namely: process=xmms t=`pidof $process` kill $t It didn't work for me either and I don't understand enough about these things to know why not. One other problem is less serious. I'm left at the end of the process with three files, Beethoven.wma (a minute long extract I already had, which I'm using for test purposes), Beethoven.wav and Beethoven.mp3. In his post, jot mentioned xmmsctrl. I had tried that, but with disastrous results. For a reason I've now repressed, I'd decided I couldn't try to get anything useful out of the rpm of it, so I thought I'd try to compile the source code. To do that, I needed to download a dsl (gcc?). After I'd done that and rebooted, I ran out of space while the extensions were being loaded at bootup and had to use a rescue disk to get rid of the new dsl before I could get things back on track. I'd appreciate very much any advice about how I can stop xmms from within the script and also about how I can automatically get rid of any .wav files produced in the course of the conversion process. Many thanks for the help already extended, Leslie PS As two of the lines in the script appear above, they're not quite correctly formatted. I can't figure out how to fix them in this post. Apologies for that. Posted by mikshaw on May 21 2006,14:35
lame "${i/wma/wav}" "${i/wma/mp3}" && rm -f ${i/wma/wav}I'm not sure why xmms is not closing. I know that getting the pid of an app before actually running it isn't going to work, but I don't know why killall doesn't force it to close. Posted by jot on May 21 2006,17:41
Hi, I think I have a solution fo you.First about RPMs. To extract RPMs or DEBs to tar.gz I use script I found a while ago and modified a bit to work with DSL ( I'm using gnu-utils.dsl, so if it doesn't work try that extension, for deb's you'll need 'ar' or use dsl-dpkg.dsl and do dpkg -x file.deb if I'm right)
Name it, ex . 2tgz.sh and make it executable with chmod +x 2tgz.sh It will ask you to view contents, if you wish default action to not to view contents change VIEW_CONT=a to VIEW_CONT=n Ok, so now you would be able to get xmmsctrl to work. After converting to tar.gz you can view the contents with emelfm and remove documentation or any other files, as I recall you need only xmmstrl, you can also check some examples provided in that rpm. Then move back when emelfm asks you to repack and choose yes. Now you have tar.gz that you can install with mydsl-load or by clicking myDSL in emelfm. ( you can also install freshly converted rpm, but it'll be larger ) If you wish you can copy xmmsctrl to another directory, create directory structure in unpacked tar.gz in emelfm and paste it to the location in this structure, ex. /opt/bin/xmmsctrl or /opt/xmms/xmmsctrl or /home/bin/xmmstrl With xmmsctrl you can do many neat actions with xmms from comandline and from bash scripts. For a list of options just run it without ant parameters. You can check if xmms is playing, and then execute any command : xmmsctrl playing && echo "Playing" || echo "Not Playing" I just have a thought, you can do something like:
Ok, but where is lame you ask. Just check < this > url There you can find : xmms-encode-lame_0.2.1-1_i386.deb and xmms-encode-vorbis_0.3-1_i386.deb Those are xmms output plugins for converting to mp3's and ogg's ( the second one ) You'll also need libmp3lame, it can be found on that site either. I used liblame-3.97-0_3.96.99+3.97beta2-0rarewares1_i386.deb Copy libmp3lame* to /usr/lib or add it to your tar.gz extension to usr/lib/ directory Maybe there are some libs needed for ogg, but again you'll find them clicking the url above. Remember to modify your script to change libOSS to libout_lame if you want to use that plugin. Hope this helps someone PS. Lame output plugin was tested with my first wma ever played, googled & downloadned from < here > Posted by mikshaw on May 21 2006,22:10
By the way, jot, thanks for teaching me the ${VAR/this/that} substitution. I didn't know about that one, and it's a lot easier to remember than the "cut" syntax. I can see where it might be troublesome in some situations, though. Say your file has a filename "somethingwav.wav". The substitution apparently only works on the first instance of "wav", and i don't know how to get it to use either a regexp (wav$), or a global substitution (${i/wav/mp3/g})
Posted by jot on May 22 2006,01:20
I know that it's a bit limited but although it's quite useful. As for your example, I've understood that you want to replace 'somethingwav.wav' with 'somethingmp3.mp3' , if so you can achieve this with ${i//wav/mp3} <- note the double slash, it means to substitute all occurences in the line.I've learned this trick from < here > Posted by mikshaw on May 22 2006,02:08
groovy, thanks =o)
Posted by lesliek on May 22 2006,04:03
Many thanks to jot and mikshaw for their latest help.I think I understand what jot is suggesting I try, but being realistic about my own abilities, I know I'd be better off trying first to see if there's any chance at all of stopping xmms within my script with facilities presently available to me. As to mikshaw's post, editing jot's line referring to lame as he suggested did delete the transitional .wav file, so that problem's out of the way. That leaves me then only with the question of stopping xmms within my script, rather than manually. I think I know now why neither killall xmms nor my alternative works. Leaving my script aside altogether, if I open a terminal, type xmms and press Enter, that opens a window representing the xmms player. If, instead, I type xmms & and press Enter, I get the output [1] plus a process number. Immediately after that, however, I get the prompt again and the window representing the player opens automatically, just as if I'd typed xmms at the second prompt. It's the fact that xmms opens in its own window that stops killall from having any effect on xmms, or so I suspect. On the assumption I'm right, is there some way from a script to close a program you've started in the script, which program has opened its own window? (Sorry to express my question in such a childish way, but I don't know the proper terminology.) Posted by mikshaw on May 22 2006,04:46
I think it is related to that, since xmms needs to be finished with its business before you should kill it, but I don't know how to get its pid without backgrounding it.
Posted by lesliek on May 22 2006,05:28
Does "pidof xmms" get xmms's pid(s) without backgrounding xmms?I opened xmms by clicking on its icon on the desktop. I then opened a terminal, typed pidof xmms and pressed Enter and got as output: 1189 1190 1191 1192. Of course, I may not be understanding what backgrounding is. The kill-process.sh I mentioned earlier relied on pidof, but when I tried to adapt it, I got nowhere. Posted by jot on May 22 2006,13:26
I didn't know how to check when xmms finished writing and that's why I suggested xmmsctrl and this little script:
I've also created some .tar.gz's with output plugins and xmmsctrl to install via mydsl, they can be found < here > If someone finds them useful and can put them in a more persistant location, please do so. Thank You for your attention Posted by mikshaw on May 22 2006,14:57
Backgrounding is necessary from a script if you need to continue on to do something else while the previous command is still running. In this case, xmms must be put into the background (xmms &) so that the next command (pidof xmms) can run. Otherwise pidof will not run until xmms is closed, and then it's too late to get its pid. You successfully got the pid when you did it manually because you opened a new shell while xmms was running, but you can't do that from a script unless you background xmms. As I said before, xmms isn't the most appropriate tool with which to do a batch process, since it requires interaction with the user (unless you add more software as jot suggested). jot: submit mydsl extensions to extensions(at)damnsmalllinux(dot)org Posted by lesliek on May 22 2006,21:55
The penny's finally dropped for me about my trying to kill xmms. (I think I can hear, even here in Australia, mikshaw and jot both shouting "About bloody time!")I've now got xmmsctrl installed, though I cheated a bit to do so. I downloaded an RPM containing it to my computer which runs Fedora. (The RPM was actually created for Mandriva.) I then extracted all the files from the RPM using a built-in extractor in Fedora. I found xmmsctrl among the extracted files and copied just that to my computer running DSL. It works. With xmmsctrl working, I hope I'll be able to bring this saga to an end later today. Once again, thanks to mikshaw and to jot. Posted by mikshaw on May 23 2006,03:14
That's another useful piece of knowledge. The fact is that many applications will have no trouble when copied directly from one distro to another, as long as you have all of the libs it requires. There are some things, such as kernel modules, that usually won't work this way, but mostly linux is still linux no matter what label gets slapped on it. Posted by lesliek on May 23 2006,03:54
My limited understanding of these things had been before this that such cross-distribution attempts would almost invariably fail, but what you say encourages me to make further attempts like this in the future.As I'm in the process of trying to get xmms to do things requested by someone using DSL, this is the second time I've succeeded in this way. I got libwma.so out of an RPM, copied it accross and it's worked in DSL too. Posted by lesliek on May 23 2006,05:15
A while ago, I posted a script that I was trying unsuccessfully to make work to convert wma files to mp3 files.I'll now post a later version of the same script, which version does work: #### #!/bin/bash sed -i "s/libOSS.so/libdisk_writer.so/g" ~/.xmms/config for i in *.wma do filename=`basename "$i" .wma` echo "Converting $i to .wav" xmmsctrl launch xmms "$i" while `xmmsctrl playing`; do sleep 1 done xmmsctrl quit lame "${i/wma/wav}" "${i/wma/mp3}" && rm -f ${i/wma/wav} done sed -i "s/libdisk_writer.so/libOSS.so/g" ~/.xmms/config #### It goes without saying that the script that jot posted is superior to this one, but I just wanted to see if I could amend the one I'd earlier posted to get it to work. Nothing of any significance in the script that works is an idea of my own; most of the things of significance in it came from mikshaw and jot and the balance came from scripts I found on the Web. Sincerest thanks again to mikshaw and jot for their guidance. Posted by jot on May 23 2006,07:42
I suggest You to try it with lame_out.so plugin it is in one of my posts above, it is like disk writer but outputs mp3'sAs for linux packages, I think that all of them are just compressed files but with different methods and you can convert any of them to tar.gz , rpm's deb's and dsl's , dsl are just renamed tr.gz (I think) but are handled differet by DSL. With my script above you can convert rpm's and deb's to tar.gz and then just install it with myDSL, I personally extract that archive and remove unneccessary files, like documentation etc. Of course not all rpm's can be extracted (with the script) , it depends which system they were created for. The binaries from such packages not always work but you can check their dependencies with 'ldd /path/to/file' and google for that library name. As you can choose from rpm's , deb's , dsl's or tgz's (linuxpackages.net) it's more likely that you will find it quite quickly. Ok, I've just read the topic again, it still is 'XMMS Improvements' so I'll finish < here > |