Page 2 of 2

Re: The Eupnea Project: Depthboot to run Linux on a ChromeBook

Posted: Thu Oct 27, 2022 5:26 pm
by matybigfro

So my understanding is that External Sound Card is connected to the ChromeOS Audio Server (CRas), CRAS is then presented to the Linux as a virtual soundcard which is what Pulse, ALSA or Jack conncets to. Hence the increased latency and instability I think.


Re: The Eupnea Project: Depthboot to run Linux on a ChromeBook

Posted: Fri Oct 28, 2022 11:06 am
by Linuxmusician01
matybigfro wrote: Thu Oct 27, 2022 5:26 pm

So my understanding is that External Sound Card is connected to the ChromeOS Audio Server (CRas), CRAS is then presented to the Linux as a virtual soundcard which is what Pulse, ALSA or Jack conncets to. Hence the increased latency and instability I think.

I think I remember now. On my old Chromebook, which does have full blown Linux on it via Crouton, I always kill Cras. If I'm not mistaken ChromeOS uses Cras like we Linuxers use PipeWire, JackAudio or PulseAudio: it's to circumvent the fact that Alsa (the one and only sound driver on a Linux system) can only let one application play sound. Remember: you do not necessarily need Jack, PW, Pulse etc. to hear sound on Linux. Only Alsa.

So Cras does not present your USB audio device as a virtual sound card to Jack or Alsa. It's an audio server that you can use in applications that support it. Just like Jack or PulseAudio. Cras is like Jack. Or a replacement for it, if you will. And I think it is generally not a good idea to let two different "audio servers" (like PW, Jack, Pulse, Cras or whatever) present itself to your (audio) applications. Audio applications (like a DAW) can Alsa via the "audio server" or directly. It's very vague, I know, but Alsa is the one and only driver for audio, all the others simply rely on Alsa and use it to produce, or "serve", sound to applications like DAW's, media players, etc.

Cras might indeed "see" the external audio card, but Linux applications might not play nice with Cras: I always kill it like so:

Code: Select all

sudo initctl stop cras

If you're on "regular" CromeOS you can open a "Chrome OS development shell" (= Crosh) with Ctrl Alt T. Then type "shell" to switch to a regular Linux terminal/shell. In that terminal you can type the good old command below to see if ChromeOS or Crostini, which ever you started, plays nice with Alsa and lets Alsa "see" your external USB audio card. This also works in regular Linux of course.

Code: Select all

cat /proc/asound/cards

Could you post the output of that command here? Is your USB audio device (the Alesis IO4) among them?

After killing Cras in Crostini (or the specific Linux flavor you have running on the Chromebook) then you can try to experiment with Reaper and let Reaper use Alsa as the 'Audio System' like so in Reaper:

"Options --> Preferences (Ctrl P)"

Then choose from the left-hand panel "Audio --> Device'". In the right-hand panel then choose: "Audio System: Alsa" and as input and output device your USB audio device (Alesis IO4). Restart Reaper. I think you've already done that. Am I right? Did you record some audio yet in Crostini? Do you hear audio from the USB audio device now (i.e. not from your Chromebook speaker)?

If I start Reaper on my Chromebook then I can choose as 'Audio System' for Reaper to use between Jack, Alsa dummy audio and PulseAudio. Cras ain't in there.

You don't still test these things with Depthboot/Eupnea do you? I'd like to test Crostini, not necessarily Depthboot/Eupnea.


Re: The Eupnea Project: Depthboot to run Linux on a ChromeBook

Posted: Fri Oct 28, 2022 11:50 am
by matybigfro

I didn't think it would work and it didn't, once I'd killed crass Reaper still just had the option for VirtIO device in it's preference and when selected gave the bellow error

ALSA: error finalizing input device parameters

This is the output of of 'cat /proc/asound/cards' in ChromeOS

chronos@localhost / $ 0 [iO4 ]: USB-Audio - iO4
Alesis iO4 at usb-0000:00:14.0-3, full speed
1 [sofsofrt5682 ]: sof-sof_rt5682 - sof-sof_rt5682
HP-Dratini-rev4-Dratini

I'm pretty sure that it is Cras that is mostly responsible for both the amount and instability of the latency too. I'm kean to see if CRas is running in Depthboot if so I will definitely kill it.

I actually think Depthboot is gonna be the best solution long term once as the extenal audio has worked reasonably well straight out of the box and allowed reaper to see the Alesis directly, at the moment my only issue with it is that the internal audio on my chromebook isn't yet working and also they're yet to get pipewire working with it. Once those issues are ironed out I'm pretty sure I'm gonna use it to install Pop!_OS internally and replace CromeOS. The Full EupneaOS is still very much in development although long long term that could be tempting with it's inclusion of Android app support once it is out of dev.


