Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out a way to build audio target now that autotools is removed #4958

Open
drinkcat opened this issue Apr 2, 2023 · 131 comments · May be fixed by #4959
Open

Figure out a way to build audio target now that autotools is removed #4958

drinkcat opened this issue Apr 2, 2023 · 131 comments · May be fixed by #4959

Comments

@drinkcat
Copy link
Collaborator

drinkcat commented Apr 2, 2023

https://chromium.googlesource.com/chromiumos/third_party/adhd/+/879fe7a51784eb07d1b85473d8927050fb000f87 removed cras/src/Makefile.am that we used to rely on.

Not sure how we can work around this, implementing a bazel parser is definitely not something I'm looking forward to.

@drinkcat
Copy link
Collaborator Author

drinkcat commented Apr 2, 2023

That CL landed in 15378.0.0.

5 options from discussion with @dnschneid :

  1. On >=15378.0.0, fix cras fetch version to 879fe7a51784eb07d1b85473d8927050fb000f87^. IMHO that'll break fairly quickly as the structures change.
  2. On >=15378.0.0 fetch Makefile.am from 879fe7a51784eb07d1b85473d8927050fb000f87^. That might last a bit longer and we can still patch changes as needed.
  3. Deprecate audio target.
  4. Implement Bazel to shell converter.
  5. Audio over websocket.

4/5 are like, intern-sized project, so non-starter.

I think we'll end up with 3 eventually, but 2 should be easy to implement.

Basically, we just need to add a download step around here: https://github.com/dnschneid/crouton/blob/master/targets/audio#L59

mkdir -p "$CRASBUILDTMP/cras/src"
wget https://chromium.googlesource.com/chromiumos/third_party/adhd/+/c2ece09f69565afcbcf511b1693f3fe735bde511/cras/src/Makefile.am?format=TEXT -O- | base64 -d > "$CRASBUILDTMP/cras/src/Makefile.am"

(this can be done unconditionally as the extraction phase would override it)

drinkcat added a commit that referenced this issue Apr 2, 2023
https://crrev.com/c/4322563 (>=15378.0.0) removed autotools support,
let's fetch the last known good version from git.

Fixes #4958. For now. Things will break again, likely.
@drinkcat drinkcat linked a pull request Apr 2, 2023 that will close this issue
drinkcat added a commit that referenced this issue Apr 2, 2023
https://crrev.com/c/4322563 (>=15378.0.0) removed autotools support,
let's fetch the last known good version from git.

Fixes #4958. For now. Things will break again, likely.
drinkcat added a commit that referenced this issue Apr 2, 2023
https://crrev.com/c/4322563 (>=15378.0.0) removed autotools support,
let's fetch the last known good version from git.

Fixes #4958. For now. Things will break again, likely.
@CroutonIsFun
Copy link

Why can't we just eliminate cras? If you install a basic core, e.g.,

sudo crouton -r focal -t core

then from within the chroot, install alsa-utils, e.g.,

sudo apt install alsa-utils

my experience is that you can both record and play audio using, .e.g., arecord and aplay.

I've always been able to do this in crouton. So why do we even need the cras module?

@drinkcat
Copy link
Collaborator Author

drinkcat commented Apr 6, 2023

That should indeed work in many cases. Volume control will not integrate well though (nor any of the cras-applied volume curves, for example), and only integrated audio would work (no BT/USB headset). And there might be some weird interactions between cras and whatever userspace app.

@CroutonIsFun
Copy link

CroutonIsFun commented Apr 6, 2023

Thanks, drinkcat. I realize how little I know about the inner workings of crouton. You've been involved as long as I can remember. Thanks for your contributions.

@CroutonIsFun
Copy link

The main branch is still not fixed. How do I download your branch?

@CroutonIsFun
Copy link

Is Google intentionally sabotaging Crouton?

@drinkcat
Copy link
Collaborator Author

drinkcat commented Apr 9, 2023

Is Google intentionally sabotaging Crouton?

This one is easy to answer. No, absolutely not. Chrome OS devs are moving forward and unintentionally breaking things in crouton. This happened many times throughout the years, and we could usually play catch up. This time, none of us have time (or even hardware) to test these fixes locally, so we'd need somebody from the community to step up.

@DennisLfromGA
Copy link
Collaborator

DennisLfromGA commented Apr 10, 2023

