Shrink the Puppy iso using Pmusic....

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

Shrink the Puppy iso using Pmusic....

#1 Post by zigbert »

The last 8 months Pmusic development has been targeting THIS cutting edge.

I have been looking at how Puppy is putting together audio-tools, and found that there is a lot of space to save - if Pmusic could do some more. Now it can, but maybe still in beta stage. Recent versions of Pmusic has been focused on podcast/tagging/CD-audio. Version 1.8.0 introduce a decent CD-audio player and ripper, without using new dependencies. Other Rippers/tools uses dependencies we now can get rid of. - and that is a lot.


Let's go. I am talking like this is the truth, but I might be wrong in my assumptions. Please correct me. All sizes is compressed and found in the Wary repo.
~ Pmusic now rip audio-CD, so we can skip Asunder (45kb) and Pcdripper (13kb). Pcdripper is not found in Wary, but still in Lupu and Spup.
~ Pcdripper and Asunder uses cdparanoia (69kb) for saving cd-tracks. Pmusic uses only cdda2wav for this. I can not find other programs using cdparanoia.
~ Asunder is the only app using libcddb (30kb). - Not completely true, since libcdio uses it optional. We'll get back to this later.
~ Asunder also uses vorbistools (47kb). Be aware that this is something different than libvorbis which ffmpeg and mplayer use.
~ Pmetatagger (12kb) also uses vorbistools, but I don't think we will miss pmetatagger, since Pmusic now tags much better (my very personal opinion). What Pmetatagger does (in contrast to Pmusic) is tagging flac files.
~ The last app using vorbistools is Precord, but I am sure there is a better solution in recoding ogg with 'arecord | ffmpeg -i pipe:0 -f au -o "/path/file.ogg"'. This would get support of many more formats.
~ Next pack is Flac (220kb), and it surprised me that Pmusic would play flac files without this. I was thinking that ffmpeg used it...... But obviously not. The Flac package is used by Asunder, vorbistools, pmetatagger and sdl_mixer. I will discuss sdl later.
~ vorbistools take advantage of libao (45kb). I can not see that others use this lib.
~ pCD (5kb) was once developed because I couldn't get a low-resource CD-playback inside the Pmusic structure. Now this is fixed, and the Pmusic 1.8.0 has a unique .desktop file for 'CD player/ripper'. This goes straight to a CD-gui. - A nice way to use the dynamic gui-system in Pmusic.
~ PPG (19kb) (puppy podcast grabber) is our podcast manager, but it lacks features as scheduling. - Auto-download new podcasts at a given time. You'll find this feature in Pmusic.
~ Madplay (30kb) is a commanline player for mpeg audio streams. The normalize-mp3 script uses madplay, but I can't find any apps using nomalize-mp3. In fact, it is not brilliant. All it does is decoding mp3/ogg - then normalize (only supports wav) - and encoding back. This require enormous amounts of free disc space, since ALL files need to be hold in raw format during normalize.
~ The Normalize package is used by 'audiofile' and Pburn, so it is valuable to keep, but the nomalize-mp3 script could be removed together with madplay. Madplay could be linked to 'pmusic -B' which will play mpeg audio as well. pmusic -B is a very lightweight solution for the commandline.
~ Wavplay (14kb) does mostly the same as aplay. aplay is a part of the alsa package and it handles piping from stdin which wavplay doesn't. There is one script using wavplay: /usr/sbin/video-wizard - line 150.
~ Puppy 5.2.5 got libmusicbrainz (117kb). Pmusic calls musicbrainz.org directly. musicbrainz.org offers a webxml format that is a nice resource for extended music information.


Ok, this was straight foward. What we loose is support of flac metatags and Precord needs to point ogg-recording to an alternative (maybe as told above). What we get is 538kb (compressed) less weight in the Wary iso. Lupu would save even more 130kb


now, let's look deeper.
~ libcdio (147kb) is used by mplayer and vcdimager (and cdparanoia). Mplayer uses this for CD-audio playback. If we let Pmusic handle this, mplayer can be compiled without libcdio.
~ Vcdimager (143kb) is the backend to burn (S)VCD - CD video dics. Because of usb-pendrives, burning has become more rare, and burning VCD even more rare. I suggest that vcdimager is removed from the iso, and I add a message in Pburn: 'To burn VCD, you need vcdimager. Please install from the package manager.'
~ When we are talking about Pburn, I will mention that Pburn uses very few dependencies. The cdrkit package contains much more than Pburn needs. Pburn does NOT use: cdda2mp3, cdda2ogg, dirsplit, pitchplay, readcd, readmult, readom. All together approximately 85kb.
~ As told above, the sdl_mixer package has 'Flac' as a dependency. I have suggested to remove Flac, so sdl_mixer (56kb) should go too, or be recomiled without flac support. The loss is minor. It is only the sdl-games that uses this. afternoonstalker (92kb), burgerspace (130kb), cosmosmash (70kb), batrachians (102kb) and maze-rays (15kb)
~ Now when the games had to go, we can remove their other unique dependencies. sdl_image (18kb), sdl_ttf (11kb), flatzebra (16kb). Barry has proved before that fun and addictive games can be added without including new dependencies.


That is another 902kb, and we have not mentioned the graphics like wallpapers and icons. I don't intend to do this here, since it is obvious (and a matter of taste). But as a reminder, it is good to know that written code is compressed to a third of its size in the iso. Png and jpg images are already compressed, so shrinking graphics will affect the iso size much more than codelines.


At last I have 2 notes.
~ Ptooltips (1kb) are still in Wary. Only 1 kb, but there is no use of it after potong told us about the tooltip-text attribute in gtkdialog.
~ The sdl (158kb) library is rather new in the Puppy iso (Puppy 4 did not include this lib). So, why is it here?. I guess the the main reason is because mplayer uses it for visualization. I wonder if this could be compiled without? (together with earlier mentioned libcdio). Else I find that libtheora uses it - WHAT - I video codec using sdl? - for what reason?. ffplay (part of ffmpeg) uses sdl for visualization. Earlier, ffplay was skipped, and I don't see any new use of ffplay. This might change in the future, if we get the ability to switch from from a bloated mediaplayer like mplayer/xine/vlc to a dedicated audio-player, DVD-video-player and ffplay for video-streams. At this stage it lacks a lot (web-streaming, embedded view...).


All in all, these changes (if doable) will shrink the Puppy iso by about 1,5 Mb.


Thanks for listening
Sigmund

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#2 Post by nooby »

Thanks Ziggy, good that you are at it.
I use Google Search on Puppy Forum
not an ideal solution though

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Re: Shrink the Puppy iso using Pmusic....

#3 Post by mcewanw »

zigbert wrote: I have been looking at how Puppy is putting together audio-tools, and found that there is a lot of space to save
...
~ Asunder also uses vorbistools (47kb). Be aware that this is something different than libvorbis which ffmpeg and mplayer use.
...
~ The last app using vorbistools is Precord, but I am sure there is a better solution in recoding ogg with 'arecord | ffmpeg -i pipe:0 -f au -o "/path/file.ogg"'. This would get support of many more formats.
...
Thanks for listening
Sigmund
As ldd command indicates, oggenc relies on libvorbis and libogg as does the Wary 5xx compile of ffmpeg.

Your suggested encode line:

Code: Select all

record | ffmpeg -i pipe:0 -f au -o "/path/file.ogg"
isn't correct I think. -f au tells it to record the .ogg file as Sun audio as far as my tests tell me and there shouldn't be a "-o" above.

However, if the Puppy install could do away with oggenc altogether, and just use ffmpeg, that would indeed save a few tens of kB so I tried, as a working example:

Code: Select all

arecord -f cd | ffmpeg -i pipe:0 -acodec libvorbis -aq 60 "path/file.ogg"
But on my PIII 500MHz Puppy Wary 500 system the recording didn't start immediately. There was an unacceptable-to-me start recording delay of around eight seconds...

I compared the above ffmpeg result with (just as a quick example):

Code: Select all


arecord -f cd | oggenc - -M 160 -o  "/path/file.ogg"

or

arecord -f cd | oggenc - -q 5 -o  "/path/file.ogg"
Using oggenc, there was negligible start up delay.

Perhaps there is a better way of using ffmpeg or perhaps it's just the overhead of using ffmpeg rather than the specialist oggenc that slows encoding down (maybe it is something to do with the use of pipe for stdin with ffmpeg - I don't know).

If, however, I find a suitable ffmpeg ogg encoding line (or someone else comes up with one) which works out as good as using oggenc (no start up delay) then of course I'll happily modify the relevant part of Precord accordingly. But until then I have no option but to stick with oggenc.

EDIT: I "could" use ffmpeg rather than oggenc even with the current limitation its exhibiting. It doesn't actually lose the eight seconds, just has a delay. The workaround would be an eight or ten seconds delay before allowing capture to end, but that is at the very least messy.
github mcewanw

User avatar
playdayz
Posts: 3799
Joined: Fri 25 Apr 2008, 18:57

#4 Post by playdayz »

I have suggested to remove Flac,
Hey zigbert, You are not suggesting to remove flac encoding and decoding capability are you? Most of my music collection is flac encoded. It has traditionally been the choice of audiophiles for non-lossy compression.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#5 Post by zigbert »

playdayz wrote:You are not suggesting to remove flac encoding and decoding capability are you?
You're right, I am not suggesting that. But as I stated above in the first post.
Next pack is Flac (220kb), and it surprised me that Pmusic would play flac files without this. I was thinking that ffmpeg used it..... But obviously not.
I am not the one to tell what is what. I am just sharing my thoughts and targets.


Sigmund

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#6 Post by greengeek »

Zigbert - you mention "normalising" the audio. I cannot find a normalise function in the various Puppy ripping programs, and many of my mp3s are so loud that they are distorted at times. What method do you recommend for normalising during ripping please? (thanks in advance)

scsijon
Posts: 1596
Joined: Thu 24 May 2007, 03:59
Location: the australian mallee
Contact:

#7 Post by scsijon »

Ziggy, if you really want to shrink the overall system, Find something smaller to replace Mplayer and all it's interlinking dependancies. I tried it in one of my Mage2 alphas and came up with nearly a wopping 10meg size reduction in the sfs, it's three main packages come to a total of 7.5meg.

Post Reply