Rockbox Technical Forums

Third Party => Unsupported Builds => Topic started by: gama on July 13, 2022, 03:31:05 PM

Title: [SHARE] Chiptune codecs collection (and Android port).
Post by: gama on July 13, 2022, 03:31:05 PM
Hi,  I would like to drop here a link of my private rockbox repo, which contains a set of new videogame music codecs I have been working on during the past months, along with the android changes I uploaded to the rockbox tracker (https://www.rockbox.org/tracker/task/13339).

If anyone is interested feel free to take a look at the sources and make a build on your own.
I have not tested other targets other than Android and simulator.  I use WSL2 in Windows 10, more about this in the tracker link above.

The codecs I worked on are:

  - Update Game_Music_Emu codecs to latest version from kode54 repo.
  - Added new SPC codec based on higan emulation by kode54.
  - Created a DUMB codec.
  - Created a sidplay fp codec by porting the whole sidplayfp library to c.
  - Created a UADE codec using a modified version of libuade.
  - Created a new VGM (s98) codec based on libvgm.
  - Created an sc68 codec based on sc68 library.
  - Created a PSF codec based on libupse.
  - Created a GSF codec based on viogsf.

All these codecs need too much ram (more than 64 MB), and some rely on multi threading to play fine.  So some changes to the codec api where made and I used the tlsf library for dynamic memory allocation.

That is why I created them specifically with the Android port in mind and decided to not upload a patch to the tracker.

If anyone is interested in building the code or talking about the codecs,  feel free to send me a pm or contact me through mail.

The sources link: https://drive.google.com/file/d/1lH0pp681STNhFfz4_qQ8XkmU_Qp9u1nF/view?usp=sharing
                         
1920x1080 apk: https://drive.google.com/file/d/1G_0kraTAlhn1AuidKnzfOPlMnS4m_6Fz/view?usp=sharing
1280x800 apk: https://drive.google.com/file/d/1xNCeI7G9Nj0Mb41k0YBXZyyKv3XyFJaN/view?usp=sharing
Codecs additional data files: https://drive.google.com/file/d/1Egk5xTu0bxWBDm2uoWrhTKRXxJW86iTZ/view?usp=sharing

[25/08/2022 UPDATE]
  - Created a MIDI codec based on foobar midi plugin.  It supports four midi engines: fluidsynth, mt32, adlmidi and opnmidi.
  - Added a Codec Settings menu to manage different codec settings.  Especially useful for the MIDI codec.

[15/09/2022 UPDATE]
  - Created a USF codec based on lazyusf2.
  - Created a SSF/DSF codec based on HighlyTheoretical
  - Created a PSF2 codec based on HighlyExperimental
  - Created a 2SF codec based on vio2sf
  - Created a vgmstream codec.
  - Removed multithread implementation of XSF and UADE codecs.  So it will be much easier to port them to other targets if they have sufficient RAM.
  - Added several new settings in codecs menu.

[20/10/2022 UPDATE]
  - Updated VGMSTREAM codec and added external libraries.
  - Fixed MIDI codec Sysex dumps support.
  - Added more configuration settings for CODECS.
  - Updated ASAP codec with latest version.
  - Updated japanese language file.

I really hope that any of these codecs, specially the MIDI one, gets to the official release.  The same for the Android port.

I can't invest more time to create individual patches of them so if anyone is interested in working on doing it, I can gladly give indications
on how to isolate a codec and create a patch for the tracker.  Please feel free to contact me if anyone is interested.

You can find [not so] updated android builds in the build-android and build-lenovo folders of previous uploads.

Long live to rockbox :).
gama (gama.coder@gmail.com).
Title: Re: [SHARE] Chiptune codecs collection (and Android port).
Post by: Milardo on July 14, 2022, 09:48:48 PM
Hi,  I would like to drop here a link of my private rockbox repo, which contains a set of new videogame music codecs I have been working on during the past months, along with the android changes I uploaded to the rockbox tracker (https://www.rockbox.org/tracker/task/13339).

If anyone is interested feel free to take a look at the sources and make a build on your own.
I have not tested other targets other than Android and simulator.  I use WSL2 in Windows 10, more about this in the tracker link above.

The codecs I worked on are:

  - Update Game_Music_Emu codecs to latest version from kode54 repo.
  - Added new SPC codec based on higan emulation by kode54.
  - Created a DUMB codec.
  - Created a sidplay fp codec by porting the whole sidplayfp library to c.
  - Created a UADE codec using a modified version of libuade.
  - Created a new VGM (s98) codec based on libvgm.
  - Created an sc68 codec based on sc68 library.
  - Created a PSF codec based on libupse.
  - Created a GSF codec based on viogsf.

All these codecs need too much ram (more than 64 MB), and some rely on multi threading to play fine.  So some changes to the codec api where made and I used the tlsf library for dynamic memory allocation.

That is why I created them specifically with the Android port in mind and decided to not upload a patch to the tracker.

If anyone is interested in building the code or talking about the codecs,  feel free to send me a pm or contact me through mail.

https://drive.google.com/file/d/18SLmbBHd3_sK-WGkhmiWdnkf8vtyKOEG/view?usp=sharing

Long live to rockbox :).
gama (gama.coder@gmail.com).

