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 25 Oct 2014, 01:59
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 Posts_count   Goto page: Previous 1, 2, 3 Next
Author Message
disciple

Joined: 20 May 2006
Posts: 6449
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: 781

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_website 
technosaurus


Joined: 18 May 2008
Posts: 4353

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: 4353

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  344 Time(s) 
wavplay.tar.gz
Description 
gz

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

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

Joined: 07 Dec 2008
Posts: 781

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  323 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
technosaurus


Joined: 18 May 2008
Posts: 4353

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  321 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: 4353

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: 781

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  298 Time(s) 

Edited_times_total
Back to top
View user's profile Send_private_message Visit_website 
technosaurus


Joined: 18 May 2008
Posts: 4353

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: 501
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: 781

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  209 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
Ibidem

Joined: 25 May 2010
Posts: 501
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: 781

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  192 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 2 of 3 Posts_count   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:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0941s ][ Queries: 13 (0.0174s) ][ GZIP on ]