crouton icon indicating copy to clipboard operation
crouton copied to clipboard

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

Open drinkcat opened this issue 1 year ago • 133 comments

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 avatar Apr 02 '23 04:04 drinkcat

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 avatar Apr 02 '23 04:04 drinkcat

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?

CroutonIsFun avatar Apr 03 '23 23:04 CroutonIsFun

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.

drinkcat avatar Apr 06 '23 01:04 drinkcat

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 avatar Apr 06 '23 02:04 CroutonIsFun

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

CroutonIsFun avatar Apr 07 '23 13:04 CroutonIsFun

Is Google intentionally sabotaging Crouton?

CroutonIsFun avatar Apr 08 '23 17:04 CroutonIsFun

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.

drinkcat avatar Apr 09 '23 10:04 drinkcat

@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

DennisLfromGA avatar Apr 10 '23 17:04 DennisLfromGA

@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...

ducksosu avatar Apr 10 '23 17:04 ducksosu

@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

DennisLfromGA avatar Apr 10 '23 17:04 DennisLfromGA

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

dnschneid avatar Apr 10 '23 18:04 dnschneid

@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...

ducksosu avatar Apr 10 '23 18:04 ducksosu

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

dnschneid avatar Apr 10 '23 18:04 dnschneid

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 :)

CroutonIsFun avatar Apr 11 '23 01:04 CroutonIsFun

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

ducksosu avatar Apr 11 '23 02:04 ducksosu

All you can do is try it and see what happens

CroutonIsFun avatar Apr 11 '23 16:04 CroutonIsFun

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

ducksosu avatar Apr 11 '23 16:04 ducksosu

@ducksosu Would this be it?

https://github.com/dnschneid/crouton/blob/9eaac08b3ffc3994a3eb64ee6dca313b09cba006/targets/audio

IsolatedRainbow avatar Apr 11 '23 19:04 IsolatedRainbow

@ducksosu,

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

  • https://github.com/dnschneid/crouton/blob/longliveautotools/targets/audio

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

DennisLfromGA avatar Apr 11 '23 20:04 DennisLfromGA

@DennisLfromGA if i want to get rid of

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

do i replace my old one with the new one and not add the sed commmand?

ducksosu avatar Apr 11 '23 20:04 ducksosu

Running the below is prompting me to include the sed i think

sudo CROUTON_BRANCH=longliveautotools crouton -t xfce
image

IsolatedRainbow avatar Apr 11 '23 20:04 IsolatedRainbow

What distro are you selecting to install?

IsolatedRainbow avatar Apr 12 '23 00:04 IsolatedRainbow

@IsolatedRainbow ubuntu jammy with xfce

ducksosu avatar Apr 12 '23 00:04 ducksosu

I stopped getting that error with specifying the branch. I'm hoping that the devs have an idea about whats going on. Im happy to help however I can. Just recently learned about Crouton so excited to use it

IsolatedRainbow avatar Apr 12 '23 01:04 IsolatedRainbow

@IsolatedRainbow with the longliveautotools branch?

ducksosu avatar Apr 12 '23 01:04 ducksosu

yeah

IsolatedRainbow avatar Apr 12 '23 01:04 IsolatedRainbow

which distro did you install @IsolatedRainbow

ducksosu avatar Apr 12 '23 01:04 ducksosu

sudo CROUTON_BRANCH=longliveautotools crouton -t xfce -u

I'm attempting to install xfce xenial

IsolatedRainbow avatar Apr 12 '23 01:04 IsolatedRainbow

im gonna try xenial just to see if its just jammy doing it

ducksosu avatar Apr 12 '23 01:04 ducksosu

@IsolatedRainbow what version of chromeos are you on because this issue is only for chromeos 111

ducksosu avatar Apr 12 '23 01:04 ducksosu