User avatar
Jimbo213Mo
Posts: 37
Joined: Fri Feb 12, 2016 9:52 pm
Location: St. Peters Missouri USA

how to change Pi from stereo to mono output

Fri Mar 04, 2016 4:49 pm

SOLVED - see April 2nd entry :D

I am replacing the tuner and amp on a 35 year old home monaural intercom to home-broadcast from RasPi2B running Kodi and also getting tunes from my home NAS drive
.
It will be something like this fellow did -just look at the opening photo http://imgur.com/a/ycO2q.

I have purchased a 12vDC-4A stereo amplifyer, and it gives a method to jumper six PCB contactors to make the output Mono - but I hesitate to fat-finger the soldering iron and fry the whole amp.

Since the intercom is monophonic but the RPi output is stereophonic I can anticipate a problem in only playing the R or L channel, especially as some Jazz artists delight in their fancy mixing tricks where [for instance] Kenny G's L-O-N-G saxophone riffs move back and forth from R to L to R to L ... yada yada yada. Or the artist will put the drums all on one channel and I'd either get only the drum track ... or only the vocals. Ahhhhhh!

Question: Has anyone found a programmatic way to change the output of the Pi to be monophonic?
Last edited by Jimbo213Mo on Fri Apr 08, 2016 3:12 pm, edited 2 times in total.
RPi 2B, 8gb SD,
LibreELEC (official) v 8.0.2 [kernel: Linux 4.9.29]
from NOOBS v2.4.2 on 7/19/17
Official RPi foundation 7" touchscreen
Kodi 17.3; Skin = Estouchy
The Pi connects USB wireless to Home WiFi EA4500 router

masa-aud
Posts: 144
Joined: Fri Feb 26, 2016 9:20 am

Re: how to change Pi2B from stereo to mono

Mon Mar 07, 2016 10:24 am

reply to Jimbo213Mo on stereo-to-mono
I also hesitate combining Lch-Rch anyhow of power output stage as you do because of safety.
Controlling stereo-mono by program seems to be difficult because most of existing functions are stereo based while DeskTopMusicCenter of multi ch capable tools may work full size PCs. I think that to be simple by using mono-stereo converting cable is good to try first.

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: how to change Pi2B from stereo to mono

Mon Mar 07, 2016 10:47 am

Looking at the schematic, connecting the two analogue output channels together via a pair of 10k resistors to create a summed mono certainly wouldn't do any harm. It just relies on the input impedance of the amplifier you're driving from it being significantly higher that 10k to avoid losing too much volume.

I'd prefer a software approach too ideally, but the above will work.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

User avatar
Jimbo213Mo
Posts: 37
Joined: Fri Feb 12, 2016 9:52 pm
Location: St. Peters Missouri USA

Re: how to change Pi2B from stereo to mono

Mon Mar 07, 2016 5:33 pm

+GTR2Fan: thanks

>connecting the two analogue output channels together via a pair of 10k resistors<

How are the 10k resistors specifically connected?
My RaspberryPi 2B has an audio-out 3.5 mm stereo female port!

Are you saying I should use the resistors to jumper the GPIO pins?

I'm confused - sorry - just a Newbie to all of this.
Thanks in advance, Jim
RPi 2B, 8gb SD,
LibreELEC (official) v 8.0.2 [kernel: Linux 4.9.29]
from NOOBS v2.4.2 on 7/19/17
Official RPi foundation 7" touchscreen
Kodi 17.3; Skin = Estouchy
The Pi connects USB wireless to Home WiFi EA4500 router

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: how to change Pi2B from stereo to mono

Mon Mar 07, 2016 5:40 pm

You could chop the audio cable and place a resistor in series with both left and right audio signals, then connect them together at the end that faces the amplifier. That would work fine if the 3.5mm jack socket at the amplifier end is a stereo one, as both left and right at the amplifier end will then be summed mono. Just use one or the other (and ground obviously) to feed the mono amplifier.

Or make a stereo jack to mono jack lead as in this image, but with 10k resistors...

https://brashleraudio.files.wordpress.c ... -19-35.gif
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

User avatar
PeterO
Posts: 4876
Joined: Sun Jul 22, 2012 4:14 pm

Re: how to change Pi2B from stereo to mono

Mon Mar 07, 2016 5:49 pm

This looks like it contains a solution: viewtopic.php?f=29&t=33431

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

masa-aud
Posts: 144
Joined: Fri Feb 26, 2016 9:20 am

