RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Change audio output (Dosbox) Munt to 3.5mm jack (v4.7.1)

    Scheduled Pinned Locked Moved Help and Support
    audioforcemuntoutput
    18 Posts 2 Posters 2.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      Whirlinurd
      last edited by Whirlinurd

      Hello.

      Using a Raspberry Pi 3 b+ for some time now I decided to try some Dosbox emulation. Learned about Munt some time ago and tried to install it following the tutorial found here.

      https://retropie.org.uk/forum/topic/12549/tutorial-installing-munt-mt-32-emulation-on-rpi-3

      After some hit and misses I updated the steps and it worked perfectly. I have only a few issues that I can not resolve without a continues headaches.

      The main issue I have is that I can not find how to change the Munt output to the 3.5mm audio jack. Whatever I try it stays on the hdmi output. I do not know of any Munt configuration files that I can use to change the output.

      Second I tried to force all output mixers to the 3.5mm audio jack as I did with earlier versions of Retropie with "amixer cset numid 3 2" to easily change all output. This had changed off course. I read a few other posts with several solutions but it is not clear to me what the best way is at the moment. Tried a "asoundrec" thingy set to '1' for headphone but this still gave all sound to hdmi even is emulation station was set to headphone. Tried putting this to '0' but it did nothing.

      I hope that someone has a solution that works and is easy to revert if is is necessary to do so.

      To summarize everything what I like to learn.

      1. Using Munt with something else then HDMI?

      2. Maybe forcing all audio to one output?

      3. Has there ever been found a solution to 'mixer elements' not working. In Emulation Station or the audio not sticking in Raspi-config?

      Thanks.

      Edit:

      Tried the customization posted in:

      https://retropie.org.uk/forum/topic/26628/audio-issues-after-latest-raspbian-updates-june-2020/87

      by JNunes

      Step 1: Hardware – Default, Headphones, Mixer Alsa
      Step 3: sudo nano /boot/cmdline.txt

      • snd_bcm2835.enable_compat_alsa=1
        Step 6: sudo nano /boot/config.txt
      • hdmi_ignore_edid_audio=1
      • audio_pwm_mode=2
        Step 7a: sudo nano /home/pi/.asoundrc
      • defaults.pcm.card 1
      • defaults.ctl.card 1
        Step 7b: sudo nano /usr/share/alsa/alsa.conf
      • defaults.pcm.card 1
      • defaults.ctl.card 1

      This worked to output all sounds to one output including Munt to the 3.5mm audio jack. If I want to use the HDMI output again do I only have to revert the default output to '0' or also remove the "config.txt' entries? I am not sure what every setting makes or breaks in the Retropie install.

      I read all the posts again about mixer element problems and most problems did concern no audio or bad audio. This seemed the best solution for now. It feels that this answered all three questions I had. Hopefully some permanent fixes are going to be implemented in future versions of Retropie.

      Thanks again.

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        @whirlinurd said in Change audio output (Dosbox) Munt to 3.5mm jack (v4.7.1):

        Tried the customization posted in:
        https://retropie.org.uk/forum/topic/26628/audio-issues-after-latest-raspbian-updates-june-2020/87

        Why ? The topic pinned is about sound issues in EmulationStation, this shouldn't affect the sound/audio for other applications.

        I suggest you revert those modifications and just use the Audio menu in the RetroPie menu to select the Audio output (Headphone) and this should be it for other applications that use ALSA (including Munt-32).

        W 1 Reply Last reply Reply Quote 0
        • W
          Whirlinurd @mitu
          last edited by

          @mitu

          Then I do not know anymore. I used a clean install with everything. All audio goes to the output set in the Retropie menu except Munt-32. Normal Dosbox sounds like Soundblaster or Speaker do go to default audio. Whatever I try it Munt-32 stays on the HDMI output.

          I thought about several things. Maybe the Munt Alsa driver has separate configuration or some kind of pass through directly to the audio device.

          So reverting all modifications and using the audio menu as it should sets everything back to default. If I do that then I am back where I started and I know that did not work. You say it should work so I have no idea what could be different.

          Then I will keep it as it is now using a setup in a sound issues topic that did work since it was the only way I could force the output. I also understand that Munt-32 is not officially supported by the Retropie team.

          Ah well...

          Thanks again.

          mituM 1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator @Whirlinurd
            last edited by

            @whirlinurd said in Change audio output (Dosbox) Munt to 3.5mm jack (v4.7.1):

            Then I will keep it as it is now using a setup in a sound issues topic that did work since it was the only way I could force the output. I also understand that Munt-32 is not officially supported by the Retropie team.

            If the sound works everywhere except Munt, then the problem is not the sound/ALSA configuration - it might be a Munt/Dosbox configuration. How are you testing Munt ?

            W 1 Reply Last reply Reply Quote 0
            • W
              Whirlinurd @mitu
              last edited by Whirlinurd

              ****@mitu

              The only way I know. installing the games that I have into dosbox. After installing them on the mounted drive and setting up a game sound config to Roland or compatible for midi and Soundblaster 16 for digital. When I start the game the midi goes to the HDMI output and the soundblaster digital goes to the headphone jack as set in the Retropie menu.

              The only Dosbox output I know of is in a config file. This is the '.conf' file that Dosbox uses when started.

              The midi segment says:

              mpu401 = intelligent
              mididevice = alsa
              midiconfig = 128:0

              I see now that the midiconfig is the output to the alsa driver. I thought that all output in Dosbox automatically was redirected to the main alsa driver and also the audio settings Retropie uses. The tutorial for Munt-32 says the output should contain '128:0'. This was already set to the same device as default.

              The description in the config says:

              Special configuration options for the device driver. This is usually the id or part of the name of the device you want to use (find the id/name with mixer/listmidi).

              I know I tried 'mixer /listmidi before in the terminal to find devices but the mixer command is not found. I also tried changing the '128:0' to something like '128:1' because the headphone uses card id 1 but that did not change anything.

              The only other command I know is 'aplay -l' to give a report of devices.

              As I have it now:

              **** List of PLAYBACK Hardware Devices ****
              card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
              Subdevices: 4/4
              Subdevice #0: subdevice #0
              Subdevice #1: subdevice #1
              Subdevice #2: subdevice #2
              Subdevice #3: subdevice #3
              card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
              Subdevices: 3/4
              Subdevice #0: subdevice #0
              Subdevice #1: subdevice #1
              Subdevice #2: subdevice #2
              Subdevice #3: subdevice #3

              I can see that HDMI uses 'card 0' and the headphones uses 'card 1'. That is why I do not understand why changing the midiconfig to '128:1' did not do anything. I probably have to change the midiconfig to something else but I have no idea what it should be.

              mituM 1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator @Whirlinurd
                last edited by mitu

                @whirlinurd said in Change audio output (Dosbox) Munt to 3.5mm jack (v4.7.1):

                mpu401 = intelligent
                mididevice = alsa
                midiconfig = 128:0
                I know I tried 'mixer /listmidi before in the terminal to find devices but the mixer command is not found. I also tried changing the '128:0' to something like '128:1' because the headphone uses card id 1 but that did not change anything.

                By default, RetroPie starts TiMidity before Dosbox (for MIDI support) and it uses the 128:0 to 128:3 range in DosBox. If you start mt32 as a service or before Dosbox, this range is switched to 129:1 to 128:1. Here's what it looks like with both Munt and TiMidity started (Munt started before Dosbox):

                aconnect -o
                client 14: 'Midi Through' [type=kernel]
                    0 'Midi Through Port-0'
                client 128: 'MT-32' [type=user,pid=24249]
                    0 'Standard        '
                    1 'GM Emulation    '
                client 129: 'TiMidity' [type=user,pid=24736]
                    0 'TiMidity port 0 '
                    1 'TiMidity port 1 '
                    2 'TiMidity port 2 '
                    3 'TiMidity port 3 '
                

                Port 128:1 is not choosing the Headphone card, it's the GM emulation port for Munt.
                If you want to choose a different device to output the sound for Munt, it has a -dparameter to choose the ALSA device name (note: aplay -l lists the audio cards, not the devices).

                Try to start Munt with

                ./mt32d -i 12  -d dmix:CARD=Headphones,DEV=0
                

                and then test the MT32 output from Dosbox.

                W 1 Reply Last reply Reply Quote 0
                • W
                  Whirlinurd @mitu
                  last edited by Whirlinurd

                  @mitu

                  Hi, back again. Made a fresh install with al changes back to default. Changed to Headphones and also raspi-config to Headphone. Put the alsamixer back up to over 80 volume output. It defaults on 40 seems a bit low. Also this time the volume stayed up in Retropie menu. Most of the time it gives the 0% mixer bug. Everything back up and running.

                  I tried to start Munt:

                  ./mt32d -i 12 -d dmix:CARD=Headphones,DEV=0

                  This did not work.

                  ./mt32d -i 12% -d dmix:CARD=Headphones,DEV=0

                  With extra '%' like in tutorial. Also nothing

                  Did also this. Trying full path:

                  /usr/local/bin/mt32d -i 12 -d dmix:CARD=Headphones,DEV=0

                  This hangs startup.

                  Tried putting the extra '%' back:

                  /usr/local/bin/mt32d -i 12% -d dmix:CARD=Headphones,DEV=0

                  The same no startup on boot.

                  Maybe I have to use something with: bcm2835 Headphones. Like it is in aplay devices. Not sure.

                  No, seems it isn't just right yet. Tried some searching on 'dmix:CARD' but came up short. Surely it is in the right direction.

                  Thanks.

                  1 Reply Last reply Reply Quote 0
                  • mituM
                    mitu Global Moderator
                    last edited by

                    If you already have the sound - by default - going over Headphones, then there's no need to add a specific sound device when you start Munt, just run it without the -d parameter.
                    To see a list of available devices in your system, run aplay -L and it should list all of them.

                    W 1 Reply Last reply Reply Quote 0
                    • W
                      Whirlinurd @mitu
                      last edited by Whirlinurd

                      @mitu

                      Not really sure what you mean. This is my aplay output:

                      **** List of PLAYBACK Hardware Devices ****
                      card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
                      Subdevices: 3/4
                      Subdevice #0: subdevice #0
                      Subdevice #1: subdevice #1
                      Subdevice #2: subdevice #2
                      Subdevice #3: subdevice #3
                      card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
                      Subdevices: 4/4
                      Subdevice #0: subdevice #0
                      Subdevice #1: subdevice #1
                      Subdevice #2: subdevice #2
                      Subdevice #3: subdevice #3

                      So I only have to remove the -d paramenter and it becomes this:\

                      ./mt32d -i 12 dmix:CARD=Headphones,DEV=0

                      I am also not sure how to use aplay to see the correct device to use in the string. It says subdevices and stuff. Not sure.

                      I will try the new string some time later...

                      Ok, tried it out. This time when the log was flying by I noticed an error message. It seems that the mt32d service is not starting anymore with those parameters.

                      I see something like failed... /etc/rc.local Compatibility error. When I set it back I get the normal MT-32 emulator start setting everything up.

                      I am at a loss. It seems when parameters are used the rc.local startup is corrupted. Just like parameters can not be used in an rc.local file. Very strange everything.

                      Still hoping that works out eventually. Also posted a question in the support that Munt developers suggest at Vogons. Maybe they now some other solution that I have not think of yet.

                      Haven't got a reply at Vogons yet. Still waiting...

                      Thanks.

                      mituM 1 Reply Last reply Reply Quote 0
                      • mituM
                        mitu Global Moderator @Whirlinurd
                        last edited by mitu

                        @whirlinurd said in Change audio output (Dosbox) Munt to 3.5mm jack (v4.7.1):

                        Not really sure what you mean. This is my aplay output:

                        You're posting the output of aplay -l, not aplay -L.

                        So I only have to remove the -d paramenter and it becomes this:\

                        ./mt32d -i 12 dmix:CARD=Headphones,DEV=0

                        No, removing the parameter means:

                        mt32d -i 12
                        
                        W 1 Reply Last reply Reply Quote 0
                        • W
                          Whirlinurd @mitu
                          last edited by Whirlinurd

                          @mitu

                          Ok, removed the parameter and made it like this:

                          /usr/local/bin/mt32d -i 12

                          only removing the '&' of the end. This resulted again into the startup of Retropie hanging at boot.

                          Sorry, this is aplay -L

                          null
                          Discard all samples (playback) or generate zero samples (capture)
                          default
                          output
                          sysdefault:CARD=b1
                          bcm2835 HDMI 1, bcm2835 HDMI 1
                          Default Audio Device
                          dmix:CARD=b1,DEV=0
                          bcm2835 HDMI 1, bcm2835 HDMI 1
                          Direct sample mixing device
                          dsnoop:CARD=b1,DEV=0
                          bcm2835 HDMI 1, bcm2835 HDMI 1
                          Direct sample snooping device
                          hw:CARD=b1,DEV=0
                          bcm2835 HDMI 1, bcm2835 HDMI 1
                          Direct hardware device without any conversions
                          plughw:CARD=b1,DEV=0
                          bcm2835 HDMI 1, bcm2835 HDMI 1
                          Hardware device with all software conversions
                          sysdefault:CARD=Headphones
                          bcm2835 Headphones, bcm2835 Headphones
                          Default Audio Device
                          dmix:CARD=Headphones,DEV=0
                          bcm2835 Headphones, bcm2835 Headphones
                          Direct sample mixing device
                          dsnoop:CARD=Headphones,DEV=0
                          bcm2835 Headphones, bcm2835 Headphones
                          Direct sample snooping device
                          hw:CARD=Headphones,DEV=0
                          bcm2835 Headphones, bcm2835 Headphones
                          Direct hardware device without any conversions
                          plughw:CARD=Headphones,DEV=0
                          bcm2835 Headphones, bcm2835 Headphones
                          Hardware device with all software conversions

                          Some in the top of the list says HDMI and the bottom ones says Headphones. The Retropie audio is set to Headphones so they are probably the bottom ones. The top ones are probably the raspi-config audio. I have selected Headphones there at first setup but it always stays on HDMI 1.

                          Several versions of Retropie the mixer have changed and since then I haven't been able to change this to Headphones. Last time is probably in 4.2 or maybe 4.5. Don't know exactly. Maybe Munt is using the default raspi-config audio and that is why it stays on HDMI 1.

                          The only thing I can think of is manually finding out where the raspi-config audio is located and manually changing this and then test it out to see if it will work.

                          When I terminal to Retropie and sudo raspi-config trying to change to Headphone it is still not changing...

                          mituM 1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator @Whirlinurd
                            last edited by mitu

                            @whirlinurd said in Change audio output (Dosbox) Munt to 3.5mm jack (v4.7.1):

                            only removing the '&' of the end. This resulted again into the startup of Retropie hanging at boot.

                            Don't remove the & if you add the command in /etc/rc.local, that's why the system hangs on boot.

                            W 1 Reply Last reply Reply Quote 0
                            • W
                              Whirlinurd @mitu
                              last edited by

                              @mitu

                              That's fine. Everything is still the same as I installed it this morning.

                              What where your thoughts about the raspi-config output since I can not change it to Headphones. As I understand raspi-config is the default setup program for debian for audio through the system mixer.

                              Maybe it was the intention by the Retropie developer to lock this to HDMI since it is not needed or it is a bug. If Munt uses the raspi-config mixer it will not work if I can not change it.

                              mituM 1 Reply Last reply Reply Quote 0
                              • mituM
                                mitu Global Moderator @Whirlinurd
                                last edited by

                                @whirlinurd said in Change audio output (Dosbox) Munt to 3.5mm jack (v4.7.1):

                                What where your thoughts about the raspi-config output since I can not change it to Headphones. As I understand raspi-config is the default setup program for debian for audio through the system mixer.

                                Both raspi-config and the Audio menu in RetroPie use the system's provided audio outputs (whatever is listed by aplay -l), there's no default raspi-config audio. There have been some changed (in Raspbian) between 4.2. and 4.7, so the options might look different, but I haven't had any issues with raspi-config w.r.t. audio settings in recent versions (i.e. last 2 years).

                                Based on the aplay -l output you posted, you're using a recent enough Raspbian version (one that includes the changes referenced in https://retropie.org.uk/forum/topic/26628), so that should be ok. Just make sure your RetroPie version is up to date and the Audio options should be similar, whether you're using raspi-config or the Audio settings from RetroPie.

                                I'd try removing the /etc/rc.local line for starting munt and just use SSH to start a new login session on the PI to start manually mt32 and look at the output. Check by running

                                aconnect -o
                                

                                that the 128:0port is created and it's handled by mt32 before starting a Dosbox game. The output should look similar to the one I posted a few posts back.

                                W 1 Reply Last reply Reply Quote 0
                                • W
                                  Whirlinurd @mitu
                                  last edited by Whirlinurd

                                  @mitu

                                  Tried your suggestion of manually starting the mt32 runtime. Starting all the way back with the first try.

                                  /usr/local/bin/mt32d -i 12 -d dmix:CARD=Headphones,DEV=0

                                  When running this the first time it gave a PCM device fault. Then I ran the mt32 file on its own and I saw all the parameters that are possible including the -d for default. Normally it accepts the DMIX line perfectly fine so I found it strange it gave an error this time.

                                  I rebooted an tried the same line a second time. Expecting the same error. This time no error came up. The device line is completely valid and it is perfectly accepted it just give no output.

                                  After this I just pulled up the device list with aplay -L and going over them one by one. Just grabbed the first line in the list and hoping that it would do something else or also some kind of error.

                                  The first Headphone line became this:

                                  /usr/local/bin/mt32d -i 12 -d sysdefault:CARD=Headphones

                                  I started it in the terminal and started a game and what the heck it gives Midi over the Headphone output. It works. I was so focused on the DMIX line that I was going all over the place.

                                  Now we know that is was just a device that did not output in the case of Retropie. Just changing it was the solution.

                                  Great, thanks for your help. I really need to learn a bit more about the ins and outs of linux.

                                  Thanks again.

                                  W 1 Reply Last reply Reply Quote 0
                                  • W
                                    Whirlinurd @Whirlinurd
                                    last edited by Whirlinurd

                                    Not working just right yet. I added the same line to the /etc/rc.local file to start it up with Retropie and it hangs again with boot. Since it works when running it in a ssh terminal when Retropie is already running.

                                    Oops I found it... Original line had a '&' at the end. Seems to be some process thing so it runs in the background or something. Adding it back like this and Retropie started properly.

                                    /usr/local/bin/mt32d -i 12 -d sysdefault:CARD=Headphones&

                                    Did not know that.

                                    mituM 1 Reply Last reply Reply Quote 0
                                    • mituM
                                      mitu Global Moderator @Whirlinurd
                                      last edited by

                                      @whirlinurd Post the contents of your /etc/rc.local file, maybe we can figure out why it's not working.

                                      W 1 Reply Last reply Reply Quote 0
                                      • W
                                        Whirlinurd @mitu
                                        last edited by Whirlinurd

                                        @mitu

                                        Great thanks. It is ok. As I said forgot the '&' at the end. Still do not know why 'DMIX' option gives no sound and the 'Sysdefault' option does.

                                        Took some time and feels that it was a lot easier in the end. That's always when you find out how it works properly.

                                        Finally have some results...

                                        1 Reply Last reply Reply Quote 0
                                        • First post
                                          Last post

                                        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.