Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved]ALSA won't restore speakers after headphones removed
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
triquetra
n00b
n00b


Joined: 09 Apr 2012
Posts: 30
Location: Kansas, USA

PostPosted: Sun Apr 22, 2012 1:48 am    Post subject: [Solved]ALSA won't restore speakers after headphones removed Reply with quote

I've had some problems with ALSA playing though my internal laptop speakers. I generally use external speakers (plugged into the headphone jack), but sometimes I use the laptop with its internal speakers. The latter does not always work.

I've been searching the forums and google for hours. What I've discovered is that it appears that my sound configuration is (mostly) correct. That is, if I boot into Gentoo with the external speakers DISconnected, then the internal speakers work fine until I plug in the external speakers. Then ALSA sets the internal speakers to 0 (db Gain of -64, -64). That's as expected, since I don't need (or want) sound from my internal speakers if my external speakers are attached. However, after unplugging my external speakers, ALSA does NOT restore the settings on my internal speakers automatically. I can start up alsamixer and manually restore the internal speakers and they work fine again, but . . . :roll:

Similarly, if I boot with my external speakers attached the internal speakers are set at 0 (db Gain of -64, -64). Removing the external speakers does NOT automatically restore the internal speakers, though again I can do this manually through alsamixer.

Does anyone know how to get ALSA to automatically restore the internal laptop speakers after unplugging headphones/external speakers?

uname -a:
Linux dpc-gentoo 3.3.2-gentoo #1 SMP Sat Apr 21 11:55:05 CDT 2012 i686 Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz GenuineIntel GNU/Linux

lspci | grep -i audio:
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)

dmesg | grep -i hda:
[   38.204733] snd_hda_intel 0000:00:1b.0: irq 48 for MSI/MSI-X
[   39.770046] input: HDA Intel Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input5
[   39.770152] input: HDA Intel Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input6

aplay -l:
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC268 Analog [ALC268 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

aplay -L:
sysdefault:CARD=Intel
    HDA Intel, ALC268 Analog
    Default Audio Device
front:CARD=Intel,DEV=0
    HDA Intel, ALC268 Analog
    Front speakers
surround41:CARD=Intel,DEV=0
    HDA Intel, ALC268 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
    HDA Intel, ALC268 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround71:CARD=Intel,DEV=0
    HDA Intel, ALC268 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers

cat /proc/asound/card0/codec#0 | grep Codec:
Codec: Realtek ALC268


Last edited by triquetra on Sun May 20, 2012 3:08 am; edited 1 time in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7020

PostPosted: Sun Apr 22, 2012 4:48 am    Post subject: Reply with quote

Sounds like the nastiness of /usr/src/linux/sound/pci/hda/patch_realtek.c

Google with the name/model of your laptop/motherboard, and "alsa". Because it's very doubtful that you are the first to experience this problem - see if others have solved it.
Back to top
View user's profile Send private message
triquetra
n00b
n00b


Joined: 09 Apr 2012
Posts: 30
Location: Kansas, USA

PostPosted: Tue Apr 24, 2012 3:09 am    Post subject: Reply with quote

No joy. I cannot find anyone reporting this issue. I have a Compal JFL92 laptop, and there are other sound errors reported, but not this one.

After further investigation, I don't think this is an issue with my system. I think its a Gentoo issue. The reason I say this is that I currently have a tri-boot system (Win7 - Arch - Gentoo). Arch has no problems with this. In Arch, I opened alsamixer while I unplugged and re-plugged my external speakers, and I noticed that the internal speakers were neither muted nor was the gain altered, but no sound came from the internal speakers while the external speakers were plugged in, and when I unplugged the external speakers sound came from the internal speakers. Contrast this with my Gentoo install which BOTH mutes the internal speakers and reduces their gain to -64, -64 when I plug in the external speakers -- then when removing the external speakers the internal speakers are unmuted but the gain is left at -64, -64.

These effects are the result of the default configurations in Arch and Gentoo respectively on the same system.

Discerning the relevant differences between the Arch and Gentoo configurations is a bit beyond me. Could someone help me sort this out?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7020

PostPosted: Tue Apr 24, 2012 4:58 am    Post subject: Reply with quote

I assume you're using Gentoo's kernel 3.2.12, and Arch's 3.3.2

In which case, upgrade Gentoo's kernel - the current latest is 3.3.3
Back to top
View user's profile Send private message
triquetra
n00b
n00b


Joined: 09 Apr 2012
Posts: 30
Location: Kansas, USA

PostPosted: Tue Apr 24, 2012 3:18 pm    Post subject: Reply with quote

uname -a:
Linux dpc-gentoo 3.3.3-gentoo #1 SMP Tue Apr 24 09:25:26 CDT 2012 i686 Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz GenuineIntel GNU/Linux


Makes no difference. :(
Back to top
View user's profile Send private message
triquetra
n00b
n00b


Joined: 09 Apr 2012
Posts: 30
Location: Kansas, USA

PostPosted: Tue Apr 24, 2012 9:11 pm    Post subject: Reply with quote

I have discovered an easier way to reset the internal speakers. After removing the external speakers, I can press the "mute" key on my laptop. This mutes the Master audio control in alsamixer. Then, when I press the "mute" key again, it unmutes the Master and the internal speakers and resets the internal speakers to db gain of 0, 0.

Still not automatic, but better.
Back to top
View user's profile Send private message
triquetra
n00b
n00b


Joined: 09 Apr 2012
Posts: 30
Location: Kansas, USA

PostPosted: Fri May 04, 2012 12:21 am    Post subject: Reply with quote

uname -a:
Linux dpc-gentoo 3.3.4-gentoo #1 SMP Tue May 1 20:41:50 CDT 2012 i686 Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz GenuineIntel GNU/Linux


Still no difference. Although I have found a workaround with the mute key (as stated above), I'd still be interested in fixing this if someone has some ideas.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7020

PostPosted: Fri May 04, 2012 7:13 am    Post subject: Reply with quote

Try hda-verb.

Also, the ALSA bugzilla and kernel bugzilla.
Back to top
View user's profile Send private message
triquetra
n00b
n00b


Joined: 09 Apr 2012
Posts: 30
Location: Kansas, USA

PostPosted: Sun May 20, 2012 3:07 am    Post subject: Reply with quote

I haven't had time to give this much attention recently, but I've been updating my system daily, and now alsamixer works as expected. I'm not sure which update fixed it, but it's working now.

Marking as solved.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum