RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Fri Nov 29, 2019 10:45 pm

Note that we are not currently spending any development time on Pulseaudio.
My history with Linux is similar to that if renice123. And a google search of my name used to find me actively involved in a number of distros plus some hardware projects. Now I avoid getting involved - or tried to, until my son gave me one of the first models of Pi, and like others here, I've added one or two each year hoping one day the RPFwill release a 'general purpose' Pi.

And the Pi 4, except for the printing problem and this audio thing (neither of which I believe are much to do with Pi hardware), it more or less it.

As I mentioned previously, I think I understand why the Pi team / Raspbian team are not working on pulseaudio. But I am also not the only person who has written about the volume limit on the Pi and that the only way I managed to get around it was to install pulseaudio.

However, this interests me:
Pulseaudio is buggy on lots of platforms, but there are specific issues with it on Pi as the underlying firmware was based around ALSA, and moving to Pulseaudio gives some unwanted delays in the audio pipeline (important when combined with video). The pulseaudio team really need to work on their bug fixing.

As for the volume thing, we are not sure what is going on there. ALSA should give decent sound volume. Note though that on the Pi although the ALSA system says mono- its actually stereo.

Note that we are not currently spending any development time on Pulseaudio.
From an engineering and software point of view, would it be possible for one of the team who has a Pi 4 to whack Manjaro on a spare microSD card and check the audio on the Pi 4 running Manjaro?

And check if it is volume limited to 100%, or if it will drive the gain to 150% volume? (distortion is not relevant - it is going to happen)

Check if there is actual left and right channel separation. That link with the left channel - right channel voice is good for that.

