raphael / linux-samus

Linux 4.16 on Chromebook Pixel 2015
GNU General Public License v2.0
181 stars 36 forks source link

Can't enable sound #173

Closed Moeflon closed 7 years ago

Moeflon commented 7 years ago

Whenever I execute the "enable-sound.sh" script, I get these errors:

amixer: Cannot find the given element from control hw:0

My Pixel is running a fresh install of Arch Linux. I installed the linux-samus4 AUR package and everything seems to work fine (brightness, touchscreen, touchpad) except the sound. I really don't know what I'm doing wrong here.

Any help would be appreciated.

victrcodes commented 7 years ago

The sound is gone for me too. I've done a fresh Ubuntu 16.10 install and I'm using the latest linux-samus 4.9 kernel. I can see speakers and microphone in UI Settings, but none of them are working. If I try to use the generic 4.9 kernel the sound and microphone are not even showing in settings. Headphones are not even showing at all (they used to before). This is a real shame, because with linux-samus 4.4 everything worked flawlessly. Any ideas what happened and where to look for a fix?

raphael commented 7 years ago

Did you follow the instructions in the readme to enable sound? Especially the section about upgrading from an older version if you upgraded from 4.4?

victrcodes commented 7 years ago

@raphael Thanks for the hint. This is a fresh Ubuntu 16.10 install with stock kernel 4.8 which I'm not using and running the linux-samus 4.9

So I realized that I only executed the "To enable audio" section, it never occurred to me that I have to run "To switch to speakers (note channel swapping)" every time I want to switch sound output device unlike before doing it from UI settings was enough. Thanks for that.

I have enabled the headphones the same way, but even though they're working, on the UI settings they are not even showing like they used to before, so it seems there's a disconnect somewhere between alsa and pulse/upper levels. As a possibly relevant side note - if I use bluetooth speaker it does show up on UI settings.

The built in microphone is still not working. Should it be enabled by default? There's no section mentioning it.

wulvyrn commented 7 years ago

using a fresh install of arch linux and i3 with the linux samus here: i get the same error above Moeflon has. Using the speaker-test, here are some results:

speaker-test -D default:bdwrt5677 -c 2

speaker-test 1.1.2

Playback device is default:bdwrt5677
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
ALSA lib conf.c:4817:(snd_config_expand) Unknown parameters bdwrt5677
ALSA lib pcm.c:2450:(snd_pcm_open_noupdate) Unknown PCM default:bdwrt5677
Playback open error: -22,Invalid argument
wulvyrn commented 7 years ago

changing the first part of the scripts from:

amixer -c 0

to

amixer -c 1

fixed this issue for me on a fresh install of arch linux and the samus kernel. using

aplay -l

gave which card was being used.

raphael commented 7 years ago

You can set the index of the driver in a modprobe config file, I've added a note to the README that explains how to do it. TL;DR create a file with extension .conf in the directory etc/modprobe.d with the content:

options snd_soc_sst_bdw_rt5677_mach index=0
options snd-hda-intel index=1

This guarantees the index of the drivers which can be random otherwise.

innovateworld commented 7 years ago

I am receiving the same error after updating from 4.4 to 4.9:

amixer: Cannot find the given element from control hw:0

I have completed all the Pre 4.7 steps and still nothing.

After running aplay -l I get the following result:

List of PLAYBACK Hardware Devices

