Sound output

Questions about codecs, DVD playback, web plugins...
Forum rules
Before you post please read how to get help
gnappi
Level 2
Level 2
Posts: 75
Joined: Fri Aug 31, 2012 1:39 pm

Sound output

Post by gnappi »

I have an HP Elite desk 800 RFF and it has audio outputs in the front and rear (one marked HF, the other marked HF/Speaker) as well as a treensy speaker built inside. With both the headphone and external speakers plugged in, only the headphones show up in the sound settings. The external speakers never show up in sound settings if not plugged into the HF jack. Unfortunately the front and rear output jacks are very inconveniently located so switching them all the time is a pain.

Note: Win 7 has no issues with recognizing any of the output jacks and sending audio to all outputs simultaneou8sly to al devices so it's not a HW issue.

It seems as if over the years many have had this issue and I have not seen a solution that addresses it?
User avatar
MrEen
Level 22
Level 22
Posts: 16673
Joined: Mon Jun 12, 2017 8:39 pm

Re: Sound output

Post by MrEen »

Hi gnappi,

The normal behavior of plugging in headphones is to mute the speakers. This is what is causing your issue.

If you run this command and post the output, I can give you some terminal commands that should allow switching between the two:

Code: Select all

curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999
That will output a few lines with a URL on the last line pointing to your sound setup.
gnappi
Level 2
Level 2
Posts: 75
Joined: Fri Aug 31, 2012 1:39 pm

Re: Sound output

Post by gnappi »

Thanks, I copied it and here's the output...
#!/bin/bash

# This file is part of PulseAudio.
#
# Copyright 2019 Russell Treleaven <rtreleaven@bunnykick.ca>
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

export LC_ALL=C
header='________________'
function cards_get {
local line
local re='/proc/asound/card([0-9])'
local cards=()
while read -r line; do
[[ $line =~ $re ]] && cards+="${BASH_REMATCH[1]} "
done <<< "$(ls --directory /proc/asound/card[0-9])"
echo $cards
}
function jacks_do {
local cards=($(cards_get))
for card in "${cards[@]}" ; do
echo "card=$card"
while read -r line; do
[[ $line != "" ]] && amixer -c$card cget "$line";
done <<< "$(amixer -c$card controls | grep Jack)"
done
}
function alsa_info_do {
alsa_info=$(which alsa-info.sh)
[ $alsa_info ] || alsa_info=$(which alsa-info)
[ $alsa_info ] || alsa_info='/usr/share/alsa-base/alsa-info.sh'
[ -f $alsa_info ] && {
$alsa_info --stdout
return
}
echo "neither alsa-info.sh or alsa-info were found"
}
function pulseaudio_ps_do {
ps aux | grep pulseaudio
}
function cmd_do {
echo "$header"
echo "> $1"
$1
}
cmds=(
'pulseaudio_ps_do'
'which pulseaudio'
'pidof pulseaudio'
'pulseaudio --version'
'pactl info'
'pactl list'
'cat /etc/pulse/daemon.conf'
'cat /etc/pulse/client.conf'
'cat /etc/pulse/default.pa'
'cat /etc/pulse/system.pa'
'ls -alt /dev/snd/*'
'lsof /dev/snd/*'
'jacks_do'
'aplay -L'
'arecord -L'
'alsa_info_do'
)
for cmd in "${cmds[@]}" ; do
cmd_do "$cmd"
done
User avatar
MrEen
Level 22
Level 22
Posts: 16673
Joined: Mon Jun 12, 2017 8:39 pm

Re: Sound output

Post by MrEen »

Ewww. Something went wrong there, and I'm not sure what. Try this one instead as it will also give me what is needed:

Code: Select all

wget http://www.alsa-project.org/alsa-info.sh -O alsa-info.sh && bash alsa-info.sh
The script will ask if you want to upload or save locally. Please choose the upload option, and paste the URL it'll give you when it finishes.
gnappi
Level 2
Level 2
Posts: 75
Joined: Fri Aug 31, 2012 1:39 pm

Re: Sound output

Post by gnappi »

wget http://www.alsa-project.org/alsa-info.sh -O alsa-info.sh && bash alsa-info.sh
gnappi
Level 2
Level 2
Posts: 75
Joined: Fri Aug 31, 2012 1:39 pm

Re: Sound output

Post by gnappi »

And thanks.
User avatar
MrEen
Level 22
Level 22
Posts: 16673
Joined: Mon Jun 12, 2017 8:39 pm

Re: Sound output

Post by MrEen »

Something is going wrong here. Did the script run? If so, you didn't copy the URL, and still had the command in your Copy buffer.
gnappi
Level 2
Level 2
Posts: 75
Joined: Fri Aug 31, 2012 1:39 pm

Re: Sound output

Post by gnappi »

gnappi
Level 2
Level 2
Posts: 75
Joined: Fri Aug 31, 2012 1:39 pm

Re: Sound output

Post by gnappi »

