Crackly audio within Ubuntu crouton #791

Closed
theadamgreen1 opened this Issue Apr 21, 2014 · 31 comments

Comments

Projects
None yet
10 participants

Within Chrome OS, sound plays fine without any issues. When it comes to playing sound through Ubuntu (installed via crouton), the sound is crackly at all volume levels. I have tried using earphones, the crackl is played through those as well. I have tried uninstalling, reinstalling, changing distribution and powerwashing my Chromebook, to no avail. I am using the Acer C7, what can I do?I never had this issue before, I uninstalled Ubuntu to try LXDE, didn't like it so reinstalled Ubuntu, to find I have crackling audio, with Unity, LXDE, GNOME and Xfce.

screenshot 2014-04-21 at 12 55 43

So I ran croutonversion -u -d -c (see screenshot above)

After I ran sudo sh -e ~/Downloads/crouton -u -n saucy (see screenshot below)

screenshot 2014-04-21 at 12 58 13

I have tested the audio within chroot, I have the same output, crackly audio =(

Collaborator

drinkcat commented Apr 21, 2014

Ok. Can you post the output of sudo enter-chroot -n saucy croutonversion as well? (you can copy-paste by selecting text in crosh)

Here is the output for: chronos@localhost / $ sudo enter-chroot -n saucy croutonversion

Entering /usr/local/chroots/saucy...
crouton: version 1-20140421003218~master:609fe460
release: saucy
architecture: amd64
targets: unity
host: version 5712.29.0 (Official Build) beta-channel parrot_ivb
Unmounting /usr/local/chroots/saucy...

Collaborator

drinkcat commented Apr 21, 2014

Ok. Which audio player are you using?

Hi, I'm not using a player. The audio is distorted system wide across Ubuntu. Sounds from web browsers, media players, games, notifications, logon sounds, everything is crackly.

Collaborator

drinkcat commented Apr 21, 2014

Ok. What about aplay -Dcras /usr/share/sounds/alsa/Front_Center.wav?
What is the output of ps -eaf | grep pulseaudio?

When I run the first command, the sound clears clearly without any problems or crackles:

screenshot 2014-04-21 at 15 47 59

The output of "ps -eaf | grep pulseaudio" is in the screenshot below.

screenshot 2014-04-21 at 15 49 15

@drinkcat What does this output mean? Am I stuck with crackly audio? Because I didn't have this issue before and I don't understand why it has just cropped up for some reason.

Collaborator

drinkcat commented Apr 22, 2014

@theadamgreen1 : Basically, audio that is routed straight to Chrome Audio Server (CRAS) is working fine, but there is a problem when it is routed through pulseaudio first. I have not been able to reproduce on Acer C720, dev channel (5764.0.0). I'll try beta channel.

What you can try (in this order):

  • Reboot the Chromebook and try again (but I suspect you did that already...)
  • Try out precise or trusty instead of saucy (it looks like you also tried that)
  • Switch back to Chrome OS stable channel (that'll require a powerwash: backup your data), or dev channel.

I have rebooted the Chromebook, no change.
I've tried out Trusty, and in the process of installing Precise.
I will also experiment with other channels (quite wary to try out developer channel because it screwed up my video output before), but I'll try

Collaborator

drinkcat commented Apr 22, 2014

Video output? That might be interesting...
Is your problem happening only when your HDMI cable is connected? Could you try removing it, rebooting, and see if the problem happens if you don't connect the cable?

On screen as well, but I managed to get round it by disabling developer mode forcing a powerwash (this is on Chrome OS, didn't try Ubuntu at the time).

Collaborator

drinkcat commented Apr 22, 2014

Not sure if I was clear. HDMI also carries audio, so I'm wondering if having a HDMI cable connected could somehow confuse CRAS/pulseaudio and cause your sound problems... Hence the idea: if you do have an HDMI cable connected: disconnect it, reboot, then try again with Ubuntu.

Oh, sorry. Audio doesn't work at all through HDMI in Ubuntu, but does for Chrome.OS. Tried disconnecting, rebooting and still the same result.

Hi.

I have fixed the issue. It was nothing to do with the HDMI thing because that only occured when I was on the dev channel. The problem was the fact that I was on the beta channel. I reverted to the stable channel, powerwashed and reinstalled Ubuntu 14.04 Trusty. Audio is crisp. Thanks for your help and support.

A Green

Collaborator

drinkcat commented Apr 23, 2014

I managed to reproduce on beta channel, thanks (dev channel is not affected, stable is ok according to you). Not related to HDMI, present on both earplugs and speaker as you mention.

crouton: version git (609fe46038)
release: trusty
architecture: amd64
targets: core,xfce,keyboard
host: version 5712.29.0 (Official Build) beta-channel peppy
  • crosh: aplay xx.wav works perfectly.
  • Inside chroot:
    • aplay -Dcras xx.wav has some very subtle "cracks" (you might not hear it on short files like Front_Center.wav, and it's more obvious with earplugs)
    • aplay xx.wav (routed through pusleaudio) has more obvious "cracks" (nothing as strong as #792: you can still hear the original sound)

Extra notes:

  • aplay -F 500000 -Dcras xx.wav produces 2 cracks per second (500ms). Shorter values like 12500 produces output similar to pulseaudio.
  • Replacing ALSA plugins .so files by the ones provided by Chrome OS does not fix the problem.
  • In crosh, aplay -F 500000 tailtoddle_lo.wav has the same issue (but not always!), so it's most likely an upstream bug (memory corruption of some sort?).

Good analysis, something I would've failed to fathom up myself :)

@theadamgreen1 theadamgreen1 reopened this Apr 23, 2014

Collaborator

drinkcat commented Apr 25, 2014

Ok. Replacing libcras.so in the chroot by the one provided by Chrome OS fixes the problem.

There is an ABI mismatch between CRAS built from branch release-R35-5712.B. 5712.29.0 is build based on commit b505fe98e77334764b9b97490d61951917e0a1dc, and there is an ABI change between that and release-R35-5712.B current HEAD (see https://chromium.googlesource.com/chromiumos/third_party/adhd/+log/release-R35-5712.B, ABI change in commit d05503b).

Looks like we should get rid of the branch name parsing logic, and always rely on manifests (if that works for stable channel as well).

How could I test this on stable?

Collaborator

drinkcat commented Nov 20, 2014

Fixed in #1053.

@drinkcat drinkcat closed this Nov 20, 2014

I'm seeing this same issue with the latest crouton (just updated my chroot now) on debian sid (Dell Chromebook 11)

Is there anything I can provide to help fix this?

Judecca commented Apr 27, 2015

I have exactly the same issue. Audio crackles on Ubuntu XFCE. Most notably, in VLC or Audacity. I have the most recent version of Crouton and just updated my chroot.

Acer Chromebook 11 CB3-111

Same thing for me. Running Trusty (KDE) on a c720. Any headway on this?

yetzke commented May 6, 2015

Same thing for me. I'm running Precise KDE on c720. Thanks

Bump. I'm having the same problem. It's not consistent, though--sometimes it happens, sometimes not. But when it starts happening, it gets progressively worse unless I stop the source of sound for a few minutes. That sometimes fixes it, sometimes not. I just updated, and that didn't fix it. This has been happening for months. It seems to happen a lot more often through an external audio output, like HDMI or earphones. It's more rare through the internal speakers.

HP Chromebook 14, 2013
Ubuntu 14.04

ee7klt commented Nov 4, 2015

can someone please explain how exactly to do this in layman's terms? I've clicked through the link to #1053 by drinkcat and the subsequent links from there. From what I've gleaned, it looks like we need to set the version number in CPPflags or something or other. What exact commands do i need to run? Will I need to re-install ubuntu? if i need to copy libcras.so from chrome os to ubuntu, what is the origin and target of this file?

Honestly, it eventually went away for me after an update. Then again, I don't use the external HDMI output nearly as often as I used to, so maybe it has only dropped in frequency.

This problem is still existent, everything was fine until recently (over the last week -- I noticed an audio problem a few days ago yet didn't reboot because of ongoing programs).

$> aplay -Dcras /usr/share/sounds/alsa/Front_Center.wav
works clear and fine.

Playing audio through vlc w/Chromium OS Audio Server or Default produces horrible scratchy and screetchy sounds.

$> cras_test_client --version
crouton-fe461bde8bb9095106ea8ac67b0701a366d8180

crouton: version 1-20160902144033~master:9f8e9a22
release: trusty
architecture: amd64
xmethod: xorg
targets: xfce
host: version 8530.81.0 (Official Build) stable-channel peppy
kernel: Linux localhost 3.8.11 #1 SMP Wed Sep 7 17:09:28 PDT 2016 x86_64 x86_64 x86_64 GNU/Linux
freon: yes

VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28)
VLC version 2.1.6 Rincewind (2.1.6-0-gea01d28)
Compiled by buildd on lgw01-55.buildd (May 3 2016 01:05:31)
Compiler: gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by the VideoLAN team; see the AUTHORS file.

pulseaudio 4.0

you're on the latest commit, so that isn't the issue. weird.

@dnschneid Do you have to update Crouton to work with Cras with each Chromium update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment