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) ?
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.
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/
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
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 ?
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. :-|
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
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?
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
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.
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.
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/
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.
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 ?
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.
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.