Sorry, dunno why it did not copy the first time.
User avatar
MrEen
Level 22
Level 22
Posts: 16673
Joined: Mon Jun 12, 2017 8:39 pm

Re: Sound output

Post by MrEen »

There, we got a good output! :D

In the terminal Ctrl+C often doesn't work, and needs to be Shift+Ctrl+C. Just guessing here what the issue might have been.

I'm looking at the output now and should have a command for you test in a couple of minutes.
User avatar
MrEen
Level 22
Level 22
Posts: 16673
Joined: Mon Jun 12, 2017 8:39 pm

Re: Sound output

Post by MrEen »

Okay, it appears you're getting sound right now from the speakers. I would assume that means the headphones weren't plugged in. Once you plug in the headphones, the output will probably switch to them, then this command should work to switch back and forth between them:

Code: Select all

amixer -c 1 set Headphone toggle && amixer -c 1 set 'Line Out' toggle
Some cards get finicky and mute other things they shouldn't, so please let me know if that works.
gnappi
Level 2
Level 2
Posts: 75
Joined: Fri Aug 31, 2012 1:39 pm

Re: Sound output

Post by gnappi »

No sound anywhere now
User avatar
MrEen
Level 22
Level 22
Posts: 16673
Joined: Mon Jun 12, 2017 8:39 pm

Re: Sound output

Post by MrEen »

gnappi wrote:
Sat Oct 03, 2020 3:42 pm
No sound anywhere now
Okay, let's see the output of amixer -c1 please.
gnappi
Level 2
Level 2
Posts: 75
Joined: Fri Aug 31, 2012 1:39 pm

Re: Sound output

Post by gnappi »

Code: Select all

amixer -c1
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 87
  Mono: Playback 79 [91%] [-6.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
Simple mixer control 'Headphone+LO',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 87 [100%] [0.00dB]
  Front Right: Playback 87 [100%] [0.00dB]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 87
  Mono:
  Front Left: Playback 0 [0%] [-65.25dB] [off]
  Front Right: Playback 0 [0%] [-65.25dB] [off]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 254 [100%] [-0.20dB]
  Front Right: Playback 254 [100%] [-0.20dB]
Simple mixer control 'Line',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Line Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Line Out',0
  Capabilities: pswitch
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [off]
  Front Right: Playback [off]
Simple mixer control 'Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 0 [0%] [-34.50dB] [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off]
Simple mixer control 'Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 19 [61%] [12.00dB] [on]
  Front Right: Capture 19 [61%] [12.00dB] [on]
Simple mixer control 'Capture',1
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 0 [0%] [-16.50dB] [off]
  Front Right: Capture 0 [0%] [-16.50dB] [off]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Speaker Only' 'Line Out+Speaker'
  Item0: 'Line Out+Speaker'
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Mic' 'Line'
  Item0: 'Mic'
Simple mixer control 'Input Source',1
  Capabilities: cenum
  Items: 'Mic' 'Line'
  Item0: 'Mic'
Simple mixer control 'Loopback Mixing',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Last edited by MrEen on Sat Oct 03, 2020 3:47 pm, edited 1 time in total.
Reason: Added code tags to preserve formatting.
User avatar
MrEen
Level 22
Level 22
Posts: 16673
Joined: Mon Jun 12, 2017 8:39 pm

Re: Sound output

Post by MrEen »

Are the headphones plugged in and were you getting sound from them before running the command?
gnappi
Level 2
Level 2
Posts: 75
Joined: Fri Aug 31, 2012 1:39 pm

Re: Sound output

Post by gnappi »

I moved the HF to another jack and they have sound now, no speakers
User avatar
MrEen
Level 22
Level 22
Posts: 16673
Joined: Mon Jun 12, 2017 8:39 pm

Re: Sound output

Post by MrEen »

gnappi wrote:
Sat Oct 03, 2020 3:49 pm
I moved the HF to another jack and they have sound now, no speakers
Okay, run this again, and it should switch to the speakers and silence the headphones:

Code: Select all

amixer -c 1 set Headphone toggle && amixer -c 1 set 'Line Out' toggle
gnappi
Level 2
Level 2
Posts: 75
Joined: Fri Aug 31, 2012 1:39 pm

Re: Sound output

Post by gnappi »

Everything goes away till I unplug HF and speakers and plug speakers in, then speakers only
User avatar
MrEen
Level 22
Level 22
Posts: 16673
Joined: Mon Jun 12, 2017 8:39 pm

Re: Sound output

Post by MrEen »

Okay, let's see if this fixes that:

Code: Select all

amixer -c 1 set 'Auto-Mute Mode' Disabled
Then try the other command again and see if things function properly.
gnappi
Level 2
Level 2
Posts: 75
Joined: Fri Aug 31, 2012 1:39 pm

Re: Sound output

Post by gnappi »

Almost the same issue, but a tad different. If I plug HF in anywhere, the speakers die, but unplugging the HF and the speakers cone right back.
Post Reply

Return to “Sound, Multimedia, & Codecs”