m1gin 94

Jack Audio


Create a new client / port for jack audio:

  • pacmd load-module module-jack-source channels=2;
  • pacmd load-module module-jack-sink channels=2;

Disconnect ports/clients:

  • jack_disconnect "system:capture_1" "PulseAudio JACK Source-01:front-left"


Running jack with 44.1KHz for Ardour

Sometimes jack can't start with 44.1KHz but 48KHz. I am not sure but the reasan may be the sound card doesn't support 44.1KHz. In that case, opening an Ardour project created with 44.1KHz, problems happen.

To fix the problem we can start jack with dummy driver.

jackd -d dummy -r 44100

It is also possible to use qjackctl to start jack with dummy driver.

After that we can create some clients that appear in qjackctl connections.

  • alsa_in -d hw:0 -r 48000 -j extra_in
  • alsa_out -d hw:0 -r 48000 -j extra_out

And finally we can start Ardour project and connect Ardour's Master out ports to the newly created client named as extra_out in jack.

jack_connect "ardour:Master/audio_out 1" "extra_out:playback_1"
jack_connect "ardour:Master/audio_out 2" "extra_out:playback_2"

qjackctl can also be used for connections.

References:


Pulse Audio

TIP: When typing pactl and pacmd commands, TAB TAB can be used to see available options.


List available outputs:

pacmd list-sinks

Set default output device:

  • pacmd set-default-sink jack_out
  • pacmd set-default-sink 5

To set default input source channel/device:

  • pacmd set-default-source jack_in
  • pacmd set-default-source jack_out.2.monitor
  • pacmd set-default-source 1 # 1: microphone or 0: monitor


Mute / Unmute default input:

pactl set-source-mute @DEFAULT_SOURCE@ toggle

Change volume of default output:

pactl set-sink-volume @DEFAULT_SINK@ +5%


Restart pulse audio

  • pulseaudio -k
  • pulseaudio --start


List active apps for playback:

pacmd list-sink-inputs | tr '\n' '\r' | perl -pe 's/ *index: ([0-9]+).+?application\.name = "([^\r]+)"\r.+?(?=index:|$)/\2:\1\r/g' | tr '\r' '\n'

List active apps for recording

pacmd list-source-outputs | tr '\n' '\r' | perl -pe 's/ *index: ([0-9]+).+?application\.name = "([^\r]+)"\r.+?(?=index:|$)/\2:\1\r/g' | tr '\r' '\n'


Change source for mumble and use jack:

pactl list source-outputs | while read -r line ;
do
g=$(echo $line | grep -oP 'Source Output #\K[^$]+');
[ "$g" != "" ] && idx="$g";

g=$(echo $line | grep -oP 'application.process.binary = "\K[^"]+');
[ "$g" != "" ] && app="$g";

#echo $line | grep -oP 'application.process.id = "\K[^"]+';

echo $idx : $app

if [ "$app" == "mumble" ]; then
pactl move-source-output $idx jack_in;
app="";
fi;
done


Recording Stereo Mix (Test Edildi!)

Mikrofon sesini aşağıdaki komutla eşzamanlı dinlemek mümkün:

parec --latency-msec=1 | pacat --latency-msec=1

Bu hal üzere, monitor üzerinden kayıt alınarak, mikrofon ve sistem seslerinin eşzamanlı kaydedilmesi sağlanabilir.

http://ubuntuforums.org/showthread.php?t=2123423

Redirect microphone output to speaker:

pactl load-module module-loopback latency_msec=1'

To stop the routing of audio from Microphone to Speaker:

pactl exit

https://www.lynxbee.com/how-to-stream-microphone-audio-to-laptop-speaker-on-linux-ubuntu/


Noise / Echo Cancelling in PulseAudio

Load echo/noise cancel module and give it a name

pactl load-module module-echo-cancel source_name=testsource

Then it will be available in recording tab of sound mixer. it eliminates the background noise and microphone statics too much.

To set it as default source:

pactl set-default-source testsource




#ubuntu #sound #audio #input #output #mixer #soundcontrol #pulseaudio #jackaudio

Add to: