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 20 Sep 2014, 02:16
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
minimp3 source code
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 3 [40 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
disciple

Joined: 20 May 2006
Posts: 6435
Location: Auckland, New Zealand

PostPosted: Fri 03 Sep 2010, 02:01    Post subject:  

Quote:
Impact not discernible with htop (in cache?)

That's why I didn't try to compare it myself Wink

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Fri 03 Sep 2010, 06:52    Post subject:  

disciple wrote:
Quote:
Impact not discernible with htop (in cache?)

That's why I didn't try to compare it myself Wink


Hey.. there's a difference; this is for the high quality mini using gnu libc and libm.

mpg321: 55M 6% CPU
minimp3: 48M 2% CPU
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Sun 05 Sep 2010, 09:07    Post subject:  

Any chance to include support for .au and .wav-play? Think both can just be send to /dev/audio or /dev/dsp via cat but might not play all files correct though...
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Sun 05 Sep 2010, 15:16    Post subject:  

goingnuts wrote:
Any chance to include support for .au and .wav-play? Think both can just be send to /dev/audio or /dev/dsp via cat but might not play all files correct though...


I can't code it but if you can point me to a small standalone example(s), I may be able to hack it in there. I'd also need a C example to parse the file extension.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Tue 07 Sep 2010, 01:04    Post subject:  

I found wavplay, but it needs a lot of hacking down - still contains quite some bloat, but I compiled it statically against dietlibc if anyone wants it.

http://sourceforge.net/projects/wavplay/files/

edit: bplay is a little better size wise and plays other formats too
bplay.tar.gz
Description 
gz

 Download 
Filename  bplay.tar.gz 
Filesize  30.22 KB 
Downloaded  336 Time(s) 
wavplay.tar.gz
Description 
gz

 Download 
Filename  wavplay.tar.gz 
Filesize  18.86 KB 
Downloaded  367 Time(s) 

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Sat 25 Sep 2010, 10:48    Post subject:  

Thanks for the new small players! Tried to compile your modified minimp3 using ulibc - seems to work ok - but size is huge 44K.
minimp3-ulib_static.tar.gz
Description  minimp3-ulib_static 44K
gz

 Download 
Filename  minimp3-ulib_static.tar.gz 
Filesize  25.59 KB 
Downloaded  316 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Sat 25 Sep 2010, 12:22    Post subject:  

it only adds about 20kb to busybox if you compile statically against static uclibc (using CFLAGS="-ffunction-sections -fdata-sections ...:" and LDFLAGS="-Wl,...,--gc-sections,... ")

I submitted the patch to the busybox mail list and Denys Vlasenko sent me some tips for shrinking the size even further. I will post the tarball with the patch and notes from Denys. So far I haven't been able to do much more than the formatting without breaking the build.
minimp3-busybox-patch.tar.gz
Description  extract in your busybox source root and run: patch -p0 <....patch
gz

 Download 
Filename  minimp3-busybox-patch.tar.gz 
Filesize  24.73 KB 
Downloaded  317 Time(s) 

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sat 25 Sep 2010, 13:51    Post subject:  

Where is busybox source stored? Thanks

edit: I guess I could just download 1.16.2 from icewalkers.
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Sat 25 Sep 2010, 16:00    Post subject:  

it was diffed against the latest stable shortly after its release:
http://busybox.net/downloads/busybox-1.17.2.tar.bz2
Ffor continuity it is best to try applying against master:
http://git.busybox.net/busybox/snapshot/busybox-master.tar.bz2
or at least the latest snapshot:
http://busybox.net/downloads/snapshots/busybox-snapshot.tar.bz2

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Fri 12 Nov 2010, 01:42    Post subject:  

technosaurus wrote:
...it but if you can point me to a small standalone example(s), I may be able to hack it in there. I'd also need a C example to parse the file extension.


Attached small application that find file extension and launch minimp3, wavplay or play .au directly. Could be done by script...

bplay have some code that determines file-extension but I do not understand how - else bplay merged with minimp3 could be a more complete player (if size still could be small).

Update: Refined (...?) the code, added multi player capabilities - just through all your audio files to the launcher and they will play. Also included a much smaller static binary compiled using diet-lib (9K). Do not use spaces in filename - working on this bug...

Still not very useful compared to a simple script...but fun to sniff to C-coding...
Another (last) update: Now works with file-names containing spaces.
launcher_example_C.tar.gz
Description  Updated (3vers.) example program written in C to determine file extension and launch wavplay, minimp3 or play .au-files directly
gz

 Download 
Filename  launcher_example_C.tar.gz 
Filesize  7.97 KB 
Downloaded  289 Time(s) 

Last edited by goingnuts on Sat 13 Nov 2010, 05:15; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Fri 12 Nov 2010, 03:23    Post subject:  

I forgot these functions that I have added to bashbox:
(doesn't work for _ALL_ files though)

Code:
play_au() { #just sends $@ to /dev/audio
cat $@ > /dev/audio
}

play_wav() { #just sends $@ to /dev/dsp
cat $@ > /dev/dsp
}

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Ibidem

Joined: 25 May 2010
Posts: 489
Location: State of Jefferson

PostPosted: Sun 15 Apr 2012, 21:44    Post subject: Test w/musl libc...  

Yes I know this thread is old--but I thought I'd rather not steal the pupngo thread.

Here's the sizes when built with musl libc and stripped:
Code:
-rwxr-xr-x 1 ibid ibid 46028 2012-04-15 18:28 minimp3-musl
-rwxr-xr-x 1 ibid ibid 33724 2012-04-15 18:28 minimp3-musl,os
-rwxr-xr-x 1 ibid ibid 42944 2012-04-15 18:28 minimp3-musl,s
-rwxr-xr-x 1 ibid ibid 29288 2012-04-15 18:28 minimp3-musl.upx

musl,os : built with -Os
musl,s: built with -static -Os
musl: unoptimized, dynamically linked
musl.upx: musl,s after upx --best

All of them sound decent (close to mpg123)
RSS ~1MB, CPU 4%.

(Built on Ubuntu Lucid)
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Mon 16 Apr 2012, 15:02    Post subject:  

Attached slightly modified source - accept command -q for silent run (like mpg123). Build static with diet libc:
Code:
-rwxr-xr-x 1 root root 40084 2012-04-16 20:59 minimp3

Build static with uclibc:
Code:
-rwxr-xr-x 1 root root 47116 2012-04-16 21:04 minimp3
minimp3_source_mod.tar.gz
Description  modified to accept command line -q for silent run
gz

 Download 
Filename  minimp3_source_mod.tar.gz 
Filesize  34.09 KB 
Downloaded  200 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Ibidem

Joined: 25 May 2010
Posts: 489
Location: State of Jefferson

PostPosted: Mon 16 Apr 2012, 20:26    Post subject:  

Code:

musl-gcc -pipe -Os -mtune=i686 -static -s -ffunction-sections -fdata-sections -D_XOPEN_SOURCE -Wl,--gc-sections -finline-functions-called-once -fmerge-all-constants -fexpensive-optimizations -fomit-frame-pointer -fpeephole2 -fno-loop-optimize -momit-leaf-frame-pointer minimp3.c

gives 40736 bytes; stripped is 40588 bytes
49183 bytes built with -Os -static -D_XOPEN_SOURCE and unstripped, so that's a tiny bit larger than uclibc.
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Tue 17 Apr 2012, 11:21    Post subject:  

Ibidem: Thats a small difference in size - I think I will start looking more close on the musl!

The mpg123 seems to compile easy with diet (a small diff and build script attached). It gives a 212K static bin. Wonder at what size musl will do that?

Tried to use the latest mpg123 ("mpg123-1.13.8") - it compiled but did have issues playing mp3. Then went for mpg123-1.13.4 which also compiles and on top of that actually plays mp3.

Also did a quick test with mpg321 but that seems harder to patch for diet libc.

While surfing I found this page with some nice instructions for streaming mp3 and a poor mans skype... Smile

Might be that the minimp3 could also be hacked to play URL playlists? The mpg123 can play internet radio by issuing the following command:
Code:
mpg123 -@ http://players.creacast.com/creacast/classique/playlist.pls
mpg123-1.13.4_diet_build_tools.tar.gz
Description  patch and buildscript for diet libc compiled mpg123
gz

 Download 
Filename  mpg123-1.13.4_diet_build_tools.tar.gz 
Filesize  653 Bytes 
Downloaded  186 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 2 of 3 [40 Posts]   Goto page: Previous 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0819s ][ Queries: 13 (0.0051s) ][ GZIP on ]