card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: bdwrt5677 [bdw-rt5677], device 0: System Playback/Capture (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0

I created the sound.conffile and tried:

options snd_soc_sst_bdw_rt5677_mach index=1 options snd-hda-intel index=0

After that didn't work, I edited sound.conf and changed it to

options snd_soc_sst_bdw_rt5677_mach index=0 options snd-hda-intel index=1

Still Nothing.

Any suggestions?

Thanks

innovateworld commented 7 years ago

After a few more test and a reboot, I ran the enable-audio.sh and received the following output:

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

In sound settings I only see a Dummy Output device still.

Honest-Objections commented 7 years ago

I have the exact same issue as innovateworld's first comment. Made the sound.conf file but still get amixer: Cannot find the given element from control hw:0 a clean Linux Mint install

List of PLAYBACK Hardware Devices card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: bdwrt5677 [bdw-rt5677], device 0: System Playback/Capture (*) [] Subdevices: 1/1 Subdevice #0: subdevice #0

nskaggs commented 7 years ago

@Honest-Objections @innovateworld Notice the device is card 1, not card 0. Change the scripts to run against 1, not 0.

amixer -c 0 * ====> amixer -c 1

Honest-Objections commented 7 years ago

Appreciate the help, as a novice is wasn't clear (to me) if it was the same issue as mentioned earlier. Didn't want to break anything.

Running the enable-audio.sh and enable-speakers.sh scripts pointing to the System Playback device has indeed worked. Thanks again.

hyena commented 7 years ago

Not sure if this was the problem for other people, but I followed the instructions in upgrading from before 4.7 (I was upgrading to 4.10.1 from 4.4.2) and no dice. My issue was pulseaudio's default sink. Here's my timeline:

Initially I updated the ordering in /etc/modprobe.d/sound.conf as instructed and was plaeased that HDMI was no longer the default card in alsamixer. And pulseaudio started correctly after removing the lines from pulse audio's configuration as specified by the upgrade instructions. However paplay would still produce no sound for me.

After some debugging, I looked at the output of pacmd list-sinks and saw that index 0 was enabled which still referred to hdmi. I swapped this with pacmd "set-default-sink alsa_output.platform-bdw-rt5677.analog-stereo" which seems to have done the trick.

There was no default in my /etc/pulse/default.pa, so perhaps load-module module-default-device-restore was restoring a previous default incorrectly?

AndyClaridge commented 7 years ago

I'm having the same problem with a fresh install of Ubuntu 16.04. Everything works, but the sound. I suspect Raphael's suggestion is right except it would APPEAR I have no "sound.conf" file. When I try to save a new file there with that name, it says, "Could not save the file '/etc/modprobe.d/sound.conf' You do not have the permissions necessary to save the file". Maybe it's just that I am relatively inexperienced with Linux. Anybody able to point me in the right direction?

ehegnes commented 7 years ago

@AndyClaridge I hope I'm not terribly off the mark (you did say "relatively inexperienced"), but you probably don't have proper permissions.

Consider the following output from ls -ld /etc/modprobe.d:

drwxr-xr-x 2 root root 5 Mar 31 18:07 /etc/modprobe.d/

You need to be the root user to change the contents of files in /etc/modprobe.d. Prepend sudo to the command you use to copy or write the sound.conf file.

AndyClaridge commented 7 years ago

@ehegnes No, you're not off the mark. Thanks for your help. Maybe "relatively inexperienced" is an understatement, though I do remember fiddling with the sound.conf file without incident a couple of years ago to get sound working (with Ubuntu 14.xx?) on this machine. This time I don't know what happened. Maybe I can chalk it up to a bout of synaptic flatus or something.

Anyway, sound is working except for the microphone. If you have an idea what might be going on there, please pass it along. If not, don't sweat it; I use the mic infrequently anyhow. Thanks again.

ehegnes commented 7 years ago

@AndyClaridge phew glad that was helpful.

As for the mic, I run a script from the kind GalliumOS folk through ~/.xinitrc. Give it a shot — I believe it's been mentioned somewhere in these issues before.

One caveat of that script, though: you might have to change the card number given to amixer. It is 0 by default, but depending on how your kernel decides to organize sound cards (or perhaps, more appropriately, codecs?), it may a different number. Check it using aplay -l and look for the index of the bdw-rt5677 card.

If amixer isn't installed, you can find it in alsa-utils.

AndyClaridge commented 7 years ago

@ehegnes Thanks again. For some reason it was card 1 by default until I implemented Raphael's solution, with your help. The fact that I have sound tells me it is now card 0. So I'm confident your Gallium script will do the trick. Thank you yet again.