Homebrew Development

Discussion in '3DS - Homebrew Development and Emulators' started by aliak11, Jan 16, 2014.

  1. zoogie

    zoogie simple pimp tool

    Member
    6,567
    8,446
    Nov 30, 2014
    United States
    That's a good estimate as far as full 1st party support, but "weak support" with occasional 3rd party games and firm updates, will probably go on for 2-3 more years.

    The idea with "EoL" is to release the exploit when Nintendo stops updating the firmware. That's a tricky thing to estimate as they never announce when they're ending support for firm updates.

    What I would do (if I believed in EoL releases) is to wait until the 3ds has stopped production. That way, anything you buy in a store or online should be on exploitable firmware.
     
    Last edited by zoogie, Nov 19, 2017
  2. Gamekiller78

    Gamekiller78 Member

    Newcomer
    11
    0
    Dec 4, 2016
    United States
    Plus dude soundhaxs was the bomb tho it made life with homebrew so easy.
     
  3. lone_wolf323

    lone_wolf323 GBAtemp Advanced Fan

    Member
    813
    270
    May 27, 2011
    Canada
    May not update much. But they will go bat crap crazy when any exploits release. And you seen the somewhat recent rpghax and flipnotestudio? They got shut down within hours of being released.
     
  4. zoogie

    zoogie simple pimp tool

    Member
    6,567
    8,446
    Nov 30, 2014
    United States
    Get a DS flashcard now and you'll never worry about being without homebrew again
    https://3ds.guide/ntrboot.html

    That's honestly the way to go. Good userland entrypoints are difficult to find and maintain.
     
  5. Gamekiller78

    Gamekiller78 Member

    Newcomer
    11
    0
    Dec 4, 2016
    United States
    Yeah you are right but some people are not gonna wanna sit easy waiting...ik a ton of people who pissed do to the fact they have to wait year or 2 or who knows 3 years.
     
  6. BARNWEY

    BARNWEY Legen-wait for it-dary

    Member
    1,271
    534
    Oct 11, 2016
    United States
    It's even easier now! If you have $20 ;)
     
  7. dpad_5678

    dpad_5678 GBAtemp's Memelord

    Member
    1,728
    1,274
    Nov 19, 2015
    United States
    It's not that hard? Oh okay, so can you do it then?
     
    GalladeGuy and Quantumcat like this.
  8. Gamekiller78

    Gamekiller78 Member

    Newcomer
    11
    0
    Dec 4, 2016
    United States
    Im not a coding genus i wish probably not
     
  9. PewnyPL

    PewnyPL GBAtemp Advanced Fan

    Member
    599
    263
    Feb 2, 2014
    Poland
    Then trust us when we say that it's in no way easy. The new soundhax has to use something completely different from the old one and if Nintendo patches that up, there is a huge chance that there are no bug lefts to use in the sound app to make a new one.
     
    BARNWEY and Quantumcat like this.
  10. Gamekiller78

    Gamekiller78 Member

    Newcomer
    11
    0
    Dec 4, 2016
    United States
    i could try actually but it might not work
     
  11. cracker

    cracker Nyah!

    Member
    3,173
    463
    Aug 24, 2005
    United States
    Even if a system is EOL or deader than dead it can be updated. Look at the Wii U with 5.3.2 being released so long after the browser hax, Haxchi. Or even better - the PSP getting a minor update after 4 years (one year after Sony officially killed it). Just saying...
     
    BARNWEY likes this.
  12. MyLegGuy

    MyLegGuy Moron

    Member
    541
    331
    Nov 26, 2014
    United States
    Are there any easy to use audio libraries that support OGG streams?
     
  13. cracker

    cracker Nyah!

    Member
    3,173
    463
    Aug 24, 2005
    United States
    Simple is a relative term. What platform are you targeting? There are so many takes on ogg decoders but without knowing what hardware you want to use it on there is no way to search for an easy solution for you.
     
  14. PewnyPL

    PewnyPL GBAtemp Advanced Fan

    Member
    599
    263
    Feb 2, 2014
    Poland
    Don't quote me on this, but I'm fairly sure he wants to use it on, you know, 3DS. Since this is the 3DS homebrew development section.
     
    MyLegGuy and Joel16 like this.
  15. MyLegGuy

    MyLegGuy Moron

    Member
    541
    331
    Nov 26, 2014
    United States
    Yeah, I was hoping for one already ported to the 3ds because I'm not experienced with audio enough to port one myself.

    By simple, I mean something like this C code I made up that's similar to SoLoud.
    Code:
    OggSound myGoodOggSound;
    OggStream myGoodOggStream;
    
    PlayHandle myPlayHandle1;
    PlayHandle myPlayHandle2;
    
    initAudio(OGG);
    
    loadSound(&myGoodOggSound,"sfx.ogg");
    loadStream(&myGoodOggStream,"music.ogg");
    
    myPlayHandle1= playSound(myGoodOggSound);
    myPlayHandle2 = playStream(myGoodOggStream);
    
    while(1);
    
    If there are no alternatives, I'll try SDL_Mixer. I don't want to though because it can only play one music stream at a time.

    Edit:
    Programmed it myself in the end. It was way easier than I thought.
     
    Last edited by MyLegGuy, Dec 7, 2017 at 3:15 AM
  16. cracker

    cracker Nyah!

    Member
    3,173
    463
    Aug 24, 2005
    United States
    There have been OT talks of general programming info so I wanted the clarification. :P

    LPP has ogg support that you could borrow from. Here is the piece of code that handles the stream decoding.
     
    MyLegGuy likes this.
  17. B_E_P_I_S_M_A_N

    B_E_P_I_S_M_A_N I have graced this thread with my presence.

    Member
    848
    3,206
    Jun 7, 2016
    United States
    Hell
    You could also borrow some some of the code from ctrmus. It's licensed under the GPL v3.0.
     
    MyLegGuy likes this.
  18. Gamekiller78

    Gamekiller78 Member

    Newcomer
    11
    0
    Dec 4, 2016
    United States
    Are you trying to re create sound haxs
     
  19. tgaiu

    tgaiu Member

    Newcomer
    27
    3
    Sep 10, 2017
    Japan
    I attempted to play the ogg file using libtremor but failed.
    Is there a mistake in the code?
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <math.h>
    #include <cstdlib>
    #include <cstring>
    #include <cstdio>
    #include <tremor/ivorbiscodec.h>
    #include <tremor/ivorbisfile.h>
    #include <3ds.h>
    
    #define MUSIC_CHANNEL 1
    #define BUFFER_SIZE 4096
    #define STACKSIZE (4 * 1024)
    
    typedef struct {
    	
    	float rate;
    	u32 channels;
    	u32 encoding;
    	u32 nsamples;
    	u32 size;
    	char* data;
    	bool loop;
    	int audiochannel;
    
    	float mix[12];
    	ndspInterpType interp;
    
    	OggVorbis_File ovf;
    } Music;
    Music music;
    
    void load() {
    	FILE * file = fopen("example.ogg", "rb");
    	if (ov_open(file, &music.ovf, NULL, 0) < 0) {
    		printf("ogg vorbis file error\n");
    	}
    	vorbis_info * vorbisInfo = ov_info(&music.ovf, -1);
    	if (vorbisInfo == NULL) {
    		printf("could not retrieve ogg audio stream information\n");
    	}
    	music.rate = (float)vorbisInfo->rate;
    	music.channels = (u32)vorbisInfo->channels;
    	music.encoding = NDSP_ENCODING_PCM16;
    	music.nsamples = (u32)ov_pcm_total(&music.ovf, -1);
    	music.size = music.nsamples * music.channels * 2;
    	music.audiochannel = 0;
    	music.loop = false;
    	if (linearSpaceFree() < music.size) {
    		printf("not enough linear memory available\n");
    	}
    	music.data = (char*)linearAlloc(music.size);
    
    	printf("rate:%f\n", music.rate);
    	printf("channels:%ld\n", music.channels);
    	printf("encoding:%ld\n", music.encoding);
    	printf("nsamples:%ld\n", music.nsamples);
    	printf("size:%ld\n", music.size);
    
    	int offset = 0;
    	int eof = 0;
    	int currentSection;
    
    	while (!eof) {
    		long ret = ov_read(&music.ovf, &music.data[offset], 4096, &currentSection);
    		if (ret == 0) {
    			eof = 1;
    		}
    		else if (ret < 0) {
    			ov_clear(&music.ovf);
    			linearFree(music.data);
    			printf("error in the ogg vorbis stream\n");
    		}
    		else {
    			offset += ret;
    		}
    	}
    	linearFree(&music.ovf);
    	ov_clear(&music.ovf);
    	fclose(file);
    }
    
    int play() {
    	if (music.audiochannel == -1) {
    		printf("No available audio channel\n");
    		return -1;
    	}
    	ndspChnWaveBufClear(music.audiochannel);
    	ndspChnReset(music.audiochannel);
    	ndspChnInitParams(music.audiochannel);
    	ndspChnSetMix(music.audiochannel, music.mix);
    	ndspChnSetInterp(music.audiochannel, music.interp);
    	ndspChnSetRate(music.audiochannel, music.rate);
    	ndspChnSetFormat(music.audiochannel, NDSP_CHANNELS(music.channels) | NDSP_ENCODING(music.encoding));
    	
    	ndspWaveBuf waveBuf;
    
    	waveBuf.data_vaddr = music.data;
    	waveBuf.nsamples = music.nsamples;
    	waveBuf.looping = music.loop;
    
    	DSP_FlushDataCache((u32*)music.data, music.size);
    
    	ndspChnWaveBufAdd(music.audiochannel, &waveBuf);
    	return 0;
    }
    
    
    int main() {
    	gfxInitDefault();
    	consoleInit(GFX_TOP, nullptr);
    
    	load();
    	play();
    	while (1) {
    		hidScanInput();
    		u32 kDown = hidKeysDown();
    		if (kDown & KEY_START) break;
    
    		gfxFlushBuffers();
    		gfxSwapBuffers();
    		gspWaitForVBlank();
    	}
    	gfxExit();
    	ndspExit();
    	return 0;
    }
     
  20. elhobbs

    elhobbs GBAtemp Advanced Fan

    Member
    811
    299
    Jul 28, 2008
    United States
    I don’t see a call to ndspInit?