Hi gama,

Do you have a precompiled rockbox android build I can try? I can also compile too, if you have complete and clear instructions, thanks in advance.
Title: Re: [SHARE] Chiptune codecs collection (and Android port).
Post by: amachronic on July 15, 2022, 07:41:19 AM
...

You've put a lot of effort into this, and IMHO it'd be a shame not to pick up these changes. However, it's going to be very hard to integrate them in the official repo if you do them as a single mega-patch.

Changes to core code, ie. stuff under firmware/ and parts of apps/, need to be reviewed more carefully to make sure they won't cause problems on other devices. If you can roughly split up those changes into smaller patches with a well-defined purpose (this adds XXX... this is a bugfix for YYY...) that would make it much easier to review and merge. This includes any changes to the codec API.

Codecs are fine to take wholesale, but I'd prefer to split them up into one patch per codec. It's okay if they don't run on all targets. Using TLSF in codecs is also fine, some codecs already use it.

I have no experience with the Android port so I'm afraid I can't help much there, but I think once you split the supporting changes out, the truly Android-specific stuff that's left will be small and manageable.
Title: Re: [SHARE] Chiptune codecs collection (and Android port).
Post by: gama on July 15, 2022, 07:56:18 AM
Hi gama,

Do you have a precompiled rockbox android build I can try? I can also compile too, if you have complete and clear instructions, thanks in advance.

Yes I was planning to add a link to a couple of files.  I only have precompiled apks for two Android resolutions: 1920x1080 and 1280x800 though.
I will update the original post with the links soon.
Title: Re: [SHARE] Chiptune codecs collection (and Android port).
Post by: gama on July 15, 2022, 08:04:46 AM

You've put a lot of effort into this, and IMHO it'd be a shame not to pick up these changes. However, it's going to be very hard to integrate them in the official repo if you do them as a single mega-patch.

Changes to core code, ie. stuff under firmware/ and parts of apps/, need to be reviewed more carefully to make sure they won't cause problems on other devices. If you can roughly split up those changes into smaller patches with a well-defined purpose (this adds XXX... this is a bugfix for YYY...) that would make it much easier to review and merge. This includes any changes to the codec API.

Codecs are fine to take wholesale, but I'd prefer to split them up into one patch per codec. It's okay if they don't run on all targets. Using TLSF in codecs is also fine, some codecs already use it.

I have no experience with the Android port so I'm afraid I can't help much there, but I think once you split the supporting changes out, the truly Android-specific stuff that's left will be small and manageable.

Thanks for your reply amachronic.

Unfortunately the code is kind of a mess right now :S, and takes me a lot of time to create a patch from it. 
But I will try to when I have some time.
Title: Re: [SHARE] Chiptune codecs collection (and Android port).
Post by: gama on August 25, 2022, 04:36:59 PM
Hi, just a heads up.  I updated the original post with a new codec.
Title: Re: [SHARE] Chiptune codecs collection (and Android port).
Post by: speachy on October 02, 2023, 10:11:52 AM
Hi, just a heads up.  I updated the original post with a new codec.

These links are all dead now; is there any chance they could be re-posted?
Title: Re: [SHARE] Chiptune codecs collection (and Android port).
Post by: amachronic on October 02, 2023, 02:36:38 PM
I have two archives, dated July 13th and October 20th, on my hard drive still. I can upload them tomorrow -- internet at home is way too slow.
Title: Re: [SHARE] Chiptune codecs collection (and Android port).
Post by: amachronic on October 04, 2023, 05:18:07 AM
Here they are:
rockbox_2022-10-20.7z (https://drive.google.com/file/d/1IZz3OygOqsBAyI85fj8yQlX6ed7ndgWb/view?usp=sharing)
rockbox_2022-07-13.7z (https://drive.google.com/file/d/14cH5tWpOZBUGVkg2jxmXdAl9D3hcgLXu/view?usp=sharing)

I had a look into them the other night, but there's a lot to get through to pick out the Android specific parts.
Title: Re: [SHARE] Chiptune codecs collection (and Android port).
Post by: speachy on October 04, 2023, 07:46:59 AM
Yow, a combined total of 1.3GB...

Done downloading; thank you!
Title: Re: [SHARE] Chiptune codecs collection (and Android port).
Post by: amachronic on October 04, 2023, 12:02:29 PM
So this is what I managed to achieve after culling the 10/20 archive -- patch to be applied on top of 19d95d7b56, 432K uncompressed. I think all the Android changes are in here, mixed in with some other stuff. I removed everything under lib/rbcodec, a bunch of data files, PNGs, and new wps files. Definitely not going to compile, but it's a start.

(.bin extension is just there to make the forum happy.)