Aqualung improvement

Here is something else that I have found in ttuuxxx's "431.1 Firefox Puppy" thread....

Forum member Gedrean posted this:

Only problem I had was, and not sure if this is with yours or with puppy 430 in general, that Aqualung would never actually open with a file I clicked on, I had to afterwards drag it in there.
Also the Aqualung script, when I read it, seemed horribly inefficient. Kill the other processes, then relaunch, with the argument? Not too elegant either.

So I had about 5 hours of editing, finding that behaviors would change from minute to minute (probably my corrupted computer somehow), and agonizing over the Aqualung command line options and their strange intricacies (sometimes they will behave as advertised, ONLY if other arguments exist) but here's what I've done:

I've managed to make the default behavior for Aqualung to Enqueue (add to playlist without clearing rest of it), caused it to only ever open ONE process and not need to kill others, and set it up so that there's a right-click for directories to enqueue the whole directory and contents in as well! (Great for my huge music directory!)

I've got three files I'll paste in code, they're very short, and I'll detail what I did (something I wish others would do, as bash scripts are incredibly hard to read!)

First, aqualung launcher script, located in /usr/bin :
Code:
#!/bin/sh
exec aqualung2 --session=0 -E /dev/null "$@"

--session=0 tells it to do remote cue functions (according to the aqualung usage text) with session #0, which is either the first one already opened (and in this case the only) or the one which is opening now if no other session exists.
If you'll note, especially ingenious, it attempts to Enqueue /dev/null, which will fail out with an error that it is unable to open that file ... this is required so that the -session=0 will actually do anything other than opening a new session.
-E tells it to enqueue, and then it adds the remainder of any files. I spent a good amount of time making it add files with unicode/utf-8 chars, and spaces, and goofy characters, and it all works!

Next, defaultaudioplayer script, located /usr/local/bin, and as an added bonus this is the same code for the Add to Audiolung Queue script located in ~/.config/rox.sourceforge.net/OpenWith/.inode_directory :
Code:
#!/bin/sh
exec aqualung "$@"

Of course, aqualung2 is the name of the aqualung app itself, sitting in /usr/bin.

Thought I might share these and see what people (you, others?) think, and maybe contribute a bit more than requests to the whole puppy thing.


I have done some basic testing, and this looks like a very nice improvement, a big step toward making Aqualung usable. It prevents multiple instances of Aqualung starting everytime a sound file is clicked on.

I have implemented Gedrean's excellent fix, except named the startup script 'aqualung_wrapper' and left the executable as 'aqualung'.

Note:
One thing in Aualung that seems so unintuitive to me: if you have a playlist, click on one file in the list to highlight it, then click the 'Play' button, wouldn't it be nice if just that file played? (and not the whole lot)

UPDATE:
I found a a later post from Gedrean, a different script to fix a problem when defaultaudioplayer is called from streamtuner.
However, I have found showstopper problems with both scripts. The second one, files no longer played (aqualung did not even start) when I clicked on a sound file in Rox.

So, I have rolled back to the previous aqualung package, not using Gedrean's fix.


Posted on 10 Oct 2009, 9:46


Comments:

Posted on 12 Oct 2009, 3:27 by Gedrean
Showstopper?
I was unaware of any showstopping bugs therein.

The newer version of the script was required to make streamtuner add the files and make aqualung autoplay most other things - but streamtuner streams won't autoplay due to Aqualung not autoplaying on an M3U open or add.

I'd love to find out what these bugs are doing on your machine so I can update this script -- to be honest I was kinda amazed/thrilled to see my name mentioned in one of your blog entries so I'd like to try to fix this. :)


Posted on 12 Oct 2009, 8:11 by BarryK
Aqualung
Gedrean,
Appreciate your work -- yes, you are so close to having it working nicely.

I can't remember the exact details right now, of what the problems were with either way of launching aqualung. I didn't want to play around with it any further as was just focused on get 431 out.

I think though, both ways are correct in certain circumstances, so the 'aqualung_wrapper' script could have both. It can test for the circumstance, like called from rox, or whatever, then launch the 'aqualung' executable in the most appropriate way.

Note, I prefer to have the script as a different name 'aqualung_wrapper' and leave the main binary executable name alone.
It is easy enough in the aqualung PET package to set the 'defaultaudioplayer' to launch 'aqualung_wrapper'.



Posted on 18 Oct 2009, 24:24 by Gedrean
Aqualung
The name is fine, don't care either way. :) I think your idea is good, I just was pretty sure I'd covered all the bases so if I can get some sort of details later (it doesn't have to be right now, I'm kinda engrossed in making pcompile a bit spiffier so I'm not by any means bored ;) Any time you want to, drop a PM to me in forum or an email through that, and I should be able to work it out to make Aqualung beautiful. :) I honestly have to say I like it more than pmusic or other players, and I don't mean to trash on pmusic, but I never could get it to actually play anything reliably. About 2/3 of the time it would load the MP3 file to playlist, or add from it's "super-fast database" but it wouldn't actually play at all. Aqualung on the other hand hasn't had a single issue for me, and I don't recall any crashes...

Anyhow, lemme know. Have fun.:)