[SOLVED] Adding L + R Audio in Software

Having trouble with your GBZ build? Ask your questions here!
Post Reply
User avatar
Fredl
Posts: 96
Joined: Sat Jul 29, 2017 4:19 pm
Has thanked: 46 times
Been thanked: 22 times

[SOLVED] Adding L + R Audio in Software

Post by Fredl » Mon Oct 09, 2017 3:59 pm

EDIT: I'm gonna put the solution here, so you don't have to scroll. ;)

What is this? A rather easy fix, which combines the left and right audio channels into a mono channel. That way, you'll listen to both channels even on a mono speaker. (Keep in mind that you'll only have mono on both channels as well when using headphones!)

Step by step:

1. exit retropie (F4) or connect via SSH
2. type 'sudo nano /etc/asound.conf' (In my case this file was emty yet)
3. copy the code below into the file (all credit for the code goes to the poster from the link above)

Code: Select all

pcm.card0 {
type hw
card 0
}

ctl.card0 {
type hw
card 0
}

pcm.monocard {
slave.pcm card0
slave.channels 2
# type plug
type route
ttable {
# Copy both input channels to output channel 0 (Left) with half amplitude.
0.0 0.5
1.0 0.5
# Same for channel 1 (Right)
0.1 0.5
1.1 0.5
}
}

ctl.monocard {
type hw
card 0
}

pcm.!default monocard
4. type 'sudo /etc/init.d/alsa-utils restart'
5. type 'sudo reboot'
6. go to Retropie -> Audio -> Select your audio device (Jack or HDMI)




ORIGINAL POST:

Hi I'm kinda dissapointed by only hearing the left channel of my games...

So I'm looking for a way to add the left and right channels before they leave the Pi. What I thought of:

1. There is somehow a way of doing this globally for the Pis output....?
2. Find the piece of code in every single emulator and compile it myself. (Tedious af... but doable)
3. Adding the analog signals with a adding/mean circuit. I'm trying to avoid opening up my babies for the 1000th time.

Anyone has an idea on how this could be done?
Thanks, Fred
Last edited by Fredl on Sat Mar 03, 2018 5:34 am, edited 3 times in total.
I used to be an adventurer like you, but then I took an arrow in the knee :-O

Link: Downmix your GBZs sound to mono or you're missing half the fidelity!

salami738
Posts: 128
Joined: Sat Sep 09, 2017 6:06 am
Location: Germany
Has thanked: 60 times
Been thanked: 37 times

Re: Adding L + R Audio in Software

Post by salami738 » Tue Oct 10, 2017 3:03 am

Hi,
maybe you could try downmixing stereo to mono via ALSA.
Link: https://www.raspberrypi.org/forums/view ... 29&t=33431

User avatar
Fredl
Posts: 96
Joined: Sat Jul 29, 2017 4:19 pm
Has thanked: 46 times
Been thanked: 22 times

Re: Adding L + R Audio in Software

Post by Fredl » Tue Oct 10, 2017 3:32 am

salami738 wrote:
Tue Oct 10, 2017 3:03 am
Hi,
maybe you could try downmixing stereo to mono via ALSA.
Link: https://www.raspberrypi.org/forums/view ... 29&t=33431

Cool, thanks for the quick answer. Will try it as soon as I get home. One question though:

The code lines:

Code: Select all

    # Copy both input channels to output channel 0 (Left).
    0.0 1
    1.0 1
shouldn't they be rather

Code: Select all

    # Copy both input channels to output channel 0 (Left).
    0.0 0.5
    1.0 0.5
to avoid clipping when adding two identical signals?
I used to be an adventurer like you, but then I took an arrow in the knee :-O

Link: Downmix your GBZs sound to mono or you're missing half the fidelity!

User avatar
Fredl
Posts: 96
Joined: Sat Jul 29, 2017 4:19 pm
Has thanked: 46 times
Been thanked: 22 times

Re: Adding L + R Audio in Software

Post by Fredl » Tue Oct 10, 2017 11:02 am

Ok it worked (with some troubles). As I expected simply adding left and right to the left channel caused massive distortion.

Here's a step by step guide with the corrected code. (I wonder why this hasn't come up in this forum yet, as most GBZs are mono...? ^^)

1. exit retropie (F4) or connect via SSH
2. type 'sudo nano /etc/asound.conf' (In my case this file was emty yet)
3. copy the code below into the file (all credit for the code goes to the poster from the link above)

