Open roobyz opened 8 years ago
This worked for me, I've just updated to 4.7-2 and hit this same issue.
try editing the file /etc/pulse/default.pa
and comment out the following two lines.
55 #load-module module-alsa-source device=hw:0,1
56 #load-module module-alsa-source device=hw:0,2
Then start the Pulse-Audio server $ pulseaudio
You'll probably also want to nuke /etc/acpi/{actions/samus.sh,events/samus}
.
EDIT: /opt/samus
and /usr/share/alsa/ucm/bdw-rt5677
can probably go as well. Am I missing anything?
Headphone Jack/Speaker toggle isn't working for me. I guess it means tweaking an acpi event handling script?
Thanks, that mostly worked... here is what I did:
1) edit the file /etc/pulse/default.pa
and ensure these lines are commentted out:
#load-module module-alsa-sink device=hw:0,0
#load-module module-alsa-source device=hw:0,1
#load-module module-alsa-source device=hw:0,2
2) remove the following folders: /opt/samus
and /usr/share/alsa/ucm/bdw-rt5677
3) edit the file /etc/acpi/handler.sh
and remove any samus entries
As sambles pointed out, the missing piece is... add entries in /etc/acpi/handler.sh
for the jack/headphone)
event handlers plug)
and unplug)
with ones that work.
Could be useful to have these instructions on the README.md file for those upgrading kernels. :)
Yes please! :)
@raphael ... I proposed a README.md change, as requested. This is my first... so hopefully I got it correct. :)
Yeah... that's definitely weird, because I checked you repo and my repo around lunch time and it was good... but then around dinner time it looked like it disappeared.
Give me a few minutes and I'll recreate... ;)
i'm getting no sound of my speakers. this is a fresh install. pavucontrol says there's sound coming out.
as for the headphones not working, i get this from dmesg
$ dmesg | grep jack
[ 6.416834] rt5677 i2c-RT5677CE:00: Can't add headphone jack gpio
[ 6.416882] rt5677 i2c-RT5677CE:00: Can't add mic jack gpio
@wulvyrn have you checked with alsamixer
that the outputs are not muted?
i don't believe so. I'm am willing to be wrong. amixer output below and alsamixer screenshot.
amixer
Simple mixer control 'Master',0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 65536
Mono:
Front Left: Playback 65536 [100%] [on]
Front Right: Playback 65536 [100%] [on]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left - Front Right
Limits: Capture 0 - 65536
Front Left: Capture 65536 [100%] [on]
Front Right: Capture 65536 [100%] [on]
@raphael Alsamixer screenshot.
Stereo DAC MIXL DAC1 L (was muted) umuting sound plays.
On a fresh install, this was not easy to find.
command line method
amixer -c 0 cget name='Stereo DAC MIXL DAC1 L Switch'
numid=190,iface=MIXER,name='Stereo DAC MIXL DAC1 L Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
i used this to enable both channels
amixer -c 0 cset name='Stereo DAC MIXL DAC1 L Switch' on
amixer -c 0 cset name='Stereo DAC MIXR DAC1 L Switch' on
I went back and did a fresh install. these are the initial settings
amixer -c 0 cget name='Stereo DAC MIXL DAC1 L Switch'
amixer -c 0 cget name='Stereo DAC MIXR DAC1 L Switch'
amixer -c 0 cget name='DAC1 MIXL DAC1 Switch'
amixer -c 0 cget name='DAC1 MIXR DAC1 Switch'
numid=190,iface=MIXER,name='Stereo DAC MIXL DAC1 L Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=196,iface=MIXER,name='Stereo DAC MIXR DAC1 L Switch'
; type=BOOLEAN,access=rw------,values=1
: values=off
numid=176,iface=MIXER,name='DAC1 MIXL DAC1 Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
numid=178,iface=MIXER,name='DAC1 MIXR DAC1 Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
@wulvyrn : If you haven't noticed since you posted about it, I wanted to mention that at least in terms of getting audio to play, the messages Can't add {headphone,mic} jack gpio
are a red herring. I see them despite both laptop-speaker and headphone audio working. @reynhout observed based on reading the code, and I agree, that they appear to do with the detection of headphones being plugged/unplugged. So, headphones can be inserted and audio will play through them, it just appears that the kernel won't notice this event happening. So that appears to still need fixing.
Lastly, I have audio working with plain ALSA, without pulseaudio, and just wanted to mention that in case you hoped to work with something simpler.
@genkimarshall thanks, i'll uninstall pulseaudio and see if it works that way. thanks.
@genkimarshall on a fresh install, alsa still has the same results I reported above and no audio from the speakers. i also noticed the audio is swapped from the speakers by enabling and disabling these commands:
amixer -c 0 cset name='Stereo DAC MIXL DAC1 L Switch' on
amixer -c 0 cset name='Stereo DAC MIXR DAC1 L Switch' on
i'll have to look for a solution on that. I have not tried the headphones figuring getting speaker audio was the 1st priority and then headphone 2nd.
From a fresh install with no preexisting custom sound config, I needed to enable these ten ALSA channels:
The first two are fairly early in the alsamixer
scroll. The last eight are toward the end. Or you can enable them from the command line.
That's all the config required to get audio out. The bdw-rt5677
card shows up in slot 1 instead of 0, so I might end up replacing the /etc/modules.d
file.
using just alsa, i'm having a hard time setting the volume up and down to be consistent. so far, being able to mute or unmute or toggle Master has eluded me. it was working nicely with i3status and pulseaudio...
A few thoughts: 1) my speaker sound is working fine 2) After putting these notes on the README...
3) I started experimenting on how I might get the headphones to toggle... so I agree that "Can't add headphone jack gpio" is a red herring because:
alsaucm -c bdw-rt5677 set _verb HiFi set _enadev Headphone
however I couldn't get the speakers back with alsaucm -c bdw-rt5677 set _verb HiFi set _disdev Headphone
/usr/share/alsa/ucm/bdw-rt5677
againHIFI.conf
and realized that the setting for cset "name='Speaker Switch' on"
must be broken somehow.I'm not an expert on those files, but I believe that if we correct HIFI.conf we could use the following acpi setting to get the toggle working:
jack/headphone)
case "$3" in
plug)
logger "headphone plugged"
alsaucm -c bdw-rt5677 set _verb HiFi set _enadev Headphone
;;
unplug)
logger "headphone unplugged"
alsaucm -c bdw-rt5677 set _verb HiFi set _disdev Headphone
;;
*)
logger "ACPI action undefined: $3"
;;
esac
;;
vice changing the ten channels as @reynhout posted above, i found enabling two produced correct left and right speakers.
amixer -c 0 cset name='Stereo DAC MIXL DAC1 R Switch' on
amixer -c 0 cset name='Stereo DAC MIXR DAC1 L Switch' on
to test, i was using:
speaker-test -c2 -l1 -twav
note below: the two top ones are turn on from the default installation. this is the script i'm currently using (there are also other entries from testing i.e. the off ones):
#amixer -c 0 cset name='DAC1 MIXL DAC1 Switch' on
#amixer -c 0 cset name='DAC1 MIXR DAC1 Switch' on
amixer -c 0 cset name='Stereo DAC MIXL DAC1 L Switch' off
amixer -c 0 cset name='Stereo DAC MIXL DAC1 R Switch' on
amixer -c 0 cset name='Stereo DAC MIXL DAC2 L Switch' off
amixer -c 0 cset name='Stereo DAC MIXL ST L Switch' off
amixer -c 0 cset name='Stereo DAC MIXR DAC1 L Switch' on
amixer -c 0 cset name='Stereo DAC MIXR DAC1 R Switch' off
amixer -c 0 cset name='Stereo DAC MIXR DAC2 R Switch' off
amixer -c 0 cset name='Stereo DAC MIXR ST R Switch' off
@wulvyrn I took what you posted last with what I got from HiFi.conf and created a brute force approach.
I created two scripts:
1) /usr/local/bin/samus_headphones_ena.sh
to enable headphones:
#!/bin/sh
amixer -c 0 cset name='Speaker Switch' off
amixer -c 0 cset name='Stereo DAC MIXL DAC1 R Switch' off
amixer -c 0 cset name='Stereo DAC MIXR DAC1 L Switch' off
amixer -c 0 cset name='OUT1 Playback Switch' on
amixer -c 0 cset name='OUT2 Playback Switch' on
amixer -c 0 cset name='Headphone Switch' on
2) /usr/local/bin/samus_headphones_dis.sh
to enable speakers:
#!/bin/sh
amixer -c 0 cset name='Headphone Switch' off
amixer -c 0 cset name='Stereo DAC MIXL DAC1 R Switch' on
amixer -c 0 cset name='Stereo DAC MIXR DAC1 L Switch' on
amixer -c 0 cset name='Stereo DAC MIXL DAC1 L Switch' off
amixer -c 0 cset name='Stereo DAC MIXR DAC1 R Switch' off
amixer -c 0 cset name='Speaker Switch' on
The scripts work as expected. All we need now is an elegant approach. :)
I noticed that my computer is not registering any headphone plug
and unplug
events, so I need to manually run the scripts when I swap headphones/speakers. I think this may be related to "Can't add headphone jack gpio" kernel error. My theory is that although headphones are working, the kernel doesn't recognize them as active so doesn't send the events.
Any ideas?
I'm also having difficulties getting sound to work. alsa
programs won't start and my dmesg
is flooded with this message:
[ 1722.498164] haswell-pcm-audio haswell-pcm-audio: ipc: --message timeout-- ipcx 0x83000000 isr 0x00000000 ipcd 0x00000000 imrx 0x7fff0000
[ 1722.498172] haswell-pcm-audio haswell-pcm-audio: error: stream commit failed
[ 1722.498176] System PCM: error: failed to commit stream -110
[ 1722.498180] haswell-pcm-audio haswell-pcm-audio: ASoC: haswell-pcm-audio hw params failed: -110
[ 1722.498183] System PCM: ASoC: hw_params FE failed -110
Looking around, I saw that it might be related to gdm
https://bugs.archlinux.org/task/48936.
Has anyone had the same issue?
@nilswiersma I had similar issues running just alsa. I reverted back to pulseaudio pulseaudii-alsa to no errors per say and a working volume control commands as referenced in the readme. Note: I'm not running GDM, just i3.
You removed alsa completely?
I've also tried recompiling with CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y
as suggested, but it did not solve anything so far.
Pulseaudio and pulseaudio-alsa with alsa-uitils is my base sound packages.
Ah, I think removing all the alsa-*
packages and then reinstalling them has fixed the issue.
Now to get headphones and displayport audio to work..
Tested out the new 4.7.2 kernel, sound output works better this time out of the box. Observations with initial default (I believe) configurations:
speaker-test -c2 -l -twav
Upgrading from linux-image-4.4.2ph
went without a hitch following the instructions from @roobyz. As @chepurko stated, the headphone switch is still manual but the mic is detected, and in my case does seem to work as expected. If anyone needs information from my box I'm happy to help.
I am still receiving the dmesg output mentioned before. I think I have tried all different permutations of removing and adding pulseaudio and alsa. Removing all of them, rebooting, enabling the channels and doing the speak test works -- however when I open any other program that wants to send audio to the speakers the error spam reappears.
Anyone got any ideas where this issue could stem from?
I feel like we're using different machines with all the different symptoms we're getting.
$ dmesg | grep rt5677
[ 5.528676] bdw-rt5677 bdw-rt5677: snd-soc-dummy-dai <-> System Pin mapping ok
[ 5.530832] rt5677 i2c-RT5677CE:00: Can't add headphone jack gpio
[ 5.530893] rt5677 i2c-RT5677CE:00: Can't add mic jack gpio
[ 5.530958] bdw-rt5677 bdw-rt5677: rt5677-aif1 <-> snd-soc-dummy-dai mapping ok
[ 5.534440] input: bdw-rt5677 Headphone Jack as /devices/pci0000:00/INT3438:00/bdw-rt5677/sound/card0/input7
[ 5.534489] input: bdw-rt5677 Mic Jack as /devices/pci0000:00/INT3438:00/bdw-rt5677/sound/card0/input8
I have no headphone device in the sound settings panel, the scripts to enable/disable headphones by @roobyz run without error and change the mixer switch between headphones and speakers, as shown by alsamixer, but there is never any headphone output. The speakers work fine.
Reporting my sound behavior with latest linux-samus4 4.7-3 on Archlinux installed with yaourt.
All indications from dmesg and control panels is that audio is working, but my 2015 Pixel is silent. Output device shows up as "bdw-rt5677 Analog Stereo" and it has profies "Analog Stereo Dupliex" and "Analog Stereo Output" (neither of which produce any sound).
I checked and see that pulseaudio is already configured with 'autospawn = no'.
Having speakers work but not headphones would be a great improvement over what I have now. Should I zap my yaourt installation and build linux-samus from a Git pull (with make or "install.sh")?
@unsaved make sure the output is not muted in alsamixer
. Seems to be a common problem.
Thanks Raphael. I'm using kmix not alsamixer (it's not installed). It's enabled in kmix. If you think there's any chance of improvement, I can install and run alsamixer.
@unsaved Something like this script might help: https://github.com/GalliumOS/galliumos-samus/blob/master/usr/bin/samus-alsaenable-speakers
Script assumes the internal audio is on card 0 (the -c 0
part of the command lines)...would need to update if yours is not.
That worked. You're awesome!
nice, could I coerce you into sending a PR that adds these instructions to the README?
Certainly. I need to get this laptop built out and ready to take to work before I work on docs, but I will.
The scripts from GalliumOS/galliumos-samus worked to switch between my headphones and speakers, they have two more mixer switches for headphones than @roobyz's script twiddled.
So I have sound when I first boot, but when my laptop goes to sleep and wakes up, the sound no longer plays. It takes a reset to get it working again.
I tried rolling back the default.pa, tried commenting it out, I don't have an /opt/samus folder or a /usr/share/alsa/ucm/bdw-rt5677 folder, and I don't have a handler.sh file.
Running Xubuntu 16.04. Any ideas?
@roobyz I just have a slight change to your disable headphone script.
!/bin/sh
amixer -c 0 cset name='Headphone Switch' off
amixer -c 0 cset name='Stereo DAC MIXL DAC1 L Switch' on
amixer -c 0 cset name='Stereo DAC MIXR DAC1 R Switch' on
amixer -c 0 cset name='Stereo DAC MIXL DAC1 L Switch' off
amixer -c 0 cset name='Stereo DAC MIXR DAC1 R Switch' off
amixer -c 0 cset name='Speaker Switch' on
All I changed was the left and right labeling. You had them backwards, in that you were assigning the left DAC channel to the right channel in software and vice versa. While this isn't a big deal, it's the little things that count.
@Moovlin I haven't checked the @roobyz script, but the problem likely being solved there is that the speaker output is channel swapped, so it's necessary to unswap them when switching to headphones.
These work properly for me: https://github.com/GalliumOS/galliumos-distro/issues/100#issuecomment-241534837
Yes @Moovlin, @reynhout is correct. When disabling the headphones and re-enabling the speakers, the channels are swapped. What the script is doing is enabling the correctly swapped L/R channels which causes a mono-output and then disabling the incorrectly swapped L/R channel which gets you the corrected stereo outcome. I hope that helps.
Can't seem to get my sound working after waking from a suspend. Here is the log. Maybe I have some residual settings from earlier kernels, or maybe it was something I screwed up on my own. Here is the log after waking.
` Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569811] ------------[ cut here ]------------
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569817] WARNING: CPU: 0 PID: 3230 at drivers/base/firmware_class.c:1124 _request_firmware+0x434/0xab0
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569842] Modules linked in: rfcomm fuse i2c_dev pci_stub vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) bnep arc4 joydev mousedev snd_soc_sst_bdw_rt5677_mach cros_ec_devs snd_soc_sst_haswell_pcm snd_soc_sst_ipc snd_soc_sst_dsp intel_rapl x86_pkg_temp_thermal intel_powerclamp kvm_intel kvm irqbypass cros_ec_lpc cros_ec crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd uvcvideo input_leds serio_raw videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core iwlmvm videodev mac80211 media snd_soc_rt5677 snd_soc_rl6231 atmel_mxt_ts snd_soc_rt5677_spi iwlwifi intel_pch_thermal cfg80211 sg lpc_ich acpi_als kfifo_buf snd_soc_sst_acpi battery industrialio ac snd_soc_sst_match 8250_dw i2c_designware_platform cros_kbd_led_backlight chromeos_pstore dw_dmac i2c_designware_core spi_pxa2xx_platform evdev tpm_tis tpm btusb btrtl btbcm btintel bluetooth rfkill sunrpc ext4 crc16 jbd2 mbcache uas usb_storage sd_mod atkbd libps2 crc32c_intel ahci libahci libata xhci_pci scsi_mod xhci_hcd usbcore usb_common thermal i8042 serio gpio_lynxpoint sdhci_acpi sdhci led_class fjes mmc_core
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569858] CPU: 0 PID: 3230 Comm: kworker/u8:1 Tainted: G O 4.7.2-ph+ #1
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569859] Hardware name: GOOGLE Samus, BIOS 04/02/2015
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569862] Workqueue: events_unbound async_run_entry_fn
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569864] 0000000000000000 ffff88042873fc68 ffffffff812700a2 0000000000000000
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569866] 0000000000000000 ffff88042873fca8 ffffffff81060671 000004642873fcb8
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569867] ffffffffa0432b76 ffff880468e8c858 ffff88041fe9fde0 ffff88041326d780
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569867] Call Trace:
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569871] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569872] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569874] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569875] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569876] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569878] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569879] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569882] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569883] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569884] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569886] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569887] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569888] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569890] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569891] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569892] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569893] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569895] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569896] [
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569897] ---[ end trace cf18c823c9370abd ]---
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569899] rt5677 i2c-RT5677CE:00: firmware: rt5677_dsp_fw1.bin will not be loaded
Sep 23 10:52:09 nicholas-Samus kernel: [ 2026.569901] ------------[ cut here ]------------`
for some reason, sound is not working for me on kernel 4.8 (debian testing). Here's the dmesg:
dmesg| grep rt5677
[ 41.938354] bdw-rt5677 bdw-rt5677: ASoC: CPU DAI System Pin not registered
[ 41.949630] bdw-rt5677 bdw-rt5677: ASoC: CPU DAI System Pin not registered
[ 41.949763] bdw-rt5677 bdw-rt5677: ASoC: CPU DAI System Pin not registered
[ 42.264672] bdw-rt5677 bdw-rt5677: ASoC: CPU DAI System Pin not registered
$ amixer -c 0 cset name='DAC1 MIXL DAC1 Switch' on
Invalid card number.
$ lsmod | grep rt5677
snd_soc_sst_bdw_rt5677_mach 16384 0
snd_soc_sst_haswell_pcm 53248 1 snd_soc_sst_bdw_rt5677_mach
snd_soc_rt5677 208896 1 snd_soc_sst_bdw_rt5677_mach
snd_soc_rl6231 16384 1 snd_soc_rt5677
snd_soc_rt5677_spi 16384 1 snd_soc_rt5677
Any ideas what could be wrong? I tried setting the rt5677 in slot 0 (using a modprobe conf) and removing/commenting all the files according to the readme with no luck. Any idea what could be wrong?
nevermind. I was missing the firmware files. Copying them from this repo to /lib/firmware did the trick :)
I'd like to add: I had also those "ASoC: CPU DAI System Pin not registered" messages and the sound did not work after a fresh install of Debian.
Solution was to install the package firmware-intel-sound (which is unfortunately non-free) and restart.
Thanks for updating the kernel to the latest version. After upgrading, everything is working except for sound. The instructions for configuring sound were obviously simplified. I'm guessing that the issue is that my sound is still set for the custom configuration that was required for linux-samus 4.5, which is incompatible with 4.7-2. Any suggestions? Are there any instructions to switch the sound configurations? Thank again!