@CroutonIsFun,

I think it can be tested using the new experimental branch 'longliveautotools' like this:

  • sudo CROUTON_BRANCH=longliveautotools crouton ...

Enter the crouton options you would normally use to add or update a chroot in the command above.

-DennisLfromGA

@ducksosu
Copy link

@DennisLfromGA i tried it out with the command and cras compiles perfectly but then this happens,
cp: cannot stat 'Makefile.am': No such file or directory Failed to complete chroot setup. Unmounting /mnt/stateful_partition/crouton/chroots/jammy...

@DennisLfromGA
Copy link
Collaborator

DennisLfromGA commented Apr 10, 2023

@ducksosu,

That's strange since the PR downloads a previous 'lastgoodam', not sure why it's failing, sorry.
Maybe @drinkcat [EDIT: or @dnschneid] will know.

-DennisLfromGA

@dnschneid
Copy link
Owner

I pushed a small change to hopefully fix that. Give it another shot, @ducksosu?

@ducksosu
Copy link

@dnschneid i tried and and its back to the first problem
Compiling CRAS (i386)... gcc: error: unrecognized command-line option '-Wundef-prefix=HAVE_,CRAS_' Failed to complete chroot setup. Unmounting /mnt/stateful_partition/crouton/chroots/jammy...

@dnschneid
Copy link
Owner

Yeah, this fix needs to be combined with whatever fix for #4923, unfortunately.

@CroutonIsFun
Copy link

CroutonIsFun commented Apr 11, 2023

Thanks for the feedback, guys!

I also tried the longliveautotools branch:

Compiling CRAS (i386)...
gcc: error: unrecognized command line option '-Wundef-prefix=HAVE_,CRAS_'
Failed to complete chroot setup.

Edit: Disregard the below. The i386 is needed by AutoTools, otherwise we wouldn't be adding it.


̶S̶o̶ ̶h̶e̶r̶e̶'̶s̶ ̶a̶n̶o̶t̶h̶e̶r̶ ̶o̶u̶t̶s̶i̶d̶e̶-̶t̶h̶e̶-̶b̶o̶x̶ ̶s̶u̶g̶g̶e̶s̶t̶i̶o̶n̶:̶ ̶e̶l̶i̶m̶i̶n̶a̶t̶e̶ ̶t̶h̶e̶ ̶i̶3̶8̶6̶ ̶a̶r̶c̶h̶i̶t̶e̶c̶t̶u̶r̶e̶.̶ ̶W̶h̶y̶ ̶i̶s̶ ̶i̶t̶ ̶n̶e̶e̶d̶e̶d̶?̶


I think I was using crouton before cras was baked into the chroot. Also, it used to be that focal would install without cras, and I could access the sound card(s) directly using qjackctl and qsynth. But soon enough, the "oversight" was fixed.

There are many use cases without the need for pretty sounds. Option 3 above, deprecate audio, is looking better and better. If crouton is going to break early and often, and take days or weeks to be fixed, then it's useless, save as an intellectual curiosity.

I'm trying to keep the people on r/Crouton apprised of the situation, many of whom have no clue where to look for help. Thanks for all you guys do and have done over the years.

James :)

@ducksosu
Copy link

ducksosu commented Apr 11, 2023

so if i removed the '-Wundef-prefix=HAVE_,CRAS_' option from the makefile would that cause any issues with cras or sound in general

@CroutonIsFun
Copy link

All you can do is try it and see what happens

@ducksosu
Copy link

@CroutonIsFun yeah still trying to figure out where the makefile is though. do you know?

@DennisLfromGA
Copy link
Collaborator

@ducksosu,

The new audio file is in the 'longliveautotools' branch, you can find it here:

Look at lines 60-65 where the Makefile.am is downloaded.
You could modify the file to add the sed command below:

  • sed -i -e 's/\-Wundef\-prefix=HAVE_,CRAS_//g' Makefile.am

-DennisLfromGA

@CroutonIsFun
Copy link

@ducksosu
@Qwer-TeX

You can't use the most recent version of ChromeOS because autotools was removed as of version anything past 110.

@drinkcat has already tried to build it from the most recent version which was available, and it didn't work. This is what the longliveautotools branch was about.

I'm as baffled at this as anyone. I've recently decided to dual boot actual Linux because, even on a good day, crouton is quirky, and I'm tired of dealing with it.

Cheers!

@Qwer-TeX
Copy link

@CroutonIsFun

even on a good day, crouton is quirky, and I'm tired of dealing with it.
yea, but your name tells a different story lol.

Anyways, I backed up ChromeOS and the BIOS and installed a new BIOS from MrChromeBox.
I then I removed ChromeOS and installed linux and everything works.
except that the custom firmware is kinda buggy but i'm glad I backed up the original BIOS and ChromeOS.

You can't use the most recent version of ChromeOS because autotools was removed as of version anything past 110.

@drinkcat has already tried to build it from the most recent version which was available, and it didn't work. This is what the longliveautotools branch was about.

If that's the case, then why not fork CRAS and remaster it after asking for permission from the CRAS developers and make a seperate github repository for it.

Also after installing Xubuntu to the chromebook, I see that when I open the alsamixer, there is only one channel for audio instead of 14 when in the crouton chroot. And I see no such thing called CRAS in Xubuntu. dpkg -l

@CroutonIsFun
Copy link

@Qwer-TeX

You don't need permission to fork crouton. You just do it, and publish your own version. I'm skilled at using crouton, but not at reprogramming it.

Yeah, my user name is CroutonIsFun. Maybe I should create a new account as TiredOfCrouton. ;-)

Congratulations on setting up Xubuntu. Does your sound work?

Personally, I'm using Debian bullseye, as Debian allows me more flexibility to install only what I wish. But Xubuntu is good!

Thanks for your reply!

@CroutonIsFun
Copy link

Bye bye, crouton. You no longer work for me. It's been real.

@CroutonIsFun
Copy link

Barring an intervention by Google, crouton is dead. It is no longer possible to use sudo in the crosh shell: it is considered a privileged command.

You can Ctrl-Alt-F2 over to VT-2, but this interface seems to be sandboxed, and device access doesn't work. And without device access, crouton will be similar to crostini.

@dnschneid
Copy link
Owner

Barring an intervention by Google, crouton is dead. It is no longer possible to use sudo in the crosh shell: it is considered a privileged command.

You can Ctrl-Alt-F2 over to VT-2, but this interface seems to be sandboxed, and device access doesn't work. And without device access, crouton will be similar to crostini.

VT2 isn't sandboxed. There's contention on graphics that needs to be hopped around, but otherwise it's the native OS terminal like crosh is.

@CroutonIsFun
Copy link

Barring an intervention by Google, crouton is dead. It is no longer possible to use sudo in the crosh shell: it is considered a privileged command.
You can Ctrl-Alt-F2 over to VT-2, but this interface seems to be sandboxed, and device access doesn't work. And without device access, crouton will be similar to crostini.

VT2 isn't sandboxed. There's contention on graphics that needs to be hopped around, but otherwise it's the native OS terminal like crosh is.

Okay, I'll see what happens. Thanks for the info.

@CroutonIsFun
Copy link

CroutonIsFun commented Sep 30, 2023

@dnschneid @DennisLfromGA @drinkcat

VT-2 is telling me this is a read-only file system. For example, try running this script from MrChromeBox:

cd; curl -LO mrchromebox.tech/firmware-util.sh && sudo bash firmware-util.sh

If you unbundle the command, and only do the curl, the firmware-util.sh script cannot be downloaded, and thus the entire script fails.

I used to know something about making the file system writable. Any thoughts on this?

EDIT: I figured this out. When I login as chronos, it puts me in the user area. I have to first cd /, then I can get the command to work. This is tricky, because you can't copy and paste from the browser. So I had to create a text file, and save it to Downloads, then I could display it with

cat /home/user/90xxxxxxxxx/Downloads.mrc.txt

etc, then type it in. The same issue with running the crouton install script.

@DennisLfromGA
Copy link
Collaborator

@CroutonIsFun,

Works for me ...

-DennisLfromGA

@CroutonIsFun
Copy link

@dnschneid @DennisLfromGA @drinkcat

Okay, now I'm seeing the graphics glitch which David mentioned. I had set up a chroot to use openbox, and I tried to launch it like this:

sudo enter-chroot -n xenial xinit

and the error message is:

Xorg X11 servers cannot be launched from Frecon.
Return to Chromium OS and use crosh to launch X.

