GalliumOS / galliumos-distro

Docs, issues, and artwork sources for GalliumOS
https://galliumos.org/
GNU General Public License v2.0
346 stars 11 forks source link

Audio issue - PLL Unlocked Error #545

Open kaypoush opened 4 years ago

kaypoush commented 4 years ago

Hello,

When by mistake the headphone jack unplugs sometimes (not all the time, like now I can remove the headphones and put it back it will not impact the audio but it happens more often when it's by mistake) and then I put it back it makes a weird boom sound and then the (whole not just headphone output) audio is broken, I hear some very low noises. Then after one or two minutes it comes back to normal. At first I thought that playing with the volume, changing the server, etc. was helping to fix it faster but in fact it does nothing the audio comes back by itself after a while.

Infos: Acer Chromebook 11 CB3-131-C9F0 GalliumOS 3.1 (4.16.18-galliumos, bionic) - Bay Trail - Gnawty ISO / Full Firmware (MrChromebox) / No dual-boot (no chrx)

pulseaudio 11.1 
daemonize = no
fail = yes
high-priority = yes
nice-level = -11
realtime-scheduling = yes
realtime-priority = 5
allow-module-loading = yes
allow-exit = yes
use-pid-file = yes
system-instance = no
local-server-type = user
cpu-limit = no
enable-shm = yes
flat-volumes = no
lock-memory = no
exit-idle-time = 20
scache-idle-time = 20
dl-search-path = /usr/lib/pulse-11.1/modules
default-script-file = /etc/pulse/default.pa
load-default-script-file = yes
log-target = 
log-level = notice
resample-method = auto
avoid-resampling = yes
enable-remixing = yes
remixing-use-all-sink-channels = yes
enable-lfe-remixing = no
lfe-crossover-freq = 0
default-sample-format = s16le
default-sample-rate = 44100
alternate-sample-rate = 48000
default-sample-channels = 2
default-channel-map = front-left,front-right
default-fragments = 4
default-fragment-size-msec = 25
enable-deferred-volume = yes
deferred-volume-safety-margin-usec = 1
deferred-volume-extra-delay-usec = 0
shm-size-bytes = 0
log-meta = no
log-time = no
log-backtrace = 0
rlimit-fsize = -1
rlimit-data = -1
rlimit-stack = -1
rlimit-core = -1
rlimit-rss = -1
rlimit-as = -1
rlimit-nproc = -1
rlimit-nofile = 256
rlimit-memlock = -1
rlimit-locks = -1
rlimit-sigpending = -1
rlimit-msgqueue = -1
rlimit-nice = 31
rlimit-rtprio = 9
rlimit-rttime = 200000
00:1b.0 Audio device: Intel Corporation Atom Processor Z36xxx/Z37xxx Series High Definition Audio Controller (rev 0e)
    Subsystem: Intel Corporation Atom Processor Z36xxx/Z37xxx Series High Definition Audio Controller
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 64 bytes
    Interrupt: pin A routed to IRQ 90
    Region 0: Memory at d0714000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: snd_hda_intel
    Kernel modules: snd_hda_intel

The only log I can see related to this issue is this in dmesg/syslog:

[20972.777353] max98090 i2c-193C9890:00: PLL unlocked
[20972.801067] max98090 i2c-193C9890:00: PLL unlocked
[20972.825221] max98090 i2c-193C9890:00: PLL unlocked
[20972.849098] max98090 i2c-193C9890:00: PLL unlocked
[20972.873118] max98090 i2c-193C9890:00: PLL unlocked
[20972.897124] max98090 i2c-193C9890:00: PLL unlocked
[20972.921130] max98090 i2c-193C9890:00: PLL unlocked
[20972.945126] max98090 i2c-193C9890:00: PLL unlocked
[20972.969154] max98090 i2c-193C9890:00: PLL unlocked
[20972.993540] max98090 i2c-193C9890:00: PLL unlocked
[20977.797078] max98090_pll_work: 198 callbacks suppressed
[20977.797085] max98090 i2c-193C9890:00: PLL unlocked
[20977.821106] max98090 i2c-193C9890:00: PLL unlocked
[20977.845493] max98090 i2c-193C9890:00: PLL unlocked
[20977.869242] max98090 i2c-193C9890:00: PLL unlocked
[20977.894103] max98090 i2c-193C9890:00: PLL unlocked
[20977.918131] max98090 i2c-193C9890:00: PLL unlocked
[20977.942283] max98090 i2c-193C9890:00: PLL unlocked
[20977.966133] max98090 i2c-193C9890:00: PLL unlocked
[20977.990175] max98090 i2c-193C9890:00: PLL unlocked
[20978.014146] max98090 i2c-193C9890:00: PLL unlocked
[20982.809479] max98090_pll_work: 198 callbacks suppressed
[20982.809493] max98090 i2c-193C9890:00: PLL unlocked
[20982.833457] max98090 i2c-193C9890:00: PLL unlocked
[20982.857783] max98090 i2c-193C9890:00: PLL unlocked
[20982.881504] max98090 i2c-193C9890:00: PLL unlocked
[20982.905320] max98090 i2c-193C9890:00: PLL unlocked
[20982.931224] max98090 i2c-193C9890:00: PLL unlocked
[20982.955261] max98090 i2c-193C9890:00: PLL unlocked
[20982.979128] max98090 i2c-193C9890:00: PLL unlocked
[20983.003281] max98090 i2c-193C9890:00: PLL unlocked
[20983.027287] max98090 i2c-193C9890:00: PLL unlocked
[20987.832035] max98090_pll_work: 197 callbacks suppressed
[20987.832039] max98090 i2c-193C9890:00: PLL unlocked
[20987.856052] max98090 i2c-193C9890:00: PLL unlocked
[20987.880499] max98090 i2c-193C9890:00: PLL unlocked
[20987.904109] max98090 i2c-193C9890:00: PLL unlocked
[20987.928309] max98090 i2c-193C9890:00: PLL unlocked
[20987.952117] max98090 i2c-193C9890:00: PLL unlocked
[20987.979552] max98090 i2c-193C9890:00: PLL unlocked
[20988.003127] max98090 i2c-193C9890:00: PLL unlocked
[20988.027338] max98090 i2c-193C9890:00: PLL unlocked
[20988.051151] max98090 i2c-193C9890:00: PLL unlocked
[20992.836056] max98090_pll_work: 196 callbacks suppressed
[20992.836064] max98090 i2c-193C9890:00: PLL unlocked
[20992.860393] max98090 i2c-193C9890:00: PLL unlocked
[20992.884475] max98090 i2c-193C9890:00: PLL unlocked
[20992.908092] max98090 i2c-193C9890:00: PLL unlocked
[20992.932229] max98090 i2c-193C9890:00: PLL unlocked
[20992.956093] max98090 i2c-193C9890:00: PLL unlocked
[20992.981246] max98090 i2c-193C9890:00: PLL unlocked
[20993.005107] max98090 i2c-193C9890:00: PLL unlocked
[20993.029331] max98090 i2c-193C9890:00: PLL unlocked
[20993.053140] max98090 i2c-193C9890:00: PLL unlocked
[20997.845184] max98090_pll_work: 197 callbacks suppressed
[20997.845190] max98090 i2c-193C9890:00: PLL unlocked
[20997.869049] max98090 i2c-193C9890:00: PLL unlocked
[20997.893210] max98090 i2c-193C9890:00: PLL unlocked
[20997.917263] max98090 i2c-193C9890:00: PLL unlocked
[20997.941251] max98090 i2c-193C9890:00: PLL unlocked
[20997.965285] max98090 i2c-193C9890:00: PLL unlocked
[20997.989240] max98090 i2c-193C9890:00: PLL unlocked
[20998.013408] max98090 i2c-193C9890:00: PLL unlocked
[20998.038103] max98090 i2c-193C9890:00: PLL unlocked
[20998.062113] max98090 i2c-193C9890:00: PLL unlocked

I see no new log after the audio comes back to normal.

If you need more infos, I will provide.

Note: I also have the low audio problem but It can be solved by manually increasing the volume on alsamixer for chtmax98090 at each boot.

Thank you!

mikebw commented 4 years ago

I have a similar problem with a Dell 3120 (CANDY) BayTrail. After removing a headset, either conventionally wired or USB, the speakers are dead until they mysteriously recover. While the speakers produce no audio, the volume control app correctly shows varying audio levels from both the application (for example, web browser) and device output. The problem is intermittent so I have never been able to hunt it down.

kaypoush commented 4 years ago

It didn't really work for me but you can try some of the solutions listed on this page:

https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#Glitches,_skips_or_crackling

Some additional informations. Indeed audio is still "there". In my case, I need to put the volume to the maximum in the volume control and I can hear the distorted but still very low audio. Like this:

https://www.youtube.com/watch?v=cGTJEjLmx8s

Like it's encrypted and something. After a while (not exact time) it comes back to normal.

I will try to record somehow the audio that it makes when I have this problem and when I put the headphones. Perhaps it will help to solve this issue.

kousu commented 4 years ago

:+1: I'm seeing this too on GalliumOS 3.1 on GNAWTY ( Acer Chromebook 11 (CB3-131, C735) ).

I found that pkill pulse + pkill $ANY_APP_USING_AUDIO will sometimes fix it, but will sometimes not. Many pkills are sometimes needed, and sometimes the problems start up again even after that.

As @mikebw said sometimes just waiting for a while will let it recover, but I haven't figured out how long that takes or if there's a special trigger for it.

I've been wondering if this is correlated with sleep, since it seems to happen more after I've left my laptop and come back to it, but maybe that's just because the system has been online for longer and something is glitching.

kaypoush commented 4 years ago

OK, I tried something and I think it may be the clean fix for this issue.

I don't really understand the origin of this (something to do with PLL and some other technical stuff) but it's known and was apparently fixed in more recent linux kernel versions.

More info here:

https://lkml.org/lkml/2018/11/1/1098

Basically, what I did is updating the linux kernel to version 5. Gallium OS by default is using version 4. At first, I was kinda worried about this because I thought it will break my system but it didn't.

First check the current version of the kernel: uname -r

It should be version 4 something.

To update the kernel (most important line is line 2 which is the command to update the kernel), you do this:

sudo apt update
sudo apt install --install-recommends linux-generic-hwe-18.04
sudo apt dist-upgrade
sudo apt autoremove
sudo apt autoclean
reboot

Before updating the kernel I suggest you to back up your important stuff. I don't want to be responsible of any data loss even though in my case nothing happened. It worked just fine.

Check again the version of the kernel after rebooting: uname -r

It should be version 5 something now. And see if the issue with the audio is fixed.

Hope it helps and don't forget to comment afterwards to tell if it worked or not.

Edit 1: The previously used update method brings us to version 5.4 so not the latest kernel. It didn't work, the issue reappeared. I'm now testing newer kernels using this tool for installing them https://github.com/bkw777/mainline/releases The kernel I'm testing now is 5.7.1-050701-generic (didn't face any issue updating to this version) and I'll report back to tell if this particular audio problem is fixed or not with this new version. Besides, I learned about this comment the guy had the same issue and he reported back with this comment "I switched to Arch Linux, and everything works on latest kernel + max98090 UCM files". I hope that with this new kernel it will work. For info, the UCM files he's talking about are located here /usr/share/alsa/ucm. Stay tuned!

Edit 2: I'm back to inform you that it seems that this issue can be fixed by upgrading to linux kernel version 5.7.1-050701-generic using Ubuntu Mainline Kernel Installer. I also updated my custom firmware using ChromeOS Firmware Utility Script. I tested for 20 days without any issue.