Re: The Eupnea Project: Depthboot to run Linux on a ChromeBook

Posted: Fri Oct 28, 2022 1:02 pm
by Linuxmusician01
matybigfro wrote: Fri Oct 28, 2022 11:50 am

I didn't think it would work and it didn't, once I'd killed crass Reaper still just had the option for VirtIO device in it's preference and when selected gave the bellow error

ALSA: error finalizing input device parameters

Thank you for trying/testing for me. Did you restart Reaper after choosing another Audio System in Reaper's settings? Maybe that's why it crashed. My Preferences for Reaper look like this (not on the Chr.book but my regular PC):
Image
Unfortunately I cannot take a screenshot with the pull down menu 'Audio system' open but it says: "Jack, Alsa, Dummy audio & PulseAudio". I can't choose "VirtIO" like you. Nor can I choose "Cras" (on my Chr.B.).

matybigfro wrote: Fri Oct 28, 2022 11:50 am

This is the output of of 'cat /proc/asound/cards' in ChromeOS

Code: Select all

chronos@localhost / $ cat /proc/asound/cards 
 0 [iO4            ]: USB-Audio - iO4
                      Alesis iO4 at usb-0000:00:14.0-3, full speed
 1 [sofsofrt5682   ]: sof-sof_rt5682 - sof-sof_rt5682
                      HP-Dratini-rev4-Dratini

Speaks volumes. Alsa does see the USB Alesis iO4 audio device. If you're curious if Alsa indeed loaded the right driver for your USB audio card (we call that a kernel module) then you can issue the 'lsmod | grep usb' command which om my PC outputs something like below:

Code: Select all

$ lsmod | grep usb
snd_usb_audio         282624  0
snd_usbmidi_lib        36864  1 snd_usb_audio
mc                     57344  1 snd_usb_audio
snd_hwdep              20480  3 snd_usb_audio,snd_hda_codec,snd_opl3_lib
snd_rawmidi            36864  3 snd_seq_midi,snd_usbmidi_lib,snd_mpu401_uart

As you can see a kernel module (i.e. driver from Alsa) for my Behringer UMC404HD USB audio card is loaded and it's the generic "snd_usb_audio" driver which in my opinion should also be loaded for your Alesis iO4 USB audio device.

However, they say on the Crostini/ChromeOS forum & FAQ that USB devices can not be used (yet). So maybe the kernel module ain't loaded on your Crostini enabled Chr.B. or there's some other caveat. Which strikes me as very strange since the 'cat /proc/asound/cards' command shows that Alsa "knows" about the Alesis...

matybigfro wrote: Fri Oct 28, 2022 11:50 am

I'm pretty sure that it is Cras that is mostly responsible for both the amount and instability of the latency too. I'm kean to see if CRas is running in Depthboot if so I will definitely kill it.

I actually think Depthboot is gonna be the best solution long term once as the extenal audio has worked reasonably well straight out of the box and allowed reaper to see the Alesis directly, at the moment my only issue with it is that the internal audio on my chromebook isn't yet working and also they're yet to get pipewire working with it. Once those issues are ironed out I'm pretty sure I'm gonna use it to install Pop_OS internally and replace CromeOS. The Full EupneaOS is still very much in development although long long term that could be tempting with it's inclusion of Android app support once it is out of dev.

Using Depthboot might well be your only option to get an USB audio card working (or any USB hardware for that matter). I wouldn't install Pop!_OS. It's an altered Ubuntu version meant for System76's hardware. I for example will not try to help people with an OS that I don't know well and changed multimedia "things" from the distro it is based on. PopOS appears to become more and more popular, but in general I think it'll still be more easy to get third party software and help for ye olde regular (X)Ubuntu.

With Depthboot, can you install a Linux distro to the "hard disk" inside the Chr.B. or must you run the Linux distro from USB stick? Is the USB stick only meant to start the Chr.B. from? I don't think an operating system is meant to be run from USB: all the read/write actions make the stick wear out and I think it's relatively slow. But if there's no other option you'll have to.

If I get me a Chr.B. again I'll still try to install Linux via Crouton again, even if that means using an old Linux version, because it'll run from the internal disk in the Chr.B.

Good luck with your ChromeBook and Linux! :)

.
P.S. The audio card/chip inside your Chr.B., the Realtek RT5682, appears not to be supported well in Linux (yet?). That's probably why you don't have audio in anything else than ChromeOS or Crostini (they use the same kernel).


Re: The Eupnea Project: Depthboot to run Linux on a ChromeBook

Posted: Fri Oct 28, 2022 6:49 pm
by matybigfro

