steward-fu / nds

NDS Emulator (DraStic) for Miyoo A30, Miyoo Mini (Plus), TRIMUI SMART and F(x)tec Pro1 (QX1000)
https://steward-fu.github.io/website/index.htm
GNU General Public License v3.0
131 stars 10 forks source link

No sound in MinUI #36

Closed jmapagchema closed 6 months ago

jmapagchema commented 7 months ago

I Know that it's not a issue at all, but i wish you can make magic!

Drastic runs very fine in miyoo mini and plus on MinUI, the only thing that doesn't work is sound. I have tried any available 'fix' but i can't make it sound.

Maybe you can make alternative launch.sh or config to make it works with sound on MinUI?

The RG35XX Version of Drastic runs perfect in MinUI...

steward-fu commented 7 months ago

Could you provide the MinUI's installation file or the GitHub link ?

jmapagchema commented 7 months ago

Sure, there is MinUI: https://github.com/shauninman/MinUI

And there is the RG35XX version ported and working on MinUI: https://boosty.to/xquader/posts/b9bfd9b4-5a37-48a6-8bc7-3d8aa48a5953?share=post_link

Thanks!!!!

pakrett commented 7 months ago

Allium by Goh Wei Wen has this kind of issue too, someone has managed to fix it but unfortunatly this fix it doesn't work on MinUI.

I put the link here here maybe it can help.

Drastic emulator has no sound #48

jmapagchema commented 7 months ago

I've tried these fix and others with no luck :(

pakrett commented 7 months ago

I've tried these fix and others with no luck :(

Yeah me too, I've tested so many things, but my knowledge are limited maybe we can contact XK since he has fixed it for Allium he may be able to understand what happens. Or directly put a request to MinUI's GitHub.

steward-fu commented 7 months ago

Error log:

[MI ERR ]: MI_AO_SetPubAttr[3364]: Dev0 failed to set pub attr!!! error number:0xa0052009!!!
[SND] failed to set PubAttr

DraStic emulator relies on "Audio Fix" setting. This is why it fails when start game. Please file issue back to MinUI GitHub to support "Audio Fix" setting. For "Audio Fix" setting, maybe, you can refer to the implementation of Onion or Stock system.

jmapagchema commented 7 months ago

Ohhh this is the question. The audio fix... the only difference from RG35XX where Drastic works perfectly in MinUI.

pakrett commented 7 months ago

Error log:

[MI ERR ]: MI_AO_SetPubAttr[3364]: Dev0 failed to set pub attr!!! error number:0xa0052009!!!
[SND] failed to set PubAttr

DraStic emulator relies on "Audio Fix" setting. This is why it fails when start game. Please file issue back to MinUI GitHub to support "Audio Fix" setting. For "Audio Fix" setting, maybe, you can refer to the implementation of Onion or Stock system.

There is no issues tab on MinUI github unfortunatly, maybe you can redirect me to the part of the code in onion os? I don't know if Shaun Inman takes feature requests without proper code.

jmapagchema commented 7 months ago

OnionOS doesn't have drastic on their code... I think Onion uses this @steward-fu build in their system. @shauninman doesn't have issues available, I've contacted him trough X, and with this link. I hope he can see it.

pakrett commented 7 months ago

OnionOS doesn't have drastic on their code... I think Onion uses this steward-fu build in their system. Shauninman doesn't have issues available, I've contacted him trough X, and with this link. I hope he can see it.

I'm talking about the audio fix part of the code, not drastic. I hope he can see it too.

jmapagchema commented 7 months ago

Sorry, I misunderstood... I don't have reachead at the specific code, but it's mention about three different audio codecs for Miyoo here (AudioIO when using audiofix=OFF and SDL when using ON): https://github.com/OnionUI/Onion/blob/bdb0853b27a168af1890a952f075515410d539de/static/build/RetroArch/RetroArch_Dingux_forMiyooMini.txt

I hope @steward-fu and @shauninman can make light about those questions!

steward-fu commented 6 months ago

Honestly, I am not familiar with "Audio Fix". As I remembered, when I first time ported drastic emulator to miyoo mini plus, I noticed that the audio doesn't work. After told by someone, I turned off "Audio Fix" and then the sound works as expected. So, when drastic emulator starts to run, the first thing is to kill audio related service (in launch.sh file). I also checked on MinUI system, no any related service is alive. So, I really don't know why the sound doesn't work.

bqcuong commented 5 months ago

@jmapagchema If you are still following this, you can consider my temporary workaround that is working for MinUI + Miyoo Mini Plus:

  1. Add the following code right before the call to ./drastic in NDS.pak/launch.sh (follow this suggestion).

    
    set_snd_level() {
    local start_time
    local elapsed_time
    
    start_time=$(date +%s)
    while [ ! -e /proc/mi_modules/mi_ao/mi_ao0 ]; do
        sleep 0.2
        elapsed_time=$(( $(date +%s) - start_time ))
        if [ "$elapsed_time" -ge 3 ]; then
            return 1
        fi
    done
    
    echo "set_ao_mute 0" > /proc/mi_modules/mi_ao/mi_ao0
    echo "set_ao_volume 0 -30dB" > /proc/mi_modules/mi_ao/mi_ao0
    echo "set_ao_volume 1 -30dB" > /proc/mi_modules/mi_ao/mi_ao0

}

set_snd_level &


2. Remove [these below lines](https://github.com/shauninman/MinUI/blob/8e57805e9d29046427ee88762d9099fe7daf787a/skeleton/SYSTEM/miyoomini/paks/MinUI.pak/launch.sh#L72-L80) in `MinUI.pak/launch.sh`. As far as I know, this is the fix for the "pop noise" issue, which I think that it is relevant to the "Audio Fix" setting mentioned here. Removing this patch causes the regression bug "pop noise", but we have the sound for Drastic.
```bash
if $IS_PLUS; then
    /customer/app/audioserver -60 & # &> $SDCARD_PATH/audioserver.txt &
    export LD_PRELOAD=/customer/lib/libpadsp.so
else
    if [ -f /customer/lib/libpadsp.so ]; then
        LD_PRELOAD=as_preload.so audioserver.mod &
        export LD_PRELOAD=libpadsp.so
    fi
fi
jmapagchema commented 5 months ago

Thanks mate! It works perfectly with 1.7 ;)

dleicht commented 5 months ago

@steward-fu you might want to consider mentioning this fix in the miyoo mini (plus) section of your README 🙏

DesiQuintans commented 4 months ago

@bqcuong Cheers, this works for me with:

I inserted the first part into "Emus\miyoomini\NDS.pak\launch.sh":

if [ "$CUST_CPUCLOCK" == "1" ]; then
    ./cpuclock 1500
fi

# INSERT THE FIX HERE

./drastic "$1"
sync

For the second part of the fix, I found the code in ".system\miyoomini\paks\MinUI.pak\launch.sh" (after line 70) and commented it out (put # in front of every line).

Sounds still works in other platforms too :)