This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#5241 - MOD player codec (not based on dumb)
Attached to Project:
Rockbox
Opened by Rainer Sinsch (myth) - Wednesday, 26 April 2006, 22:59 GMT+1
Last edited by Dave Chapman (linuxstb) - Monday, 03 March 2008, 22:37 GMT+1
Opened by Rainer Sinsch (myth) - Wednesday, 26 April 2006, 22:59 GMT+1
Last edited by Dave Chapman (linuxstb) - Monday, 03 March 2008, 22:37 GMT+1
|
DetailsThis is an experimental MOD player codec. It is based on an old open source module player for gravis ultrasound (unfortunately I forgot the name, if anyone finds out please inform me). I added a fast mixing routine and did a quick rockbox port. Yet the source is quite unpolished, but it plays fine on my h320.
Current features: * Plays startracker/protracker modules (4-8 Channels) * Unfortunately only modules up to 486kbytes (due to codec memory limitation) Song length calculation is not implemented (should be no real problem though) |
This task depends upon
Closed by Dave Chapman (linuxstb)
Monday, 03 March 2008, 22:37 GMT+1
Reason for closing: Rejected
Additional comments about closing: The original version of this patch can't be included in Rockbox due to the unclear license.
A written-from-scratch MOD codec released under the GPL is at http://www.rockbox.org/tracker/task/8680
Monday, 03 March 2008, 22:37 GMT+1
Reason for closing: Rejected
Additional comments about closing: The original version of this patch can't be included in Rockbox due to the unclear license.
A written-from-scratch MOD codec released under the GPL is at http://www.rockbox.org/tracker/task/8680
Apply the mod_v0.1.diff from above and replace the apps/codecs/mod.c with the new one
download experimental 2.4.17 with this patch
http://plugbox.rockbox-lounge.de/rockbox-2-4-17-mod.zip
http://plugbox.rockbox-lounge.com/rockbox-2-4-17-mod.zip
Ciao
Norb
Thanks a lot and all the best
Norbert
I have attached the patch I am using - I have moved all the mod stuff away from the end of the queue, so it doesn't constantly get out sync when new codecs are added.
Without any guarantees. ;)
I also implemented a crude form of seeking. It is done in the "pattern order" table, so the wps will display the the position in this table as current time and the size of the table as song length. As a result we get some sort of progress bar as well. Expect some funny effects, as some mods don't use the full table or use it out-of sequence with the effect 0x0b. Also set-tempo effects and such like may be skipped leading to a wrong speed of the mod. But better than no seeking at all, IMO.
While I was at it I changed it so it displays the mod type (number of channels) as the genre string.
$ patch -p0 < mod_v0.14.patch
patching file apps/codecs/Makefile
patching file apps/codecs/mod.c
patching file apps/codecs/SOURCES
patching file apps/metadata.c
patching file apps/tree.c
patching file firmware/export/id3.h
patching file firmware/id3.c
I fetched it from from csv today and get the following result:
[Code]
debian:/home/root/rockbox# patch -p0 < mod_v0.15.patch
patching file apps/codecs/Makefile
Hunk #1 FAILED at 48.
1 out of 1 hunk FAILED -- saving rejects to file apps/codecs/Makefile.rej
patching file apps/codecs/mod.c
patching file apps/codecs/SOURCES
patching file apps/metadata.c
Hunk #1 succeeded at 1764 (offset 50 lines).
Hunk #2 succeeded at 2342 (offset 50 lines).
patching file apps/filetypes.c
Hunk #1 succeeded at 67 (offset -37 lines).
patching file firmware/export/id3.h
patching file firmware/id3.c
[/Code]
Any ideas?
Thank you
Paul
"patching file apps/codecs/Makefile
Hunk #1 FAILED at 48.
1 out of 1 hunk FAILED -- saving rejects to file apps/codecs/Makefile.rej
patching file apps/codecs/mod.c
patching file apps/codecs/SOURCES
Hunk #1 FAILED at 12.
1 out of 1 hunk FAILED -- saving rejects to file apps/codecs/SOURCES.rej
patching file apps/filetypes.c
Hunk #1 FAILED at 67.
1 out of 1 hunk FAILED -- saving rejects to file apps/filetypes.c.rej
patching file apps/metadata.c
Hunk #1 FAILED at 293.
1 out of 1 hunk FAILED -- saving rejects to file apps/metadata.c.rej"
Am I doing something wrong? I put the patch into the rockbox folder - the same folder where I can see apps, docs, bootloader folders etc. and tried "patch --binary -p0 5241_20.txt"
Any help would be appreciated. I'd love to get this to work.
Thanks
and I take it the missing < is just an oversight
patch -p0 < 5241_20.txt
I appreciate your help and I'm sure anybody else reading this who is trying to do the same thing will also.
Cheers
Paul
"* Sequencer taken from Gravis Ultrasound open source mod player (forgot the name, if anyone finds out, please insert *g* )"
The general view is that we can't commit this to SVN and include in the official builds when the license to the source code is unknown - claiming that it was "open source' isn't enough. Can anyone identify the original mod player that the code in this codec comes from? Or failing that, maybe the sequencer could be replaced with one from a known (GPL-compatible) source?
(and a minor comment - my name shouldn't be the (C) holder in apps/metadata/mod.c)
ftp://ftp.scene.org/mirrors/hornet/code/audio/docs/fmoddoc.zip
"Legal Notice: This source is public domain. This code cannot be redistributed commercially, in any form whether source code or binary without the prior consent of the author."
IIUC, by placing a work in the public domain the author is relinquishing all legal rights to it, and hence can't dictate conditions on its use.
So I'm not sure if this helps us - we've moved from having no license, to having a nonsensical license...
I think the safest way is for someone to contact the author of fmod and ask for permission to use the code under a GPL-compatible license - i.e. one which doesn't prevent commercial use.
Just to make sure we don't have any future license issue.
First of all the good news:
- Fresh from my fingers and totally license free. Doesn't even make use of "magic tables".
- Support for more file formats (e.g. 15 instrument files)
- Improved mixing routine (sounds by far better!). There was a major bug in the old routine *g*
- Improved playing and effects handling (especially for chip-tunes)
Now the bad news (for now):
- It plays fine in the simulator, but does not on the real machine. I have yet no idea why this is so.
- Seems to have problems with some mod files (requires some more bugfixing)
- There are some enhanced effects (0xe) missing. I will add that later.
For installing simply apply the above patch and replace mod.c with the new one. I tried hard to include lots of comments, so help is welcome.
But I think it's a pity that you spent all this time rewriting from scratch and didn't follow the coding guidelines in docs/CONTRIBUTING...
Still to do:
- Effect bugfixing
- Adding the ID3 features / instrument name display from the old source
I still have issues with the coding style. Here is an excerpt from docs/CONTRIBUTING:
-----------------------------------------------------------------------------------
Identifiers
-----
We do not want mixed case identifiers.
Variables and function names should be all lower case.
Struct and enum names should be all lower case.
Preprocessor symbols and enum constants should be all upper case.
Comments
--------
We only use plain old /* C standard comments */.
If you want to comment out large blocks containing other comments, use #if 0.
Style
-----
When changing code, follow the code style of the file you are editing.
When writing new files, you may use the brace placement style of your choice.
Braces for function declarations are put in a new line under the name, as in:
int foo(char *name)
{
return FOO_NAME:
}
Always indent your code with four spaces. Don't use TAB characters, as that
will mess up code display in CVS, printing, and a zillion other places.
Keep lines below 80 columns length. Use whitespace and newlines to make the
code easy to browse/read.
-----------------------------------------------------------------------------------
I hope you decide to try to follow them, it would be a shame to miss out this new shiny codec because of that.
Regards,
Linus