Code: Select all

pcm.card0 {
type hw
card 0
}

ctl.card0 {
type hw
card 0
}

pcm.monocard {
slave.pcm card0
slave.channels 2
# type plug
type route
ttable {
# Copy both input channels to output channel 0 (Left) with half amplitude.
0.0 0.5
1.0 0.5
# Same for channel 1 (Right)
0.1 0.5
1.1 0.5
}
}

ctl.monocard {
type hw
card 0
}

pcm.!default monocard
4. type 'sudo /etc/init.d/alsa-utils restart'
5. type 'sudo reboot'
6. go to Retropie -> Audio -> Select your audio device (Jack or HDMI)


I highly encourage everybody to do this with their GBZ, as it's a super easy fix, which lifts the quality of some games drastically ^^
I used to be an adventurer like you, but then I took an arrow in the knee :-O

Link: Downmix your GBZs sound to mono or you're missing half the fidelity!

User avatar
Merlin
Posts: 60
Joined: Thu Feb 22, 2018 12:32 pm
Has thanked: 44 times
Been thanked: 28 times

Re: [SOLVED] Adding L + R Audio in Software

Post by Merlin » Thu Mar 01, 2018 12:40 pm

So software mixing is better than hardaware mixing?(L with 10 ohm resistor and R with 10 ohm resistor connected togheter)?
This mix affect hdmi audio output also?(if connected to a stereo tv)

User avatar
FlashyFrank
Posts: 133
Joined: Tue Feb 13, 2018 3:22 pm
Location: Portland, Oregon
Has thanked: 42 times
Been thanked: 24 times

Re: [SOLVED] Adding L + R Audio in Software

Post by FlashyFrank » Fri Mar 02, 2018 10:25 pm

This is great! I was trying to figure this out and couldn't find anything on how to do it. Makes my mono sound way better!

User avatar
FlashyFrank
Posts: 133
Joined: Tue Feb 13, 2018 3:22 pm
Location: Portland, Oregon
Has thanked: 42 times
Been thanked: 24 times

Re: [SOLVED] Adding L + R Audio in Software

Post by FlashyFrank » Fri Mar 02, 2018 10:28 pm

Merlin wrote:
Thu Mar 01, 2018 12:40 pm
So software mixing is better than hardaware mixing?(L with 10 ohm resistor and R with 10 ohm resistor connected togheter)?
This mix affect hdmi audio output also?(if connected to a stereo tv)

I believe this is for people who are using mono speaker with mono input and the 10 ohm resistors are for if you have stereo input into a mono speaker? Someone who is a little more educated might be able to clear that up.
Last edited by FlashyFrank on Sat Mar 03, 2018 12:23 pm, edited 1 time in total.

User avatar
Fredl
Posts: 96
Joined: Sat Jul 29, 2017 4:19 pm
Has thanked: 46 times
Been thanked: 22 times

Re: [SOLVED] Adding L + R Audio in Software

Post by Fredl » Sat Mar 03, 2018 5:28 am

Merlin wrote:
Thu Mar 01, 2018 12:40 pm
So software mixing is better than hardaware mixing?(L with 10 ohm resistor and R with 10 ohm resistor connected togheter)?
This mix affect hdmi audio output also?(if connected to a stereo tv)
It's not necessarily better. The mixing circuit you're using has its problems though, see this post:
https://electronics.stackexchange.com/q ... io-signals
(Should be fine however)

The advantage of the software solution is
1. You can undo it easily!
2. You can do it with a finished build without opening the thing and adding electronics.

And yes, this will also affect hdmi! It will affect any audio output device!
I used to be an adventurer like you, but then I took an arrow in the knee :-O

Link: Downmix your GBZs sound to mono or you're missing half the fidelity!

jonny556er
Posts: 1
Joined: Sat Sep 12, 2020 11:32 am

Re: [SOLVED] Adding L + R Audio in Software

Post by jonny556er » Sat Sep 12, 2020 11:36 am

I tried this solution with my freeplay zero w and I lost all audio. I was able to reverse everything but I'm still missing part of the audio, especially in sonic games. I've tried a few other things too but I got errors and no audio, anyone out there have a solution I haven't tried?

edit: It's not just sonic games, I just tested snes games and I'm thinking its any stereo sound game. I think if I can force mono sound it would sound better.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest