dnschneid / crouton

Chromium OS Universal Chroot Environment
https://goo.gl/fd3zc?si=1
BSD 3-Clause "New" or "Revised" License
8.57k stars 1.24k forks source link

Sound locked in both chroot and chromeos when X is running #3553

Closed brianharcourt closed 6 years ago

brianharcourt commented 6 years ago
Please paste the output of the following command here: sudo edit-chroot -all
name: tilikum
encrypted: no
Entering /mnt/stateful_partition/crouton/chroots/tilikum...
crouton: version 1-20171122220410~master:99877eaf
release: xenial
architecture: amd64
xmethod: xiwi
targets: xiwi,xorg,audio,chrome,lxde,core,extension,keyboard,touch
host: version 9901.77.0 (Official Build) stable-channel samus 
kernel: Linux localhost 3.14.0 #1 SMP PREEMPT Mon Nov 13 16:28:58 PST 2017 x86_64 x86_64 x86_64 GNU/Linux
freon: yes
Unmounting /mnt/stateful_partition/crouton/chroots/tilikum...

Please describe your issue:

When the chroot starts sound stops working in both native chrome os and in the chroot.

If known, describe the steps to reproduce the issue:

Unclear exactly how this started. Further once the issue has been found, both sound and video can be unstable, fixed by rebooting. I've tinkered around most of the day with it; updated the chroot, re-installed the xorg and xiwi targets to no avail. Research has found the following when attempting to start alsamixer:

chronos@localhost ~ $ sudo enter-chroot
Entering /mnt/stateful_partition/crouton/chroots/tilikum...
Unknown username "geoclue" in message bus configuration file
(tilikum)brian@localhost:~$ alsamixer
Couldn't create CRAS client
cannot open mixer: No space left on device
(tilikum)brian@localhost:~$ 

The unknown 'geoclue' user seems common and unrelated.

Researching no space left on device I find:

(tilikum)brian@localhost:~$ sudo df -h
[sudo] password for brian: 
Filesystem               Size  Used Avail Use% Mounted on
/dev/sda1                 55G   26G   26G  51% /
devtmpfs                 7.8G     0  7.8G   0% /dev
shmfs                    7.8G   24M  7.8G   1% /dev/shm
tmp                      7.8G  232K  7.8G   1% /tmp
tmpfs                    1.6G   12K  1.6G   1% /run
tmpfs                    5.0M     0  5.0M   0% /run/lock
run                      7.8G  796K  7.8G   1% /var/host/dbus
/dev/mapper/encstateful   17G  259M   16G   2% /var/host/timezone
/dev/root                1.7G  1.6G  129M  93% /lib/modules/3.14.0
media                    7.8G     0  7.8G   0% /var/host/media
/dev/sdb1                118G   21G   92G  19% /var/host/media/removable/morrisonDisk
none                     7.8G     0  7.8G   0% /sys/fs/cgroup
none                     7.8G  4.0K  7.8G   1% /sys/fs/selinux
(tilikum)brian@localhost:~$ 

Noting the 93% usage of the /dev/root at /lib/modules/3.14.0 making me wonder if there are files that need to be created to create a CRAS client.

Further - I see that the in the crosh shell:

chronos@localhost ~ $ df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/root                1.7G  1.6G  129M  93% /
devtmpfs                 7.8G     0  7.8G   0% /dev
tmp                      7.8G  232K  7.8G   1% /tmp
run                      7.8G  796K  7.8G   1% /run
shmfs                    7.8G   24M  7.8G   1% /dev/shm
/dev/sda1                 55G   26G   26G  51% /mnt/stateful_partition
/dev/sda8                 12M   28K   12M   1% /usr/share/oem
/dev/mapper/encstateful   17G  259M   16G   2% /mnt/stateful_partition/encrypted
media                    7.8G     0  7.8G   0% /media
none                     7.8G     0  7.8G   0% /sys/fs/cgroup
tmpfs                    7.8G  4.0K  7.8G   1% /run/arc/oem
tmpfs                    7.8G     0  7.8G   0% /run/arc/sdcard
tmpfs                    7.8G     0  7.8G   0% /run/arc/obb
tmpfs                    7.8G     0  7.8G   0% /run/arc/media
/dev/fuse                 55G   26G   26G  51% /run/arc/sdcard/default/emulated
/dev/fuse                 55G   26G   26G  51% /run/arc/sdcard/read/emulated
/dev/fuse                 55G   26G   26G  51% /run/arc/sdcard/write/emulated
/dev/sdb1                118G   21G   92G  19% /media/removable/morrisonDisk
passthrough              7.8G     0  7.8G   0% /run/arc/media/removable
tmpfs                    128K   12K  116K  10% /run/crw
chronos@localhost ~ $ 

So - what is eating up the 1.6G of /dev/root ? Where do I find those contents and how do I trim them?

brianharcourt commented 6 years ago

Looking at issue #1030 I saw that alsa-utils were recommended which I uploaded and updated the chroot.

Alsamixer launched successfully but no sound was being produced.

I left the chroot and played with chrome os trying to get sound back in the native environment. When I returned to the chroot I received No space left on device message again.

After rebooting - I'm back to receiving only the No space left on device message.

brianharcourt commented 6 years ago

Powerwashed. Situation resolved.

FxChiP commented 6 years ago

For future reference...

It appears that when a cras client is initializing, it sets up an inotify watch on /run/cras/.cras_socket (for some reason). When you run out of total user inotify watches (the default sysctl for this on chromeos seems to be 8192), the error code you get is exactly the same as "No space left on device" (that is, ENOSPC). If the cras client cannot create an inotify watch, it fails to do anything at all, including anything related to audio.

You can fix this by raising the inotify user watch limit with the following command:

sudo sysctl fs.inotify.max_user_watches=1048576

I just did it and it saved me a powerwash!

Note: you can test whether a cras client will fail with the cras_test_client command (and strace from there to drill down further)

coderofsalvation commented 6 years ago

Thanks a lot for this! I used to run into this problem a lot.

REASON: I'm doing all my nodejs development on my chromebook. Most popular buildtools watch for file-changes in the source-folder (recursively, to rebuild the application). This creates a lot of open inodes.

This solved it..THX again!