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

Using JACK for recording #1434

Closed s5bug closed 9 years ago

s5bug commented 9 years ago

I want to record my game with my headset mic, and the first method (using PulseAudio) nearly blew my ears out. I want to uninstall PulseAudio to get JACK, but I'm not sure if it is safe. Here: http://www.maartenbaert.be/simplescreenrecorder/recording-game-audio/#recording-game-audio-and-microphone-at-the-same-time

dnschneid commented 9 years ago

That should be fine, although you may have to manually start JACK after installation.

s5bug commented 9 years ago

Do I look at the documentation for that? QJackCtl didn't work because of ALSA whatever.

 ___      .__   __. .___________. __    __    ______   .__   __.

/   \     |  \ |  | |           ||  |  |  |  /  __  \  |  \ |  |

\ \ / / / ^ \ | | | ---| |----| || | | | | | | | | \ \ / / / /_\ \ | . | | | | __ | | | | | | . | / / ___ \ | |\ | | | | | | | | `--' | | |\ | | | // \\ || \| || || || ____/ || \| |__|

On Sun, Feb 22, 2015 at 8:12 PM, David Schneider notifications@github.com wrote:

That should be fine, although you may have to manually start JACK after installation.

— Reply to this email directly or view it on GitHub https://github.com/dnschneid/crouton/issues/1434#issuecomment-75487376.

s5bug commented 9 years ago

Get this log using QJackCtl:

15:56:42.653 Patchbay deactivated.
15:56:42.655 Statistics reset.
15:56:42.683 Could not open ALSA sequencer as a client. ALSA MIDI patchbay will be not available.
ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: Permission denied
15:56:50.090 D-BUS: Service is available (org.jackaudio.service aka jackdbus).
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
15:57:54.863 D-BUS: JACK server could not be started. Sorry
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
Mon Feb 23 15:57:54 2015: Starting jack server...
Mon Feb 23 15:57:54 2015: JACK server starting in realtime mode with priority 10
Mon Feb 23 15:57:54 2015: ERROR: Cannot lock down 82274202 byte memory area (Cannot allocate memory)
Mon Feb 23 15:57:54 2015: ERROR: control open "hw:0" (No such file or directory)
Mon Feb 23 15:57:54 2015: ERROR: control open "hw:0" (No such file or directory)
Mon Feb 23 15:57:54 2015: creating alsa driver ... hw:0|hw:0|1024|2|44100|0|0|nomon|swmeter|-|32bit
Mon Feb 23 15:57:54 2015: ERROR: control open "hw:0" (No such file or directory)
Mon Feb 23 15:57:54 2015: ERROR: ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
Mon Feb 23 15:57:54 2015: ERROR: Cannot initialize driver
Mon Feb 23 15:57:54 2015: ERROR: JackServer::Open failed with -1
Mon Feb 23 15:57:54 2015: ERROR: Failed to open server
Mon Feb 23 15:57:56 2015: Saving settings to "/home/firestar115/.config/jack/conf.xml" ...
15:58:00.551 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started

Returns error.

s5bug commented 9 years ago

Running:

$ aplay -D pcm.jack ~/Downloads/Black\ Mesa\ EBS.mp3 
jack_client_new: deprecated
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
aplay: main:722: audio open error: No such file or directory

Copy of my ~/.config/jack/conf.xml:

<?xml version="1.0"?>
<!--
JACK settings, as persisted by D-Bus object.
You probably don't want to edit this because
it will be overwritten next time jackdbus saves.
-->
<!-- Mon Feb 23 16:33:56 2015 -->
<jack>
 <engine>
  <option name="driver">alsa</option>
  <option name="realtime">true</option>
  <option name="verbose">false</option>
  <option name="client-timeout">500</option>
 </engine>
 <drivers>
  <driver name="loopback">
  </driver>
  <driver name="net">
  </driver>
  <driver name="dummy">
  </driver>
  <driver name="firewire">
  </driver>
  <driver name="netone">
  </driver>
  <driver name="alsa">
   <option name="device">hw:0</option>
   <option name="capture">hw:0</option>
   <option name="playback">hw:0</option>
   <option name="rate">44100</option>
   <option name="period">1024</option>
   <option name="nperiods">2</option>
   <option name="hwmon">false</option>
   <option name="hwmeter">false</option>
   <option name="duplex">true</option>
   <option name="softmode">false</option>
   <option name="monitor">false</option>
   <option name="dither">n</option>
   <option name="shorts">false</option>
  </driver>
  <driver name="alsarawmidi">
  </driver>
 </drivers>
 <internals>
  <internal name="profiler">
  </internal>
  <internal name="netadapter">
  </internal>
  <internal name="netmanager">

  </internal>
  <internal name="audioadapter">
  </internal>
 </internals>
</jack>
dnschneid commented 9 years ago

Try killing of cras (sudo stop cras in the crosh shell), then add yourself to the audio-hw group in crouton (sudo adduser $USER audio-hw), exit the chroot, enter the chroot, and try again.

s5bug commented 9 years ago

adduser: The group `audio-hw' does not exist.

 ___      .__   __. .___________. __    __    ______   .__   __.

/   \     |  \ |  | |           ||  |  |  |  /  __  \  |  \ |  |

\ \ / / / ^ \ | | | ---| |----| || | | | | | | | | \ \ / / / /_\ \ | . | | | | __ | | | | | | . | / / ___ \ | |\ | | | | | | | | `--' | | |\ | | | // \\ || \| || || || ____/ || \| |__|

On Mon, Feb 23, 2015 at 4:45 PM, David Schneider notifications@github.com wrote:

Try killing of cras (sudo stop cras in the crosh shell), then add yourself to the audio-hw group in crouton (sudo adduser $USER audio-hw), exit the chroot, enter the chroot, and try again.

— Reply to this email directly or view it on GitHub https://github.com/dnschneid/crouton/issues/1434#issuecomment-75675541.

dnschneid commented 9 years ago

Argh, hwaudio, sorry.

s5bug commented 9 years ago

It kind of worked... https://www.youtube.com/watch?v=OMOlU5ajP9E

s5bug commented 9 years ago

WAIT! I CAN'T HEAR ANY SOUNDS ON MY CHROMEBOOK AND MY MIC ISN'T GOING THROUGH! :anguished:

dnschneid commented 9 years ago

Yes, when you tell crouton to take over the hardware audio device, Chromium OS audio will stop working. You need to stop JACK and then do a sudo start cras in Chromium OS to get it back.

s5bug commented 9 years ago

Worked!