It won;t take much actual time.
And if it is working (I'm sure my Pi 4 can;t be the only one it works on with Manjaro), is it likely the Manjaro people might share what they did to make it work.
It's not like these are big commercial software companies protecting their interests. As far as I know, Manjaro could be an offshoot or descendent of Mandrake, one of the early Linux distros that I was involved in back in the 90s. And there was a pretty good team spirit in the community then.

If they have found a trick to make the Pi 4 audio work better for ordinary use. maybe they would share it?

Just a thought..
Remember, nobody is listening to you
until you fart ...

bjtheone
Posts: 873
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: analog Sound Raspberry PI 4 is mono, not stereo

Sat Nov 30, 2019 1:09 am

I'm with @LTolledo... I have not messed with the default audio stuff since I have a significant hate on for pulseaudio and quite frankly it just works. I have a set of powered speakers plugged directly into the 3.5mm jack. I most definitely get proper stereo sound with a normal left and right channel. I suspect that your adventures with pulse messed something up if Raspbian is not giving you that @RossDv8. I also have no issues getting appropriately loud volume

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Sat Nov 30, 2019 5:32 am

Thanks bjtheone.

I suppose considering that the reason for my messing with pulse (well, just installing pulseaudio and pulseaudio volume control actually) was because the default install of Buster gave me audio problems, (low volume when connected to Logitech speakers with the speaker amp on full and ALSA on 100%) you might be right, and the problem is the Pi 4 hardware.

In which case there's not really much I can do, other than use Raspbian for day to day work, and swap to a Manjaro card to play multimedia. Fortunately, the design of the Pi lends itself to this solution quite nicely.

Of course there's another possibility that I should explore. Something might have changed between the version of Buster I originally downloaded, and the one that can be downloaded now. Although I would expect ALSA is still limited to 4bd gain.
I've mentioned before that, the problem I had was with 'quietly spoken voices in movies', not general audio in music or loud sound effects, even at the full 4db gain available in ALSA.

Anyway, for now I have both channels coming out of one speaker, and with the subwoofer, unless I actually want stereo separation, it doesn't matter.
If I want full stereo that is only a microSD swap and a reboot away. Not a big drama.
Remember, nobody is listening to you
until you fart ...

renice123
Posts: 198
Joined: Tue Oct 15, 2019 3:56 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Sat Nov 30, 2019 7:17 am

Sound in films is the misfortune of the modern film industry. After the sound engineers decided to sound the films “in a new way”, that is, they expanded the dynamic range, introduced quad and stereo sound, we started cacophony. I also can’t listen to sound in films - with the overall high sound quality, the voices of the actors are hard to hear (medium-frequency failure)! But this is the misfortune of modern cinema with its damned sound "effects", and not the misfortune of Raspberry. Old films were voiced differently, they normalized the sound and the voices of the actors are perfectly audible, the old school of sound engineering is an art! When I watch old films, I enjoy how sound engineers talentedly worked with sound, and did it with simple means!
Stereo works fine for me, I also like high-quality sound, so I use jack and ALSA when listening to music.
I think RossDv8, you can do the following.
1. Purchase an external power amplifier with sensitivity adjustment. They are cheap and quality today. During my youth, ULFs were problematic (price, sound quality, size), but today amplifiers are cheap and good.
2. Or buy an external sound card with gain control.
I did so, and now I have an sensitivity adjustment at the input of the amplifier and potentiometers on the DAC
Unfortunately, I don’t know of other ways to “improve” the sound of modern cinema, except to let the movie soundtrack pass through a software filter, where to normalize.
Pulseaudio only slightly fixes the problem, but it creates other difficulties (in particular, I'm not sure if pulseaudio software manipulations benefit the sound).

PS A serious equalizer program works in Buster, except for paeq (it is a pulseaudio equalizer for 15 bands)
You can put a real-time equalizer JAMin, it will allow on the fly to normalize any sound on Raspberry
But this is a serious program, it will require processor resources. She is much better than paeq
http://jamin.sourceforge.net/en/about.html
In addition to JAMin, there is also a JACK Rack with LADSPA effects
I do not use equalizers, but there are many of them and they are professional, if we talk about Raspberry
Image

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Sat Nov 30, 2019 9:11 am

The 'analog Sound Raspberry PI 4 is mono, not stereo' problem is a problem somewhere in Raspbian. It is not caused by a hardware 'fault' in the Pi 4, and it is certainly NOT caused by installing pulseaudio.
Out of curiosity since this discussion seems to have so many guess related comments I spent part of the afternoon checking the statements I had made early on in this post.

First, I confirmed what happens on my version of Buster supposedly 'messed up' by installing pulseaudio and its volume control.
I played the left channel / right channel stereo test audio clip.
As mentioned in my previous reply, I have BOTH left and right voices coming from ONLY the LEFT speaker and the subwoofer, and nothing at all coming from the right.
Which is better than I had previously where only the left voice was coming from the left speaker and woofy and there was still nothing at all coming from the right.

Next, I burned a fresh copy of Manjaro ARM for Raspberry Pi 4 to a microSD using Etcher, and swapped it in.
Because there had been some posts on the manjaro forum about a recent update causing sound problems (probably out old mate pulseaudio) I updated all the software before testing.
Ran the stereo test clip and got left and right audio from the analog jack. Over separate speakers and with very obvious separation and with the subwoofer.
I opened the pulseaudio mixer to check and it assured me I WAS using the Analog Headphone port and Built in stereo or whatever it was called. Stereo at any rate.

I shut down the Pi and whacked a freshly downloaded and Etched Raspbian Full into the microSD slot, then booted and went through the standard Raspbian Config.
And I played the Left /Right test clip.
And I got the left voice through the Left speaker and the right voice through the Right speaker with definite stereo separation, though not as distinct as on Manjaro.

I was about to log in here and apologise for my faulty assumptions, when I realised I hadn't heard any subwoofer effect. And I checked the volume control. And I changed from HDMI to Analog :oops:

So I played the test clip again and got
Left voice from the Left speaker and the woofer
NOTHING at all from the right speaker.

This, again is a completely fresh latest FULL Raspbian.
And just to be sure I ran update and upgrade and tried it again.

And then I swapped to Manjaro and confirmed my previous test. Perfect stereo. Well, as perfect as the Pi will do without an equalizer :D

So my previous comment stand. I understand why the RPI is not able to fix the Analog audio just at the moment. And it is NOT installing pulseaudio that messed it up.

Note: I just read this and it sounds argumentative and a little aggressive. That's not the intent - I am just emphasising facts. And I'm exhausted - which doesn;t help.
Remember, nobody is listening to you
until you fart ...

gordon77
Posts: 5040
Joined: Sun Aug 05, 2012 3:12 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Sat Nov 30, 2019 9:28 am

I am baffled by this. I use raspbian, standard Buster download, on a Pi4, and using the video linked to earlier l get left and right when using analog sound, hardwired to 2 Jam speakers. No problems.

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Sat Nov 30, 2019 10:03 am

I was baffled by it as well, which is why I'm feeling a bit cranky. I was certain I had made a mistake somewhere, which is why I spent time to download the latest available Buster and Manjaro and burn them to fresh microSD cards.

And going back through some topics and posts, I confirmed you and I are not alone in the different findings.
At least one of the Engineers on the forum found the Analog reporting as Mono in ALSA, although I think he might have said it was playing stereo.

But my Raspbian on the SSD is now playing Both channels through one speaker, and with the sub woofer, it is hard to tell it is not stereo unless I actually walk up to it, or listen carefully and note no separation.

But using the fresh Raspbian on SD it is really obvious there is no stereo, and using fresh Manjaro it is really obvious there IS stereo.

So it's got me stuffed. It is not the Pi itself. But why do some people with a stock install get stereo and others don't/

There's one more thing to check, and I should have thought of it earlier. (I think my brain injuries have left me half witted).

I have a hub and drives plugged into the USB ports. When I still had a brain, I would have automatically unplugged everything I could (except the keyboard dongle) and tested it again.
But because it worked on Manjaro I got lazy. However, we had some other odd USB related glitches when the Pi 4 was newly released. And as unlikely as it seems, there is a possibility that a USB device, or even the Logitech speakers, are interfering with something in Raspbian,

Obviously, if it is working flawlessly in Manjaro, that rules out actual Pi hardware, but there we have it. Something is at variance between 'different identical' Raspberry Pi 4s running the stock standard Raspbian Buster...
Remember, nobody is listening to you
until you fart ...

User avatar
HawaiianPi
Posts: 5856
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: analog Sound Raspberry PI 4 is mono, not stereo

Sat Nov 30, 2019 10:50 am

My experience is the same as gordon77 above.

Raspberry Pi 4B4, Raspbian Buster, default ALSA audio (no Pulse), output set to analog, definitely stereo sound, and plenty of volume on either my headphones (direct, no amp) or my Edifier e10BT powered speakers (tested with VLC and Audacious). ¯\_(ツ)_/¯

Only changes I have made to Buster are the 64-bit kernel (arm_64bit=1 in config.txt) and installing multiarch support.

tim@RaspberryPi4B4:~ $ cat /sys/firmware/devicetree/base/model;echo
Raspberry Pi 4 Model B Rev 1.1
tim@RaspberryPi4B4:~ $ uname -a
Linux RaspberryPi4B4 4.19.75-v8+ #1270 SMP PREEMPT Tue Sep 24 18:59:17 BST 2019 aarch64 GNU/Linux
tim@RaspberryPi4B4:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"


I could test with a fresh image if anyone wants.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

renice123
Posts: 198
Joined: Tue Oct 15, 2019 3:56 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Sat Nov 30, 2019 12:25 pm

It seems I'm starting to understand what the problem is.
Yes, I had the same software “bug”, but I completely forgot about it, because I do not use the internal DAC (I almost always listen to music and watch movies on the external DAC)
As far as I remember, this was the problem of the “native” Volume Control (the fact is that I also use another software volume control - PNmixer)
The Raspbian volume control, if you switch from one channel to another, writes some strange .asoundrc file to your home directory. Since my home directory is always “virtual” (located in tmpfs memory), upon restart this strange file is deleted automatically. I do not notice him, of course.
Try to force delete this file, or fix it (the file is called .asoundrc)
It may also be necessary to delete the ALSA status file (if an erroneous condition was recorded there)
I think RPI programmers will explain why the volume control has this behavior. Most likely this is a small flaw.

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Sat Nov 30, 2019 1:35 pm

I could test with a fresh image if anyone wants.
My Colonel Sanders is later than yours (4.18.80) but mine was doing the same stuff on the earlier ones.
If you had the time to write a fresh Raspbian buster to SD and check it out with the left channel / right channel sound check (don't forget to change to Analog on the volume control though - HDMI seemed to be working in stereo) it would be interesting to know.

Also, if you have a spare SD lying around, writing a Manjaro ARM for Raspberry Pi 4 XFCE image and booting that for comparison would be good.

This is driving me nuts.
Remember, nobody is listening to you
until you fart ...

User avatar
HawaiianPi
Posts: 5856
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: analog Sound Raspberry PI 4 is mono, not stereo

Sun Dec 01, 2019 9:35 pm

Okay, I tested the stock Raspbian Buster image and audio is working fine for me (stereo).

Equipment used for test:
  • Raspberry Pi 4 Model B v1.1 (4GB) in a Flirc case
  • Older official 5.1V/2.5A micro USB universal power supply with Volutz brand USB-C adapter
  • Raspbian Buster with desktop (2019-09-26-raspbian-buster.zip)
  • Samsung EVO+ 16GB micro SD card
  • Micro-HDMI to HDMI adapter and a standard HDMI cable (HP Pavillion 27xw 1080p monitor)
  • Sennheiser HD 497 headphones
  • Logitech K400r wireless keyboard with trackpad (Unifying dongle in USB 2.0 port)

I used my Win10 laptop to write 2019-09-26-raspbian-buster.zip to the micro SD card with Etcher and a SanDisk MobileMate USB 3.0 micro SD Card Reader, and added my pre-configured wpa_supplicant.conf file (because I have an annoyingly long and complex WiFi password). No other changes were made to the card.

Booted the 4B4 and ran through the startup configuration script (skipped the WiFi part, because I was already connected). I normally skip the script driven software update and do that manually, but this time I let the script do it. After that finished without error I clicked reboot.

I used the configuration utility to enable SSH, and from my Win10 laptop I used SCP to copy a folder of music to the Pi4. Set audio output to Analog and listened to the music and it sounded fine, then I went to Youtube and tried the video linked above, and that was fine as well (left was in my left ear, and right was on the right). Volume was 40 and the sound was at a comfortable level in my headphones.
pi4audiotest.jpg
pi4audiotest.jpg (72.5 KiB) Viewed 1678 times
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Mon Dec 02, 2019 2:03 am

Thanks HawaiianPi, As I mentoned I also used a Samsung EVO Plus microSD, albeit a different size, And downloaded the latest Raspbian Buster 'Full' from this site. So the result should have been identical.

That they were not, on my Pi 4 , and that others in addition to me have the Analog sound is Mono problem, suggests a hardware problem.
That it is happening on your test AND mine on a 'Fresh' image of Raspbian, does however confirm that it is not somehow caused by installing pulseaudio and pavucontrol. So thank you for confirming that I didn't screw up Raspbian on my SSD.

I have one final thing I can test on my hardware. It is something I should have double and triple checked instead of just confirming it worked initially...
Remember, nobody is listening to you
until you fart ...

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Mon Dec 02, 2019 4:07 am

Ok, I hate being wrong - but I are sometimes...

I think I have narrowed down the Analog is Mono problem in 'my' situation, although it is only something ridiculously coincidental.

Firstly, Raspbian still shows me having Analog Audio sound, while Manjaro shows it as Analog Stereo.
And I was getting Left / Right separate audio on Manjaro, but Left / Right only out of the Left speaker on Raspbian (obviously with no separation)

So I Unplugged the speakers to check them in an Kubuntu system. And only got audio out of the LEFT speaker. Checked my settings and all were apparently correct. So there is obviously a problem with my Logitech Sound System.

I've now plugged them back into the Pi 4 and have Left AND Right channels coming out of the Left speaker and nothing out of the Right.
And swapping to Manjaro I have LEFT channel coming out of the Left speaker and RIGHT channel out of the Right speaker.
I also checked and none of the computers have a Left / Right fader, nor does the Logitech speaker system.

So my next step is to buy a new Speaker set that works on ALL my computers!
At last I can stop posting on this topic :D
Remember, nobody is listening to you
until you fart ...

User avatar
Fidelius
Posts: 460
Joined: Wed Jan 01, 2014 8:40 pm
Location: Germany

Re: analog Sound Raspberry PI 4 is mono, not stereo

Mon Dec 02, 2019 4:31 pm

Since on my Pi4's default Raspbian installation I use the XFCE desktop (apt install xfce) which in-turn installed the package "xfce4-pulseaudio-plugin", which in-turn installed the package "pulseaudio", I too have no stereo but just mono sound on the Pi4's analogues audio socket.

However, the solution is easy, as indicated here in the thread:

Code: Select all

sudo apt remove pulseaudio
Now my Pi4's analogues audio socket provides stereo sound again, because low-level ALSA without high-level Pulseaudio provides the sound.

That's great! Thanks a lot to all who constructively contributed to this thread.

However, as some posters mentioned, ALSA's stereo audio volume is now a good portion lower (quieter) compared to Pulseaudio's mono volume was. Is there a simple means to increase ALSA's audio volume?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26685
Joined: Sat Jul 30, 2011 7:41 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Mon Dec 02, 2019 4:38 pm

So, I spoke to our desktop guy about this.

As I said above, he confirmed we removed pulseaudio from the image, because it's just pants. At one point we needed it for, IIRC, Bluetooth audio, but we got round that somehow.

He also checked a standard raspbian install, and found that as expected, although ALSA reports mono, it's actually playing in stereo. Not sure specifically why ALSA does this, but I think it because we have no control over the left and right channels, just an overall volume, which ALSA gets confused about.

With regard to the volume, ALSA has a maximum of 100%, but Pulseaudio allows you to overegg the pudding with up to 150% or more, BUT this is a recipe for distortion. We/ALSA limit to 100% for that reason - anything more may result in distortion.

So there you go.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

renice123
Posts: 198
Joined: Tue Oct 15, 2019 3:56 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Mon Dec 02, 2019 7:33 pm

If you need to "amplify" the sound without distortion, then there are many solutions. Frankly, the other day I pulled off pulseaudio (the program "hissed" and this was the last straw) and installed an excellent patch!
It's great! It immediately worked in Rasbian without any crutches, I didn’t need to configure anything at all, except for connecting the snd-aloop module!
Now Kodi, VLC, mpd and other sound programs output sound through the loop, and then to the jackd server with minimal delay and any LADSPA filters - you can normalize the sound, amplify it and so on. In general, the guy from the RPI did a great thing - threw pulseaudio =)
The process described here is how to install snd-aloop and it works great on Rasbian.
https://alsa.opensrc.org/Jack_and_Loopb ... ack_bridge
You do not need to compile the module, support is already built in Raspbian, so the only thing you need to do is connect the module and put it in the asoundrc home directory
The snd-aloop module is the only thing I missed (I used pulseaudio instead), now with this module I can normalize the sound on the fly or make even more amazing sound effects. By the way, the processor is only 4-7 percent loaded due to the use of effects, which is much less than 20% pulseaudio
Here is my asoundrc (I slightly corrected the file for myself by reference)
Raspbian software volume control even works with these settings.

Code: Select all

# playback PCM device: using loopback subdevice 0,0
pcm.amix {
  type dmix
  ipc_key 219345
  slave.pcm "hw:Loopback,0,0"
}
# software volume
pcm.asoftvol {
  type softvol
slave {
        pcm "amix"
        }
#  slave.pcm "amix"
  control { name PCM }
  min_dB -51.0
  max_dB   0.0
}
# capture PCM device: using loopback subdevice 0,1
pcm.asnoop {
  type dsnoop
  ipc_key 219346
  slave.pcm "hw:Loopback,0,1"
}
# duplex device combining our PCM devices defined above
pcm.aduplex {
  type asym
  playback.pcm "asoftvol"
  capture.pcm "asnoop"
}
# for jack alsa_in and alsa_out: looped-back signal at other ends
pcm.ploop {
  type plug
  slave {
    pcm "hw:Loopback,1,1"
    }
}
pcm.cloop {
  type dsnoop
  ipc_key 219348
  slave {
pcm "hw:Loopback,1,0"
    }
}
# default device
pcm.!default {
  type plug
  slave.pcm "aduplex"
}

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Tue Dec 10, 2019 8:29 am

So my next step is to buy a new Speaker set that works on ALL my computers!
At last I can stop posting on this topic :D
I was a little premature with that assumption. I was messing around with a recently acquired small Lenovo computer, and plugged my Logitech speakers in - just out of curiosity to see if the Audio out was working. And lo and behold - stereo again.
So it was definitely the Pi Analog output in Raspbian causing the problem. Lucky I didn't go buying another speaker system, for multimedia.

So there I have it. I now have a tiny desktop computer, albeit about the size of four Pis, as my multimedia system.
And a spare Pi 4 to add to my collection of Raspberry Pis :D

I'm sure I will find something useful to do with it eventually, but for now it is back to being an interesting toy, unless I can get Stereo out of Manjaro again. I suspect now that I might have simply messed with some settings there, because initially I was certain I had stereo out of the Analog speakers before I started playing with HDMI.
Remember, nobody is listening to you
until you fart ...

Aydan
Posts: 729
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: analog Sound Raspberry PI 4 is mono, not stereo

Tue Dec 10, 2019 10:55 am

@RossDv8: Are you sure you don't have a broken audio cable?

Your description of sometimes it works, sometime it doesn't, sounds to me like an intermittent connection of the right channel.

Regards
Aydan

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Tue Dec 10, 2019 1:56 pm

Having been an electronics tech in one of the military services in the 70s that was my diagnosis, and the reason I planned to buy a replacement set of speakers.
But after I wrote the post above, I checked stuff again, just to be sure and swapped back to Manjaro on microSD running pulseaudio, and the speaker set is working on Analog. The reason I didn't have sound out of the right speaker was that I had inadvertently swapped to HDMI out when I was testing stuff.
And I had accidentally plugged the speaker into the Microphone input on the Brix, so I can put that down to operator error too.

Just tired from all the messing around with Raspbian. Anyway, it's not a hardware problem with the Pi 4. It's a problem in Raspbian and the way it interacts with pulseaudio.

For now it kills my idea of using the Pi as a multimedia player. But that's not a huge drama, the M93p-T will do that quite nicely running Elementary, so I spent a fair bit of today setting that up as a multimedia box. There are still lots of things the Pi does really well other than play videos and music.
Remember, nobody is listening to you
until you fart ...

bjtheone
Posts: 873
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: analog Sound Raspberry PI 4 is mono, not stereo

Tue Dec 10, 2019 2:23 pm

I am not disputing the sound level issue (which is very subjective) but I have not issues hearing the dialog in movies, when played back at what I consider reasonable overall volume levels when watching a movie in my office. However, something odd is going on. Many folks are using the Pi 4 as a media box, and getting stereo. Assumably over HDMI, so we can conclude that that works properly. A number of folks have reported getting proper stereo over the analog jack with powered speakers. Enough so, that I tend to conclude this is a fairly common setup and there would be way more hue and cry if it did not work.

My setup is stock Raspbian Lite with Mate, which is not exactly the same as full Raspbian but I believe it is the same for the audio path. Certainly am not using pulseaudio. Definitely using analog and getting proper stereo separation.

One question that occurs to me: I think you mentioned you have a external SSD. Are you running with /home mounted off the external SSD for your tests, or did you do them all with a new generic account with everything contained on the freshly written SD card?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26685
Joined: Sat Jul 30, 2011 7:41 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Tue Dec 10, 2019 3:42 pm

I think I mentioned it above, but Raspbian/ALSA allows settings volume up to 100%. Pulseaudio to at least 150% but at the risk of distortion. That distortion is why we limit to 100%. You should be using the speakers volume control to get loud volumes.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

bjtheone
Posts: 873
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: analog Sound Raspberry PI 4 is mono, not stereo

Tue Dec 10, 2019 8:31 pm

My volume comments were addressing the issue that RossDv8 had mentioned regarding being able to hear spoken dialog. Ie if you set the volume level to a reasonable overall level for the movie, you could not hear the dialog. Perhaps I just like listening to movies at a higher overall level but I do not notice that issue.

I also am using amplified speakers and have no issues achieving loud (or at least loud for a home office setting) with them.

User avatar
HawaiianPi
Posts: 5856
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: analog Sound Raspberry PI 4 is mono, not stereo

Tue Dec 10, 2019 9:51 pm

jamesh wrote:
Tue Dec 10, 2019 3:42 pm
You should be using the speakers volume control to get loud volumes.
Yup, computer speakers have built-in amplifiers. I normally configure the system volume at 50% and adjust the speaker volume to a comfortable level. Then I can fine tune the volume with the system volume, and if need be, I can use the speaker volume for a bit more.

As far as dialog goes, this is a common problem with movies, which have an overly wide dynamic range. Some media players will allow you to boost the center channel, and that's often where much of the dialog is. Or there may be an option to compress the dynamic range, which also helps to hear the dialog.

EDIT:
Headphones may need additional boost, especially "audiophile" models with high impedance. There are headphone amps that fit between the source and headphones.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

sirozha
Posts: 101
Joined: Sat Dec 28, 2019 2:44 am

Re: analog Sound Raspberry PI 4 is mono, not stereo

Wed Feb 05, 2020 2:00 am

My $0.02:

I've changed the desktop environment in Raspbian Buster (running on the Raspberry Pi 4B) from PIXEL (based on LXDE) to Mate. I had several issues with the sound:

1. When I installed PulseAudio, I realized that the sound that was stereo under pure ALSA became mono after PulseAudio was installed.

2. Because of the mono sound, I decided to uninstall PulseAudio and run on pure ALSA. Therefore, I had to install blueasla from the Raspbian repository. I'm not sure now if bluealsa is installed in the standard Raspbian distribution with the PIXEL desktop. In any case, at least under Mate, bluealsa is mandatory to be able to stream audio to a Bluetooth audio device without PulseAudio.

3. The switcher applet that the Raspbian developers created as a plugin for lxpanel in PIXEL doesn't load in Mate desktop because this plugin is for lxpanel's system tray, and Mate has its own system tray. Hence, there's a conflict. So, I couldn't figure out a way to switch audio from the on-board audio controller to a Bluetooth audio device when running pure ALSA with bluealsa.

4. I tried many different .asoundrc configurations and tried to use pnmixer, but I could either stream to the Bluetooth headphones or to the on-board audio controller - based on the .asoundrc. I couldn't figure out a way to keep the same .asoundrc and switch audio outputs with a GUI utility. I posted a question on the bluealsa page on github, and there was a nice user @borine answered my question in a very easy to understand way. Basically, according to @borine, ALSA understands only the "default" device. Depending on the .asoundrc configuration, "default" can be defined a bluealsa pcm or the hardware pcm, but there is no easy way to switch from one to the other. Additionally, most applications that do not have a way to switch audio outputs diagrammatically within the application itself, send sound to "default". Therefore, if you are playing a video in Chromium from Youtube, the audio is sent to "default". The .asoundrc file can define what "default" is, but again, there is no way to switch from one device to another. I believe the lxpanel system tray plugin that Raspbian developers created rewrites the .asoundrc file depending on which device is selected in the plugin's GUI with a pointing device. That plugin also restarts ALSA and probably some other services to be able to redirect the sound from one device to the other. This was a proprietary solution created by Raspbian developers in the PIXEL desktop in Buster (and perhaps in Stretch - I don't know, as I was not a Raspberry user back then).

5. The only way to be able to switch audio output from the on-board audio controller to the Bluetooth audio device and back without having to overwrite the .asoundrc file is to use PulseAudio. I ended up having to install PulseAudio in order to be able to switch audio output from one device to another in GUI in Raspbian running Mate DE. PulseAudio, when installed in Raspbian, causes the sound directed out of the on-board analog jack to be mono. I'm not just talking about what shows in the audio mixers like alsamixer, alsamixergui, pnmixer, etc. I'm actually talking about playing a stereo test in Youtube and witnessing that when the video says that the audio should be playing out of the left speaker only, in reality, the audio is playing out of both speakers; same goes for when the audio should be playing out of the right speaker - in reality it plays out of both speakers.

6. It turns out that the fix for the mono audio out of the analog jack in Raspberry Pi 4B running Raspbian Buster with PulseAudio is very simple. All you have to do is to comment out one section in the file /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf, as follows:
;[Mapping analog-mono]
;device-strings = hw:%f
;channel-map = mono
;paths-output = analog-output analog-output-lineout analog-output-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono
;paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headset-mic
;priority = 7
Then, reboot your Raspberry Pi, and you get stereo sound from the analog jack out of the on-board audio controller even with PulseAudio installed.

7. The remaining steps are:
a. Install PulseAudio from the Raspbian repository (if not installed):

Code: Select all

sudo apt install pulseaudio
Note: Don't forget to implement the fix to restore stereo sound, as described in Step 6 above.

b. Uninstall the bluealsa package (if it's installed).

Code: Select all

sudo apt remove bluealsa ---purge
c. Install the pi-bluetooth package (if it's not installed):

Code: Select all

sudo apt install pi-bluetooth
d. Install the blueman package (if it's not installed):

Code: Select all

sudo apt install blueman


e. Uninstall pnmixer (if you installed it before because pnmixer doesn't see the Bluetooth audio device under PulseAudio):

Code: Select all

sudo apt remove pnmixer --purge
f. Install pavucontrol (Pulse Audio Volume Control). In Mate desktop, there's a default volume control plugin in system tray called mate-volume-control. It is a stripped down version of pavucontrol. However, I recommend installing pavucontrol as well. pavucontrol doesn't have a plugin in system tray, so you have to run it in a window. pavucontrol has more features than mate-volume-control, and these features may come in handy.

Code: Select all

sudo apt install pavucontrol
g. Install Sound Switcher Indicator from this site. This utility allows you to switch audio output from one device to another in real time (while audio is playing). You don't have to kill the application playing audio to switch the audio device where the audio is sent - as long as you are running PulseAudio on top of ALSA. This utility installs in the system tray (at least in Mate it does) upon reboot. Sound Switcher Indicator only works when PulseAudio is installed. If PulseAudio is not installed, then this utility reports an error and fails to start.

h. Reboot the Raspberry Pi.

8. At this point, you can pair a new Bluetooth audio device using the Blueman plugin (icon) in system tray. Then, you can use the Sound Switcher Indicator icon (plugin) that is automatically installed in system tray to switch audio devices from the on-board audio, to the HDMI audio, to the Bluetooth audio device in real time (while the audio is playing).

9. If you find that the volume coming out of the analog speakers (or another audio device) is too low with PulseAudio running over ALSA, all you have to do is to open pavucontrol (Pulse Audio Volume Control) either from the shell typing pavucontrol or from Applications -> Sound and Video . You can do two things:
a. You can boost the volume of the particular application - under the Playback tab of this utility (for example, you can adjust volume for just Chromium if you are playing something in a Chromium tab).

b. Alternatively, you can boost boost the volume above 100% (0 dB) for the entire system out of a particular audio device (on the Output tab), such as Analog Output or Bluetooth Headphones.

Be careful and don't go too high, though, because you will cause distortion. You can safely go to 110% (2.49 dB) without extortion, which should give you loud enough volume comparable with what you get without PulseAudio when using ALSA directly.
****************************************************************************
After a month of tinkering with the sound and trying to get Bluetooth audio working and be able to easily switch between analog audio and Bluetooth audio, I have finally got it working. I can tell you that I'm very impressed with the sound quality: both out of the analog audio jack and via my Bluetooth Bose headphones. I'm using a cheap $20 set of Creative Pebble 2.0 speakers (powered by USB) with the Raspberry Pi 4B. The the sound quality is AMAZING with PulseAudio. It's unbelievable that I can get this quality out of a $50 computer and $20 speakers.

One piece of advice: don't plug USB-powered speakers in a Raspberry PI's USB port (or USB hub connected to a Raspberry Pi) or you will have too much static out of the speakers when moving the mouse. I even got static when I was running a speed test from speedtest.net when the speakers were powered by the Raspberry PI's USB port. Once I connected USB to a regular iPhone charger, all the static disappeared.

I hope this post will help someone save time and get the sound working properly on the Raspberry Pi.

jorgeovington
Posts: 2
Joined: Mon Apr 13, 2020 5:02 pm

Re: analog Sound Raspberry PI 4 is mono, not stereo

Mon Apr 13, 2020 5:14 pm

Good afternoon, I have literally been sticking with a raspberry Pi 4 with raspbian buster. I have configured an "airplay" to reuse some speakers that I had stored.
I have literally "suffered" the problem of the audio output through the jack, although everything was correctly installed and configured in Buster, I could not separate the channels through the jack and only one worked for me.
Doing experiments "literally" I have completely uninstalled pulse audio that is installed by default in buster and everything has worked correctly for me. Although it is an analog and not a digital output, it can be said that the sound is quite good.


4 Simple steps

Code: Select all


speaker-test -c2 -t wav

sudo apt remove puseaudio

sudo reboot
&
speaker-test -c2 -t wav

I have solved the problem ... !!! I hope it works for you .. !!! :D :D :D :D :D

Return to “Troubleshooting”