Ah so that was really interesting running them in Crosh as chronos@localhost gives really different results to running in Termina as user

Code: Select all

matybigfro@penguin:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
matybigfro@penguin:~$ lsmod | grep usb
-bash: lsmod: command not found

Code: Select all

chronos@localhost / $ lsmod | grep usb
snd_usb_audio         184320  2
snd_usbmidi_lib        28672  1 snd_usb_audio
snd_rawmidi            28672  2 snd_seq_midi,snd_usbmidi_lib
btusb                  45056  0
btrtl                  16384  1 btusb
btintel                24576  1 btusb
btbcm                  16384  1 btusb
snd_hwdep              16384  2 snd_usb_audio,snd_hda_codec
bluetooth             528384  34 btrtl,btintel,btbcm,btusb,rfcomm
chronos@localhost / $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0408:5424 Quanta Computer, Inc. HP Wide Vision HD Camera
Bus 001 Device 013: ID 13b2:0072 Alesis iO4
Bus 001 Device 005: ID 8087:0026 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I didn't try restarting Reaper after selecting ALSA but normally can switch between working audio devices without an issue. I just tried again and it makes no difference with CRAS stopped Reaper cannot use ALSA.

It might even be that the Audio path is USB >> ALSA (in chrome os) >> CRAS >> (ALSA/PulseAudio/JACK in Crostini) >> Reaper

Image

Interestingly when I was using my housemates Scarlet earlier today it did show up as an available USB device that I could give Linux permission to access to it still didn't show up when I ran cat /proc/asound/cards or show as available within Reaper or Jack as a audio device. I'll have to try those other commands when I next have a hand on it as I wonder if that's related to how old the Alesis drivers are.

I'm not clear on it but there are instructions for how to install Linux direct to your Harddrive with Depthboot but its not possible to dual boot so I've wanted to hold off doing it until internal audio is resolved as it will wipe ChromeOS off the harddrive.


Re: The Eupnea Project: Depthboot to run Linux on a ChromeBook

Posted: Sat Oct 29, 2022 11:57 am
by Linuxmusician01

Unfortunately my Chromebook updated ChromeOS yesterday. I've been able to hold that back for over 5 years but it finally happened. Therefore my old Crouton Linux chroot didn't work anymore (darn it: I knew it!).

So I re-installed another newer Linux version with Crouton: Debian 11 "Bullseye".

NOTHING works like it did before. I can't run JackAudio om my chromebook, can't stop Cras. Alsamixer does not see my USB audio device, etc, etc. What a SnAFU. I don't know it it's Crouton's crippled way of running Linux or that Debian is so different from (old) Ubuntu. I appear to have lost control over USB audio hardware too on my Chr. B.

Might re-install some old Ubuntu version with Crouton to see if I can use a USB sound card on my Chr.B. again... [edit: that didn't work. It looks like the all new and improved ChromeOS version that I have now will NOT let me use my beloved external USB sound device]

Bye for now. :(


Re: The Eupnea Project: Depthboot to run Linux on a ChromeBook

Posted: Sun Oct 30, 2022 1:55 pm
by Linuxmusician01

[Update]

I found out that the problem that you have with Crouton and an USB audio device is "caused" by the "new" version of Crouton being crippled or something like that. See my post from 30-10-2022 this topic. I was able to reset my Chr.b. to it's 2015 factory settings and re-install a backup of Ubuntu Trusty that I found on an CS card. And now it workd again. Considering the fact that you have a new Chromebook it'll probalbly never work for you. Sorry man.

Keep me informed on your experienced with Linux, audio and your Chromebook. I'm not gonna buy me another Chr.b. until my external audio device works.

Chhers. :)


Re: The Eupnea Project: Depthboot to run Linux on a ChromeBook

Posted: Sun Oct 30, 2022 4:01 pm
by Linuxmusician01

[yet another update]

Appears you have to do everything "audio" as root in Debian Bullseye in a chroot in Crouton nowadays! I'm a member of the "audio" group but that's not enough... Anyway: wanna use a cheap Chromebook as a music production computer? You (probably) still can, but use Crouton and not Crostini. Or you may try "Depthboot". :)

P.S. For all you people wanting to use Qt things in Debian/Crouton/Chromebook:

Code: Select all

sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5

Re: The Eupnea Project: Depthboot to run Linux on a ChromeBook

Posted: Wed Nov 02, 2022 11:34 am
by Linuxmusician01

[yet another update] For future reference:

Appears thet on a Chromebook running Linux in a chroot you have to add yourself to the group "hwaudio" and then completely restart the Chr.b. Then you have the rights as a user to use audio hardware. Pffff. That took me a long time to (re)find out (link Crouton Wiki, link discussion topic).