Problem: No sound outof the audio-jack on a 3B+

Hello all,

Problem: I cannot get sound outof of the audio-jack. :-(

Using "speaker-test" the HDMI output does give sound. Currently I even have set "raspi-config" to force sound over the audio-jack, but it seems to gets ignored. Right-clicking the loudpeaker icon in the top-right of my display I can select "analogue" and "hdmi", but it goes over hdmi every time (also, the volume alwas drops to near-to-nothing when I select something, and the tickmark is gone whenever I reopen the box)

I've tried to google for solution, but didn't find anything (other than a "reinstall your OS" suggestion).

Board: 3B+ OS: NOOBS v3.2.0 (not sure which Linux version)

Bonus question: Using Python I printed a "\a" (which google said would generate a beep), but got nothing (other than displaying a "landline telephone" character). Is there another way to generate (a simple) sound using Python (other than shelling to to an external program I mean) ?

Regards, Rudy Wieser

Reply to
R.Wieser
Loading thread data ...

Make sure that the GPIO pin used for audio (sorry, can't remember which one it is) isn't getting its mode changed by one of your programs using the GPIO.

Seems like the driver is detecting a problem then. Check for any errors in the output of dmesg.

If you installed a new OS to another SD card and that played audio over the analogue output, then that would at least confirm that it's a software problem rather than a hardware one. As you've been playing with the GPIO, it's more likely than usual that some damage might have been done by accident.

The file /proc/version should say the Linux version.

Some distros also add a file named something like /proc/distroversion that says which distro you're using, and its version.

--
__          __ 
#_ < |\| |< _#
Reply to
Computer Nerd Kev

On Thu, 19 Dec 2019 17:55:24 +0100, "R.Wieser" declaimed the following:

If you are running in a graphical environment (which I presume given mention of the speaker icon), try running a web browser and selecting something from YouTube. I will have to state that my R-Pi3B+ does not seem to be able to run VNC server and playback YouTube at real time -- BUT I do get sound off the analog jack.

In truth, I get sound on the analog output regardless of the analog or HDMI selection -- but the HDMI selection is completely illegible while analog selection is just running slow and rumbly.

Now -- if an HDMI monitor is connected... It may be that the HDMI driver overrides the selection based upon the information from the connected monitor. As mentioned, I'm remoting in using VNC viewer on Windows and the VNC server running on R-Pi.

pi@rpi3bplus-1:~$ uname -a Linux rpi3bplus-1 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux

3.2 should be Buster -- but the current full NOOBS is 3.2.1 dated September 30 (NOOBS Lite is 3.2 dated July 10 -- which maps to the formal release of Debian Buster)

The "alert" character only produces a sound if the terminal/console is configured to interpret the character and generate a sound. So, for example, if you used a SSH client to get to the R-Pi, then it would be upon that SSH client (and the computer it is running on) to produce the alert sound when the character is received by it.

If you are seeing a glyph in the console, then that console is mapping to a graphic character and not attempting to trigger a sound on whatever machine the console is running.

I don't even think the regular "terminal" on the R-Pi activates on . Using SSH, PuTTY on my Windows box produces a noise for the character (along with just trying to delete on an empty line), but a VNC session to the same R-Pi produces no sounds from a terminal console.

It is dependent upon the console in use

alert.py

-=-=-=- print("\a\a\a\a")

-=-=-=- pi@rpi3bplus-1:~$ python3 alert.py

produces a chime in PuTTY on Windows. Doing the same from an R-Pi console window in via VNC produces silence. (And this is on a machine where I do hear audio from YouTube, regardless of the analog/HDMI setting). Could not get sound from an MP3 in the VLC media player.

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

I have exactly the same problem, and also have found no solution. RPi3B+ and UbuntuMATE, one OS on ssd, another on SDCard, and amplified PC speakers. I have a Miniamp PHAT, but yet to try it. Power to the OS via GPIO, which is in the way, as is life.

--
Mark J 
From RISCOS 5.27 on a BeagleBoard-xM and Raspberry Pi2B 
 Click to see the full signature
Reply to
Mark J

Kev,

Any idea how I can check that ? 'Cause currently I can only guess to if, and if so, why that happens.

Also, I've re-run "speaker-test" directly after booting (with none of my (manually started, python) programs having run yet), and its still hdmi only.

The only thing I can currently think of is that I've enabled a few things, like SPI and I2C, as well as bluetooth.

Its confirmed.

I remembered that I had another sd card with the same, but never actually used OS on it (checked using "uname -a"), and it has no problem, using "speaker-test" outputting (stereo!) sound over the audio jack.

So, its a software and/or configuration problem. Any idea to how to figure out what causes it (other than to go thru time-consuming rounds of multiple re-installs and configurations of everything) ? A diagnostic program perhaps ?

Regards, Rudy Wieser

Reply to
R.Wieser

Dennis,

I (ofcourse?) tried both the GUI as well as console-based suggestions that I could find. Alas, none of them made a difference.

But I remembered having another sd card with the same, but not actually used OS on it. It had no problem, using "speaker-test", to output sound over the the audio jack. In other words: the only difference is that I used a default configuration and no extra packages (same KVM config).

On the first I did enable SPI, I2C and Bluetooth, and installed some packages. Might bluetooth be causing problems perhaps ? While pairing (with a smartphone) I did see something come by related to bluetooth audio ...

And although I've not been able to google anything in this regard, do you maybe know of a guide or maybe even a diagnostic program for problems like these ?

Linux raspberrypi 4.19.57-v7+ #1244 SMP Thu Jul 4 18:45:25 BST 2019 armv7l GNU/Linux (for both of the above mentioned sd cards)

While googeling I read it could be (nowerdays by default) disabled, yes (no mentioning about how to change that though :-\ )

:-) I ment that as "something build into Python". I read about a "beep" function, but that one needed another package to be installed.

I even tried an example that used writing to "/dev/audio", but it wouldn't work (but didn't throw an error either). Only when I read that that device was removed in v3.x I realized I had just been creating and writing to a simple file. :-|