So at this stage, I'm dead in the water as far as using a desktop. So many people want this to work, and I'm trying to lead the way. Any ideas?

@dnschneid
Copy link
Owner

See my suggestions here

@CroutonIsFun
Copy link

CroutonIsFun commented Sep 30, 2023

See my suggestions here

David, thank you for jumping in.

  1. The xiwi command tries its best to start but can never connect.
  2. The ssh commands are bewildering to me at this point.
  3. If only I could rip a DVD from the command line, like I used to be able to do, using dvdbackup, then I could finish up with makemkv in crostini. But now, even though I can see /dev/sr0 when I lsblk, I cannot do so: I get the following error:

Cannot open device /dev/sr0 for reading, check your DVD device

This is why I thought VT-2 was sandboxed. So now, in order to accomplish what I need, I will install Debian bullseye to a USB, and dual boot. At least I now have access to VT-2.

Update: Inside my chroot, I install ssh. There is no sshd in /etc/init.d, so I go

sudo /etc/init.d/ssh --start

which only gives me back a command line help text showing me the options. According to ps ax|grep ssh, ssh is not running. sshd is found in /usr/sbin

Attempts to ssh foo@localhost from the crosh shell result in "connection refused".

@Qwer-TeX
Copy link

@CroutonIsFun

No way, my chromebook doesn't have function keys, I cannot access VT-2. And also, I cannot access tty2 when booting debian in live mode.

@CroutonIsFun
Copy link

@CroutonIsFun

No way, my chromebook doesn't have function keys, I cannot access VT-2. And also, I cannot access tty2 when booting debian in live mode.

F2 is the right arrow key. Start counting from the left, leaving out the Esc key.

@Qwer-TeX
Copy link

@CroutonIsFun Thank you, that worked.

But when live booting debian, that trick doesn't work :(

@CroutonIsFun
Copy link

@CroutonIsFun Thank you, that worked.

But when live booting debian, that trick doesn't work :(

It's not supposed to work in Debian. It's a Chromebook-only command.

@Qwer-TeX
Copy link

Then plugging in a external keyboard would a good option for debian.

@CroutonIsFun
Copy link

CroutonIsFun commented Oct 1, 2023

Then plugging in a external keyboard would a good option for debian.

Well, the top row of keys, not counting Esc, are recognized as F1 - F10. There is no F11 or F12.

@CroutonIsFun
Copy link

CroutonIsFun commented Oct 2, 2023

@dnschneid @DennisLfromGA @drinkcat

CROUTON IS WORKING!!!

Sorry, I know all caps is bad form... One of David's ideas was to ssh from crosh shell into a chroot running in VT-2. Well, this works!

My previous attempt failed because after installing ssh in the chroot, I started it incorrectly. The correct command is

sudo /etc/init.d/ssh start

After starting ssh in the chroot, then I Ctrl-Alt-F1 over to ChromeOS, open up the crosh shell, then execute

ssh -X foo@localhost

Now, in my particular case, I'm starting openbox with xinit, so my method of starting an Xsession is simple xinit. But you could also install xfce4, in which you would type, startxfce4.

Furthermore, earlier I had mentioned being unable to rip CDs and DVDs from the command line. This is because I had forgotten to add my username into /etc/group. I also add my username to hwaudio so I can use my USB audio adapter. (Built-in sound hardware doesn't work without cras. The situation is analogous to dual booting a Debian-based linux system, wherein the built-in sound hardware has no drivers in the Linux kernel).

Billiant --- simply brilliant, @dnschneid

Thank you one and all. I'll do my best to point users here and on Reddit in the right direction.

@CroutonIsFun
Copy link

I'm kinda out of loop now: my Chromebook expires in about 6 months, so I've already blown off ChromeOS and replaced it with Debian bullseye and xfce. Chromebooks are cool and clever devices. I'm not planning on buying a new Chromebook any time soon, so I'll really miss the ease of use and amazing features.

@DennisLfromGA
Copy link
Collaborator

@CroutonIsFun,

You might want to check this updated 'Auto Update policy' page, they've recently extended the expiry date on many Chromebooks to 10 years from the platform release date. My Pixelbook was supposed to hit the AUE date Jun 2023 but it's now been extended to Aug 2027.

-DennisLfromGA

@CroutonIsFun
Copy link

CroutonIsFun commented Oct 18, 2023

@CroutonIsFun,

You might want to check this updated 'Auto Update policy' page, they've recently extended the expiry date on many Chromebooks to 10 years from the platform release date. My Pixelbook was supposed to hit the AUE date Jun 2023 but it's now been extended to Aug 2027.

-DennisLfromGA

Dennis, interesting news. My Chromebook is an ASUS CX1100CNA, and it's on the list, with an asterisk. The footnote says I have to "opt in". I wonder what that means and how to accomplish it. I'll dig around a bit and come back here. Thanks for the tip!

Edit: No information about enrollment in an update plan seems to be available as yet. Thanks, James :-)