Re: how to change Pi2B from stereo to mono

Wed Mar 09, 2016 8:57 am

reply to GTR2Fan,
I think you are showing an exact solution to this issue, your method of connecting both L and R through a 10k pair , and there are stereo to mono cables connecting L and R inside but might be in direct without a 10k pair, seeming to work well because amplifers normally can work to output to a load of impedance same as themselves .

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7008
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: how to change Pi2B from stereo to mono

Wed Mar 09, 2016 11:08 am

masa-aud wrote:reply to GTR2Fan,
I think you are showing an exact solution to this issue, your method of connecting both L and R through a 10k pair , and there are stereo to mono cables connecting L and R inside but might be in direct without a 10k pair, seeming to work well because amplifers normally can work to output to a load of impedance same as themselves .
The left channel output driver on the Pi is then trying to drive the right channel output, and vice versa.
Any Y cable without resistors is fine for splitting, but shouldn't be used for combining. http://www.rane.com/note109.html
(10k sounds a little high to me - typical input impedance will be 47kohm, so you're actually making a potential divider and losing a 6th of your signal).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
Greg Erskine
Posts: 114
Joined: Sat Sep 15, 2012 4:20 am

Re: how to change Pi2B from stereo to mono

Wed Mar 09, 2016 11:42 am

Jimbo213Mo wrote:I am replacing the tuner and amp on a 35 year old home monaural intercom to home-broadcast from RasPi2B running Kodi and also getting tunes from my home NAS drive
.
It will be something like this fellow did -just look at the opening photo http://imgur.com/a/ycO2q.

I have purchased a 12vDC-4A stereo amplifyer, and it gives a method to jumper six PCB contactors to make the output Mono - but I hesitate to fat-finger the soldering iron and fry the whole amp.

Since the intercom is monophonic but the RPi output is stereophonic I can anticipate a problem in only playing the R or L channel, especially as some Jazz artists delight in their fancy mixing tricks where [for instance] Kenny G's L-O-N-G saxophone riffs move back and forth from R to L to R to L ... yada yada yada. Or the artist will put the drums all on one channel and I'd either get only the drum track ... or only the vocals. Ahhhhhh!

Question: Has anyone found a programmatic way to change the output of the Pi to be monophonic?
hi Jimbo213Mo,

It *should* be as simple as setting asound.conf

Code: Select all

# mono - Generated by piCorePlayer
pcm.!default {
	type route
	slave.pcm "hw:0,0"
	ttable {
		0.1 1
		0.0 1
		1.0 1
		1.1 1
	}
}
but things are never that easy with ALSA. :D

Search for: alsa asound.cfg stereo to mono

regards
Greg
Last edited by Greg Erskine on Wed Mar 09, 2016 11:46 am, edited 1 time in total.
* Raspberry Pi is a trademark of the Raspberry Pi Foundation

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: how to change Pi2B from stereo to mono

Wed Mar 09, 2016 11:45 am

6by9 wrote:(10k sounds a little high to me - typical input impedance will be 47kohm, so you're actually making a potential divider and losing a 6th of your signal).
The high value was chosen to minimise load on the Pi to irrelevantly tiny levels. A value one-tenth of this would be fine too.

As a Pi is capable of driving typical low impedance headphones (it is, after all, called a headphone jack in the official documentation), a value of 10k + 10k, ie, 20k across the channels won't be a problem as, worst case with both channels in complete antiphase, this only represents a peak current of a tiny fraction of a milliamp. It's certainly many orders of magnitude lower than a pair of typical low impedance headphones would like to pull if they had the chance. Headphones are effectively a near short-circuit to ground for both outputs by comparison.

If this is going to come down to the old chestnut of, "Yes, but you're putting current in to an output, not just taking it out!", headphones do this all the time as they're an inductive load.

All I'm proposing is exactly what's in fig.2 of the link you provided minus the additional load resistor which isn't actually doing anything significant when you compare the ratio of its value to the low value resistors he's using for mixing.

Can you really hear a drop of around 1.5dB in signal level without A/B switching between the two sources? Well, you probably could, but the volume control would only need turning through a few degrees to compensate.
Last edited by GTR2Fan on Wed Mar 09, 2016 5:01 pm, edited 1 time in total.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

User avatar
Burngate
Posts: 5932
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: how to change Pi2B from stereo to mono

Wed Mar 09, 2016 4:49 pm

6by9 wrote:The left channel output driver on the Pi is then trying to drive the right channel output, and vice versa.
Any Y cable without resistors is fine for splitting, but shouldn't be used for combining...
Perhaps hair-splitting, but given the original Pi has 270R resistors in series with each GPIO, and the B+ has 100R in series with each buffer, in either case shorting left and right together shouldn't upset the outputs, should it?

User avatar
Jimbo213Mo
Posts: 37
Joined: Fri Feb 12, 2016 9:52 pm
Location: St. Peters Missouri USA

Re: how to change Pi2B from stereo to mono

Thu Mar 31, 2016 9:26 pm

@ Greg Erskine

On the Pi, file manager, I did a tools > search for *asound* and asound.conf and found no files.

File manager did find alsa folders buried in
  • Mod: 03/30/16 in /def/fd/15/..{recursive}../fd/16/13/var/lib = my latest update-upgrade
  • Mod: 02/12/16 in /dev/fd/15/..{recursive}../fd/16/13/usr/share = original install
  • Mod: 02/12/16 in /dev/fd/15/..{recursive}../fd/16/13/usr/share/sounds = original install
And won't let me navigate to any of them ... saying doesn't exist

I did find in /var/lib/alsa/asound.state file containing:

Here is a link:
https://onedrive.live.com/redir?resid=C ... nt=file%2c

... is that the file I should be editing for Raspian-Jesse

What am I missing to implement your rather simple code fix to output the Pi to mono ?

Thanks, Jim
Last edited by Jimbo213Mo on Thu Mar 31, 2016 10:56 pm, edited 2 times in total.
RPi 2B, 8gb SD,
LibreELEC (official) v 8.0.2 [kernel: Linux 4.9.29]
from NOOBS v2.4.2 on 7/19/17
Official RPi foundation 7" touchscreen
Kodi 17.3; Skin = Estouchy
The Pi connects USB wireless to Home WiFi EA4500 router

User avatar
Greg Erskine
Posts: 114
Joined: Sat Sep 15, 2012 4:20 am

Re: how to change Pi2B from stereo to mono

Thu Mar 31, 2016 10:36 pm

hi Jim,

I don't have a Raspbian Pi in front of me right now, but I think the file should be in /etc. /etc/asound.conf is the system wide ALSA configuration file.

You can also do it per user basis with the $HOME/.asoundrc file.

http://alsa.opensrc.org/Asoundrc

regards
Greg
* Raspberry Pi is a trademark of the Raspberry Pi Foundation

User avatar
Jimbo213Mo
Posts: 37
Joined: Fri Feb 12, 2016 9:52 pm
Location: St. Peters Missouri USA

Re: how to change Pi2B from stereo to mono

Sat Apr 02, 2016 9:24 pm

SOLVED :D

@GregErskine, @GTR2Fan, @Masa-Aud, @6by9: Thanks for ALL of your help.

The article Greg linked http://alsa.opensrc.org/Asoundrc says
Neither .asoundrc or /etc/asound.conf is normally required.
so I must assume the Raspian-Jesse [Noobs 1.7.0 zip] did not install them because /dev/fd/14 is empty [show hidden is checked] which makes me wonder how it got there in the first place.
And asoundrc file (in your home directory) and /etc/asound.conf do not exist on my RPi either.

I'm going to leave the software alone, fearing that a subsequent update/upgrade might mess things up. I am just not comfortable with Linux yet [my son doubts if I ever will be !! ]

Instead I'm going to create a Stereo-to-Mono converter with a WYE output to two mono amps [home intercom amp & outside patio speaker amp] per the attached diagram courtesy of an electronic engineer in a different forum discussion.

SOLVED: Both resistors shown as 1k should be 470 ohms 5%, 1/4 watt
StereiToMono&Wye.gif
Stereo to Mono unbalanced converter with WYE to two amps.
StereiToMono&Wye.gif (17.58 KiB) Viewed 6588 times
Thanks for sticking with me Greg [and others]. I am quite grateful for your time spent.
Jim

EDIT: April 8th, added Resistor Values, minor clarifications. Marked THIS and the initial post "solved".
RPi 2B, 8gb SD,
LibreELEC (official) v 8.0.2 [kernel: Linux 4.9.29]
from NOOBS v2.4.2 on 7/19/17
Official RPi foundation 7" touchscreen
Kodi 17.3; Skin = Estouchy
The Pi connects USB wireless to Home WiFi EA4500 router

Return to “Graphics, sound and multimedia”