Regards, Rudy Wieser

Reply to
R.Wieser

None too sure about from python but from a shell prompt:

echo ^G

should work. You type the control-G (ASCII BEL) at the command line by first typing control-V (which prevents the CLI interpreter from mangling the next character) then control-G. This should work from any terminal or console in just about any unix-like environment.

--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:\>WIN                                     | A better way to focus the sun 
 Click to see the full signature
Reply to
Ahem A Rivet's Shot

Do you have "hdmi_drive=2" set in /boot/config.txt? Do you have alsa-utils installed? If so what does "amixer cget numid=3" say? Have you tried raspi-config, advanced options?

--

Chris Elvidge, England
Reply to
Chris Elvidge

Chris,

Thats for hdmi (which audio works), and I have problems with analog sound.

And it has not been set for either of the sd cards (one with working sound, the other not)

How would I know / how do I check ?

numid=3,iface=MIXER,name='Master Playback Volume' ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1 : values=39977

What does that mean to you / why should it be of any importance to me ?

(and I suppose those alsa-utils are installed. :-) )

Yes. But what specific where you thinking of ?

Regards, Rudy Wieser

Reply to
R.Wieser

Yes. It forces HDMI output. It stops jack (analog) output.

amixer cget numid=3 gets mixer value amixer cset numid=3 VALUE sets mixer value to VALUE where VALUE=0 -> auto VALUE=1 -> analog VALUE=2 -> hdmi

What 39977 means, sorry, I have no idea.

sudo raspi-config

7 : Advanced options A4 : Audio Sets audio to Auto, Analog or HDMI

--

Chris Elvidge, England
Reply to
Chris Elvidge

Chris,

??? What I read was that it had something to do with hdmi vs dvi. "dvi == audio jack ?

Also, what is the below "7 : Advanced options" than for ?

