That's why I didn't try to compare it myselfImpact not discernible with htop (in cache?)
minimp3 source code
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
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.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...
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
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
http://sourceforge.net/projects/wavplay/files/
edit: bplay is a little better size wise and plays other formats too
- Attachments
-
- bplay.tar.gz
- (30.22 KiB) Downloaded 662 times
-
- wavplay.tar.gz
- (18.86 KiB) Downloaded 674 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
Thanks for the new small players! Tried to compile your modified minimp3 using ulibc - seems to work ok - but size is huge 44K.
- Attachments
-
- minimp3-ulib_static.tar.gz
- minimp3-ulib_static 44K
- (25.59 KiB) Downloaded 638 times
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
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.
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.
- Attachments
-
- minimp3-busybox-patch.tar.gz
- extract in your busybox source root and run: patch -p0 <....patch
- (24.73 KiB) Downloaded 607 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
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 ... er.tar.bz2
or at least the latest snapshot:
http://busybox.net/downloads/snapshots/ ... ot.tar.bz2
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 ... er.tar.bz2
or at least the latest snapshot:
http://busybox.net/downloads/snapshots/ ... ot.tar.bz2
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
Attached small application that find file extension and launch minimp3, wavplay or play .au directly. Could be done by script...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.
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.
- Attachments
-
- launcher_example_C.tar.gz
- Updated (3vers.) example program written in C to determine file extension and launch wavplay, minimp3 or play .au-files directly
- (7.97 KiB) Downloaded 582 times
Last edited by goingnuts on Sat 13 Nov 2010, 09:15, edited 3 times in total.
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
I forgot these functions that I have added to bashbox:
(doesn't work for _ALL_ files though)
(doesn't work for _ALL_ files though)
Code: Select all
play_au() { #just sends $@ to /dev/audio
cat $@ > /dev/audio
}
play_wav() { #just sends $@ to /dev/dsp
cat $@ > /dev/dsp
}
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
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:
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)
Here's the sizes when built with musl libc and stripped:
Code: Select all
-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,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)
Attached slightly modified source - accept command -q for silent run (like mpg123). Build static with diet libc:
Build static with uclibc:
Code: Select all
-rwxr-xr-x 1 root root 40084 2012-04-16 20:59 minimp3
Code: Select all
-rwxr-xr-x 1 root root 47116 2012-04-16 21:04 minimp3
- Attachments
-
- minimp3_source_mod.tar.gz
- modified to accept command line -q for silent run
- (34.09 KiB) Downloaded 508 times
Code: Select all
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
49183 bytes built with -Os -static -D_XOPEN_SOURCE and unstripped, so that's a tiny bit larger than uclibc.
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...
Might be that the minimp3 could also be hacked to play URL playlists? The mpg123 can play internet radio by issuing the following command:
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...
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: Select all
mpg123 -@ http://players.creacast.com/creacast/classique/playlist.pls
- Attachments
-
- mpg123-1.13.4_diet_build_tools.tar.gz
- patch and buildscript for diet libc compiled mpg123
- (653 Bytes) Downloaded 473 times
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
I looked into doing poor mans voip this way but hit a brick wall when looking for a way to get the non.local IP address ... needed some external server like dyndns but I never solved it ... only tested locally with local IPs using ffmpeg... still I like the Unix philosophy of tools doing 1thing well and using them together liberally rather than reinvent existing code every time you need to combine 2+ functions. ... for instance you can use netcat, SSH, telnet, dropbear... instead of bolting their capabilities into a program so it can work over the net.goingnuts wrote:
While surfing I found this page with some nice instructions for streaming mp3 and a poor mans skype...
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: Select all
mpg123 -@ http://players.creacast.com/creacast/classique/playlist.pls
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
I've done the mpg123 internet radio thing a bit. It's nice and simple.goingnuts wrote: 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...
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: Select all
mpg123 -@ http://players.creacast.com/creacast/classique/playlist.pls
But I'd advise not trying to add netwirking--mpg123 is the undisputed King of the Hill there, you'll add a good bit of bloat, and you can probably do it via curl <url>|minimp3 - or such anyhow... (I assume that minimp3 supports stdin as a file?)
And FWIW-pls is not an mp3, so you'd have to implement a pls parser...best done in shell script.
Don't bother with mpg321-it was relevant several years ago, but IIRC current mpg123 has improved decoding on sub-pentium machines (which was the only reason to use mpg321).
mpg123, 1.13.4:goingnuts wrote: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.
274612 bytes stripped, statically linked, stripped, compiled with -Os, using OSS audio only.
No other tricks involved except getting the Linux headers included, and building with -D_GNU_SOURCE.
This is upstream source, unpatched. Plays streaming mp3 fine.
In the FWIW department:
All these numbers are with a stock musl, including full UTF8 and everything else...Rich Felker says
I would believe that it's possible to get smaller binaries with a
uClibc that's had lots of features turned off when the library was
built, meaning that those features are completely unavailable to
applications. On the other hand, I suspect musl will easily beat
uClibc in static linking size when uClibc is full-featured (UTF-8,
pthread, full malloc, stdio, hex floats in printf, ...) because musl
takes a lot more care not to have unnecessary cross-dependency between .o files in the static lib. Still, some things are impossible to
optimize out with the linker - for example, printf always pulls in a
minimum amount of UTF-8 conversion code for %ls and %c.
Ibidem: With my uclibc (uClibc-0.9.27) I can get it down to 304K static/striped/oss only.
Tried to use musl-0.8.10 (compiled by "make" and installed by "new2dir make install")
Compiling mpg123 with musl was not 100 % successful:
Had to comment out #undef HAVE_MMAP in mpg123´s config.h.in to get mpg123 compiled and ended up with approx. 346K static/stripped bin. But it would not play...D...!
I will keep practice the musl though...
Any chance you could provide a musl-pet/sfs? Or maybe some examples of howto build simple things?
Tried to use musl-0.8.10 (compiled by "make" and installed by "new2dir make install")
Compiling mpg123 with musl was not 100 % successful:
Had to comment out #undef HAVE_MMAP in mpg123´s config.h.in to get mpg123 compiled and ended up with approx. 346K static/stripped bin. But it would not play...D...!
I will keep practice the musl though...
Any chance you could provide a musl-pet/sfs? Or maybe some examples of howto build simple things?
1. Compile and install musl, preferably from git head (a release is a tag, not a branch, so all fixes are in git).
Copy config.mak from dist/ and adjust as you want.
PREFIX defaults to /usr/local/musl, and should not be set to /, /usr, or /usr/local (or you will kill your OS)
2. Get the linux kernel headers (linux-libc-dev, not the ones for building modules) and put them somewhere (I use /opt/musl/lin)
There should be a linux/ directory in there.
3. export CC=musl-gcc; export CFLAGS="-Os -static -fno-stack-protector -I/opt/musl/lin -D_GNU_SOURCE"
Don't forget the -D_GNU_SOURCE - most stuff won't build without that, though some will. -I/... should point to the linux headers.
(Note-the linux headers are needed for OSS and a lot besides)
4. Now run configure and make.
That's all that I know is needed.
Copy config.mak from dist/ and adjust as you want.
PREFIX defaults to /usr/local/musl, and should not be set to /, /usr, or /usr/local (or you will kill your OS)
2. Get the linux kernel headers (linux-libc-dev, not the ones for building modules) and put them somewhere (I use /opt/musl/lin)
There should be a linux/ directory in there.
3. export CC=musl-gcc; export CFLAGS="-Os -static -fno-stack-protector -I/opt/musl/lin -D_GNU_SOURCE"
Don't forget the -D_GNU_SOURCE - most stuff won't build without that, though some will. -I/... should point to the linux headers.
(Note-the linux headers are needed for OSS and a lot besides)
4. Now run configure and make.
That's all that I know is needed.