@DennisLfromGA
Copy link
Collaborator

@CroutonIsFun ,

We don't yet know exactly how the 'opt-in' will work, they haven't released all of the details but you won't be able to 'opt-in' until your device hits the current AUE date. I'm sure we'll know more about it by then.

-DennisLfromGA

@CroutonIsFun
Copy link

Thanks!

@Apocalypse10110
Copy link

I'm new to Linux and I have read through this discussion but I still don't understand how to install crouton. Please help.

@Qwer-TeX
Copy link

@Apocalypse10110

To install crouton you need to first:

  1. Make sure developer mode is enabled ( if not, search a tutorial on youtube to enable it )
  2. go to crosh (ctrl+alt+t)
  3. type shell
  4. sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton to install crouton
  5. sudo crouton to view help text

I wanted to install a ubuntu 22.04 system with xfce
so I wrote sudo crouton -n jammy -t xfce to install xfce on a base system.

But there's a problem, audio target is removed so sudo crouton -r jammy -t xfce gives you an error.

The fix around that problem is to skip the audio target meaning that the base linux system with xfce installed on it would work without audio.

---> sudo CROUTON_BRANCH=silence crouton -r jammy -t xfce is the correct command for now, it is what I used - type this now, thank me later.

To run the xfce you installed type sudo startxfce4 or sudo startlxde if you installed lxde

I recommend to read the README file of the crouton github repository, it contains pretty important information.
A quick search on youtube might also help.

You can install other targets as well but to list some use sudo crouton -t help
You can install other releases as well but to list some use sudo crouton -r help

Not to mention, crouton is for intermediate users because of its complexity, you have to configure most of the stuff most of the time in the linux crouton installs.
From my experience of using crouton, it is glitchy, buggy, and doesn't work most of the time. If you want to fix the glitches and bugs, you would need to edit complex configurations by yourself. Thats why if you don't know how a linux system fully works, use ubuntu on another computer, or lubuntu live usb on chromebook with mrchromebox's coreboot firmware installed alongside if you don't have another computer at your disposal with you.

feedback is much appreciated.

@ducksosu
Copy link

@Apocalypse10110
use ubuntu on another computer, or lubuntu live usb on chromebook with mrchromebox's coreboot firmware installed alongside if you don't have another computer at your disposal with you.

I would just do this, I ended up getting Ubuntu 22.04 (jammy) on my chromebook then after a while switching to windows. it works great just if you install windows check compatibility and check if the audio drivers are paid or not. even if the drivers are paid for your system it is cheap and easy to install so no worries there. with Linux it might be difficult to get audio working, I had a bug where it wouldnt detect my audio card correctly but it's fixable with a little bit of effort.
other than that it's really easy to load an os onto a USB and get it booted the only hard part would be either the wp screw or disconnecting the battery for wp to turn off, or if you don't have another PC to write the os to a USB drive.

@redd-rl
Copy link

redd-rl commented Feb 27, 2024

got a functioning ubuntu by installing cras using chromebrew and then installing crouton.

@Qwer-TeX
Copy link

Qwer-TeX commented May 12, 2024

got a functioning ubuntu by installing cras using chromebrew and then installing crouton.

How did you do that? Looks very interesting as no one reported to have used that technique. Does audio and headphone jack work? Give us a in-depth explanation.

A bit off topic, there is no way you're living in Antarctica ?. Thats what I call a true linux penguin ;)

@redd-rl
Copy link

redd-rl commented May 17, 2024

i got tricked, i made that post before starting the os. i don't remember the error but all the data is long since wiped, if i decide to buy a chromebook i'll fw it again.

and no, unfortunately i'm not a scientist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.