But I forgot to mention that on both sd cards that line was commented out (no forcing).

Yep, that was also one of the things I tried.

The current selected volume. A bit above 50%

Tried that too: "Currently I even have set "raspi-config" to force sound over the audio-jack, but it seems to gets ignored."

Regards, Rudy Wieser

Reply to
R.Wieser

On Fri, 20 Dec 2019 09:52:42 +0100, "R.Wieser" declaimed the following:

Well -- you could boot with the working card, then capture the output of dmesg to a file, copy the file to some other computer...

Then boot with the problem card, repeat dmesg capture and copy.

Compare the two captures. See if something pops out.

formatting link

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

On Fri, 20 Dec 2019 10:36:36 +0100, "R.Wieser" declaimed the following:

Possible... after all, if you are paired as an audio device (equivalent of BlueTooth Speakers) it might be trying to route audio to the phone, where it is expected that some player application renders it.

I have BT turned off, but still get some stuff in dmesg

pi@rpi3bplus-1:~$ dmesg |grep -i audio [ 5.024244] bcm2835_audio soc:audio: card created with 8 channels pi@rpi3bplus-1:~$ dmesg |grep -i blue [ 20.888319] Bluetooth: Core ver 2.22 [ 20.888381] Bluetooth: HCI device and connection manager initialized [ 20.888397] Bluetooth: HCI socket layer initialized [ 20.888405] Bluetooth: L2CAP socket layer initialized [ 20.888425] Bluetooth: SCO socket layer initialized [ 20.952233] Bluetooth: HCI UART driver ver 2.3 [ 20.952242] Bluetooth: HCI UART protocol H4 registered [ 20.952301] Bluetooth: HCI UART protocol Three-wire (H5) registered [ 20.952435] Bluetooth: HCI UART protocol Broadcom registered [ 21.719400] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 21.719417] Bluetooth: BNEP filters: protocol multicast [ 21.719466] Bluetooth: BNEP socket layer initialized [ 21.867592] Bluetooth: RFCOMM TTY layer initialized [ 21.867628] Bluetooth: RFCOMM socket layer initialized [ 21.867667] Bluetooth: RFCOMM ver 1.11 pi@rpi3bplus-1:~$

pi@rpi3bplus-1:~$ sudo apt search alsa |grep installed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

alsa-base/stable,now 1.0.27+1 all [installed,automatic] alsa-utils/stable,now 1.1.8-2 armhf [installed] bluealsa/testing,now 0.13 armhf [installed,automatic] gstreamer0.10-alsa/testing,now 0.10.36-2 armhf [installed,automatic] gstreamer1.0-alsa/stable,now 1.14.4-2 armhf [installed] libasound2/testing,now 1.1.8-1+rpt1 armhf [installed,automatic] libasound2-data/testing,now 1.1.8-1+rpt1 all [installed,automatic] libavdevice58/testing,now 7:4.1.4-1+rpt1~deb10u1 armhf [installed,automatic] libgcrypt20/stable,now 1.8.4-5 armhf [installed] libmikmod3/stable,now 3.3.11.1-4 armhf [installed,automatic] libopenal1/stable,now 1:1.19.1-1 armhf [installed,automatic] librtaudio6/stable,now 5.0.0~ds-3 armhf [installed,automatic] librtmidi4/stable,now 3.0.0~ds1-2+b1 armhf [installed,automatic] libsdl1.2debian/testing,now 1.2.15+dfsg2-4+rpt2 armhf [installed,automatic] libsdl2-2.0-0/testing,now 2.0.9+dfsg1-1+rpt1 armhf [installed,automatic] lxplug-volume/testing,now 0.18 armhf [installed,automatic] sound-theme-freedesktop/stable,now 0.8-2 all [installed,automatic] pi@rpi3bplus-1:~$

No idea if installing alsa-tools and/or alsa-tools-gui provide anything useful.

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

Update:

I bought another sd card and again installed NOOBS v3.2.0 on it. Sound worked both over hdmi and analog, with speaker-test -t sine -f 1000 -c 2 -s 1 and speaker-test -t sine -f 1000 -c 2 -s 2 sounding over left and right analog channels. As far as I could tell the loudspeaker rightclick menu retained its checkmark, and the volume slider stayed where it was when changing from analog to hdmi or vise-verse

Than I installed Bluetooth: sudo apt-get update (otherwise the following throws a number of errors) sudo apt-get install bluetooth bluez blueman

I noticed it updated a number of things, including some pulseaudio stuff. I than re-did the above speaker test and got only mono sound. The tickmark didn't want to stick anymore, and the volue slider dropped back to almost zero on every analog hdmi change. :-(

It looks that /something/ that got updated doesn't play all to well with noobs v3.2.0 ...

I than ran sudo apt-get upgrade (and rebooted) to see if it would help. Alas, it didn't. :-(

Although I still have analog sound on this installation, its just mono with disappearing tickmarks and dropping-to-near-zero volume sliders.

And it ofcourse doesn't explain why I do not have sound on the other installation.

Regards, Rudy Wieser

Reply to
R.Wieser

Pulseaudio is the devil and should be destroyed. Sudo apt purge pulseaudio. Audio and bluetooth, but mostly bluetooth, never worked well on Raspbian, especially since that Simon dude started working on it at the RPi Foundation. He threw pulseaudio into the mix.

I always purge pulseaudio and disable bluetooth in config.txt. Problems solved.

Reply to
A. Dumas

Dennis,

Oh bother! On the newly created sd card (bluetooth and upgraded) whenever I now try to open the filemanager it gets directly closed. :-((

I don't know what is happening, but its not even funny anymore.

Regards, Rudy Wieser

Reply to
R.Wieser

On Fri, 20 Dec 2019 18:23:15 +0100, "R.Wieser" declaimed the following:

Well -- that is recommended anytime one plans to install packages and it has been some days since the last time packages were installed. It downloads the list of available packages and their version/dependencies so that changes can be determined.

blueman is the package that claims to need pulseaudio (Debian site only shows it as "recommended", not required

formatting link
). Do you really need a graphical bluetooth manager?

formatting link
""" Blueman and PulseAudio

Users who want to use PulseAudio with a Bluetooth headset, in addition to installing pulseaudio-bluetooth, may want to activate the PulseAudio plugin of Blueman. This automatically loads PulseAudio Bluetooth module after audio device is connected and plays all audio through the Bluetooth headset. For more information see Bluetooth headset """

NOTE: plays all audio through the Bluetooth headset -- which may be any paired phone...

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

While it is modern policy that all Recommended packages should be installed automatically, I have had no problems as a result of not doing that. Be warned that my usage pattern is not typical and this may still cause problems for you.

The easiest way to achieve this on Debian (including Raspbian) is to create a file /etc/apt/apt.conf.d/50norecommends with the contents:

Apt::Install-Recommends "false";

and this is part of my standard post-installation procedure on any Debian host.

Reply to
Roger Bell_West

Alexandre,

I installed bluetooth just to send commands from a smartphone to the Pi (serial connection). I (currently) do not really need audio (can't remember what the third pairing was).

Any idea how to install and/or partially remove bluetooth ?

Regards, Rudy Wieser

Reply to
R.Wieser

Dennis,

I don't know if I /need/ it, but it made the pairing process rather easy.

I guess it could not hurt to have the sd card reinstall itself, install bluetooth without blueman and see if the analog audio stays stereo (and the tickmark stays, and the volume-slider doesn't reset every time :-) ).

I did not activate that "PulseAudio plugin" though. Will check tomorrow if I can see if its maybe enabled nonetheless.

I imagined to see that selection in menu you get by rightclicking that speaker icon. The smartphone might well not even be in the same room as the Pi.

Regards, Rudy Wieser

Reply to
R.Wieser

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.