Access to MVD Service?

Discussion in '3DS - Homebrew Development and Emulators' started by devleon, Sep 6, 2016.

  1. devleon
    OP

    devleon Member

    Newcomer
    30
    9
    Aug 17, 2016
    Gambia, The
    Hey everyone!

    I'm currently working on implementing a moonlight client for the 3ds.
    Since moonlight streams in h264, this will be only usable on the N3DS.
    Luckily the N3DS provides fast hardware decoding for h264 - the browser, youtube and netflix uses it.

    I can access it by using the MVD Service.

    Luckily there's already a code example for that here.

    I have successfully compiled and uploaded the code to my 3ds, but when trying to call mvdstdInit(), it returns 0xd8e06406 - which as far as I know, means that the service is not accessible.

    I'm running the latest Luma on my A9LH N3DS.

    I tried accessing the homebrew menu via the homebrew launcher (installed via cia) as well as browserhax to launch my homebrew - but both result in the same error.

    How do I make the MVD service accessible to my homebrew? Do I need to use a different CFW? Which one would offer the necessary patches?
     
    DanTheMan827, I pwned U! and josamilu like this.


  2. Ryccardo

    Ryccardo WiiUaboo

    Member
    2,901
    1,355
    Feb 13, 2015
    Italy
    Imola
    3dsx apps keep the same permissions of the title they're running over (if you didn't configure one, it should use Download Play)...

    If you work with cias you'll be able to specify services yourself!
     
  3. devleon
    OP

    devleon Member

    Newcomer
    30
    9
    Aug 17, 2016
    Gambia, The
    Awesome, thanks!
    How would I make my 3dsx into a cia and specify my own services?
     
  4. Wolfvak

    Wolfvak *yawn*

    Member
    799
    1,060
    Oct 25, 2015
    Uruguay
    Ryccardo likes this.
  5. devleon
    OP

    devleon Member

    Newcomer
    30
    9
    Aug 17, 2016
    Gambia, The
    Thanks very much. How would I enable the patch in Luma?

    Also "The 'Disable SVC Permission Checks' patch is broken. Don't use it." is listed as a known issue in the Corbenik thread. Does that still apply?

    I will also try to build my own CIA with the correct permissions in the future.
     
  6. devleon
    OP

    devleon Member

    Newcomer
    30
    9
    Aug 17, 2016
    Gambia, The
    Just managed to compile it into a CIA and run it on the system - however as soon as I start decoding the video I get this:

    [​IMG]

    The dump is attached. Wondering why this happens?

    This is my RSF - I made sure to add the mvd to ServiceAccessControl and Dependency.
    Warning: Spoilers inside!

    I'm also getting a black icon - any idea why that happens? It shows up fine in FBI when I install the CIA - yet it's just completely black in the homemenu.
     

    Attached Files:

    Last edited by devleon, Sep 6, 2016
  7. devleon
    OP

    devleon Member

    Newcomer
    30
    9
    Aug 17, 2016
    Gambia, The
    I was running the luma dev version - running the normal version doesn't crash the homebrew anymore - however now the call to mvdstdProcessVideoFrame returns 0xC920181A... Which apparently means "The session was closed by the other process."... For some reason, remaining_size is also 0 from the output produced here.
     
    Last edited by devleon, Sep 6, 2016
  8. Urbanshadow

    Urbanshadow GBAtemp Maniac

    Member
    1,289
    469
    Oct 16, 2015
    You can set the permissions for the cia file. Make sure MVD is activated there.
     
  9. devleon
    OP

    devleon Member

    Newcomer
    30
    9
    Aug 17, 2016
    Gambia, The
    So i've gotten as far as to build a CIA with the necessary mvd stuff and getting a successfull mvd init - and while mvd_colorconvert works just fine now - I'm having issues with mvd_video, in particular mvdstdProcessVideoFrame() returning 0xC920181A. It seems that I'm somehow crashing the mvd module.

    I've added some debug statements, and I can tell mvdstdProcessVideoFrame doesn't get called up until video_pos is counted up to 0x1e - and at video_pos being 0x1e (and nalcount is 0x01, cur_nalunit_pos is 0x1c and prev_nalunit_pos is 0x00) mvdstdProcessVideoFrame get's called and returns with a 0xc920181a. (which means "The session was closed by the other process." according to 3dsbrew).

    Full message is: "mvdstdProcessVideoFrame() at NAL-unit offset 0x00000000 size 0x0000001b returned: 0xc920181a. remaining_size=0x00000000".

    Running either color-format-conversion or video after this just freezes the 3DS.

    I tried Luma3ds non-dev and dev version, as well as Corbenik with svc patches enabled.
     
    Last edited by devleon, Sep 7, 2016
  10. DarkRioru

    DarkRioru Akage Chan's Servent

    Member
    1,932
    408
    Aug 29, 2015
    United States
    Fluffing Akage Chan's Tail
    that sounds awesome!!! I would love to stream my pc games on my n3ds and blow children minds by streaming gtaV to my n3ds!! or am I wrong on what kind of moonlight I'm talking about???
     
  11. DanTheMan827

    DanTheMan827 GBAtemp Advanced Fan

    Member
    628
    391
    May 3, 2015
    United States
    Wisconsin
    Nope, you're right!

    The open-source NVIDIA GameStream client
     
  12. DarkRioru

    DarkRioru Akage Chan's Servent

    Member
    1,932
    408
    Aug 29, 2015
    United States
    Fluffing Akage Chan's Tail
    now to give kids a reason to lose their shit over gta being on a nintendo console!
     
  13. DarkRioru

    DarkRioru Akage Chan's Servent

    Member
    1,932
    408
    Aug 29, 2015
    United States
    Fluffing Akage Chan's Tail
    or to play postal 2/3 in a hospital waiting room :rofl2:
     
    natanelho likes this.
  14. kprovost7314

    kprovost7314 GBAtemp's Official Bara Master

    Member
    1,669
    858
    Dec 24, 2014
    United States
    In that bara manga ( ͡° ͜ʖ ͡°)
    Can someone show me how to use MVD? I want to make a chapter on it for my Homebrew Dev Guide.
     
  15. DarkRioru

    DarkRioru Akage Chan's Servent

    Member
    1,932
    408
    Aug 29, 2015
    United States
    Fluffing Akage Chan's Tail
    steam will be on the n3ds someday... and when it is, the whole world would lose its shit and do more backflips than monkeys on crack
     
  16. KotuMF

    KotuMF Member

    Newcomer
    39
    13
    Sep 8, 2016
    United States
    California
    I really hope this releases soon as a Pre-Release! Please do so! I would love to play my Steam Games on my 3DS!
     
  17. devleon
    OP

    devleon Member

    Newcomer
    30
    9
    Aug 17, 2016
    Gambia, The
    SoonTM (as soon as I get the mvd service to work reliably)

    I'd appreciate if a couple people could try go get the mvd sample running on their system and report back with results.

     
    I pwned U!, Wolfvak and DarkRioru like this.
  18. KotuMF

    KotuMF Member

    Newcomer
    39
    13
    Sep 8, 2016
    United States
    California
    Nice to hear! If you need someone to help you test Moonlight when you get it working, let me know!
     
  19. KotuMF

    KotuMF Member

    Newcomer
    39
    13
    Sep 8, 2016
    United States
    California
    Any news yet devleon?
     
  20. Roomsaver

    Roomsaver GBAtemp Advanced Fan

    Member
    948
    243
    Sep 7, 2015
    United States
    garfield kart grand prix
    This project looks awesome! Too bad I have an AMD GPU, though lol.