Wheezy fresh install, Jack and youtube (alsa), patchage.

Post fully complete "how to" guides and tutorials here. This is a great place to get feedback on stuff you might put in the wiki.

Moderators: MattKingUSA, khz

Post Reply
Bas King
Established Member
Posts: 3
Joined: Fri Sep 06, 2013 10:49 am

Wheezy fresh install, Jack and youtube (alsa), patchage.

Post by Bas King »

This is a raw version

1. Get iso debian 7.1 netinstall

Check http://www.debian.org/CD/netinst/ for latest versions
64 bit:

Code: Select all

wget -O /tmp/debian-7.1.0-amd64-netinst.iso http://cdimage.debian.org/debian-cd/7.1.0/amd64/iso-cd/debian-7.1.0-amd64-netinst.iso
or 32 bit:

Code: Select all

wget -O /tmp/debian-7.1.0-i386-netinst.iso http://cdimage.debian.org/debian-cd/7.1.0/i386/iso-cd/debian-7.1.0-i386-netinst.iso
Burn it with brasero on a cd.

2. Install
This will delete ALL files on a hard-disk! Back essential data up first!

Plug all usb devices in
Boot burned cd (check bios to allow booting from cd)

Advanced options
Alternative desktop environments
Xfce (will also work with gnome if you prefer)
Install
Choose language
Choose country
Choose locale setting (leave default)
Choose keymap (leave default)
(wait)

Choose hostname (your computers name, make one up)
Choose domainname (your local network name, make one up, but keep it the same on all your computers in your LAN)
Root password (twice), this is your administrator password. DONT lose it.
A user name in human readable form (like 'Bas')
Username in lowercase to make /home/lowercase_username (continue)
User password (twice)

Guided - use entire disk (or manual if you know what you are doing)
Select HD you will install on
All files in one partition
You can mount your usb-sticks as fat32 partitions onto places like /mnt/usbstick or something, but dont delete the data on them (unless you want to)
Finish
Write changes? Yes.
(wait)

Choose debian country & mirror closeby
No proxy (unless you know you need one)
(wait)
Choose if you want to participate in the package survey
Select the parts you want. 'Debian desktop' and 'standard system tools' are essential.
Continue (t=20 minutes until now)
(wait a long time for download and install)

Install grub boot loader (yes)
Take out cd
Continue
Boot
Log in with username & password
(t=+30 minutes=50 minutes)

3. Dmesg startup errors?

In a terminal as a normal user type

Code: Select all

dmesg > ~/Desktop/dmesg.txt
Open it and search for any 'error' that look serious
(Note: "re-mounted. Opts: errors=remount-ro" is not a problem but a harmless option setting)

4. Contrib & Non-Free
If you need any realtek firmware drivers,
Or support for a video card that is in non-free,
Or you want to use flashplugin-nonfree or anything else from non-free or contrib:
Add contrib & non-free to the repositories

Code: Select all

echo "
deb http://ftp.nl.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.nl.debian.org/debian/ wheezy main contrib non-free

deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

# wheezy-updates, previously known as 'volatile'
deb http://ftp.nl.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://ftp.nl.debian.org/debian/ wheezy-updates main contrib non-free
" > etc/apt/sources.list
Now update the local repositories

Code: Select all

apt-get update
Install realtek firmware if needed http://packages.debian.org/wheezy/firmware-realtek

Code: Select all

apt-get -y install firmware-realtek
Perhaps a videocarddriver listed in http://packages.debian.org/wheezy/firmw ... ux-nonfree

Code: Select all

apt-get -y install firmware-linux
Optional

Code: Select all

apt-get -y install chromium
Also optional

Code: Select all

apt-get -y install flashplugin-nonfree
5. Audio layers, some tools and plugins

Install pulseaudio

Code: Select all

apt-get -y install pulseaudio
PulseAudioVolUme-control

Code: Select all

apt-get -y install pavucontrol
JackD(aemon) - choose YES when asked about realtime

Code: Select all

apt-get -y install jackd
QJackCtl to control the jack daemon

Code: Select all

apt-get -y install qjackctl
Patchage to see and set all sound connections in jack

Code: Select all

apt-get -y install patchage
Pulse-Jack module:

Code: Select all

apt-get -y install pulseaudio-module-jack
Optional VLC & VLC-Jack plugin

Code: Select all

apt-get -y install vlc
apt-get -y install vlc-plugin-jack
6. Write config files

Let all alsa sound be handled by pulse

Code: Select all

echo "
pcm.pulse {  type pulse  }
ctl.pulse {  type pulse  }
pcm.!default {  type pulse  }
ctl.!default {  type pulse  }
" > /etc/asound.conf
Pulse config file to make it play nice with jack

Code: Select all

echo "
load-module module-stream-restore
load-module module-rescue-streams
load-module module-always-sink
load-module module-native-protocol-unix
load-module module-suspend-on-idle

load-module module-jack-sink 
load-module module-jack-source
load-module module-null-sink
set-default-sink jack_out
set-default-source jack_in
" > /etc/pulse/default.pa
Some settings for the pulse daemon, check http://linux.die.net/man/5/pulse-daemon.conf for all possible options and formats.

Code: Select all

echo "
default-sample-format = float32le
default-sample-rate = 48000
realtime-scheduling = yes
exit-idle-time = -1
" > /etc/pulse/daemon.conf
7. Slot order (optional)

Add slot order to alsa base conf, to find capture and playback devices try

Code: Select all

aplay -l
arecored -l
lsmod | grep snd
The libs with no other libs behind them are possible candidates, use - (minus) instead of _ (underscore) in the card-name
If you have only one card, this step is not needed: it will always be in the same slot.
You can also leave one or more slots open (type only a comma)
This is an example for my case: ca0106 in slot 0, hda-intel in slot 1

Code: Select all

echo 'options snd slot=snd-ca0106,snd-hda-intel' >> /etc/modprobe.d/alsa-base.conf
8. Show some extra information

in qjackctl (setup): set audio in & out to the proper hw:x,x card/device, save as default
Check 'Enable D-Bus Interface' under the 'Misc' tab, ok, ok, quit.
Reboot
Then run qjackctl,
Start and check messages to see if that went allright

Jack, pulse or alsa sound: they all come together now (see patchage)
Alsa will be routed to pulse, pulse will dump everything to jack
The alsa progams dont even know pulse/jack are running
Youtube, vlc in alsa mode, aplay, anything that works with alsa (or pulse) will work through jack, including jack apps: Simultaneously

(Note: no tinkering with audio group or real-time permissions is needed to make things work)

9. Patchage examples

Install jack-rack effects

Code: Select all

apt-get install jack-rack
Open both a jackrack and patchage
In patchage, press ctrl-g to order everything
001.png
001.png (13.9 KiB) Viewed 776 times
Disconnect both pulseaudioJackSink channels (left and right) from system_playback
Connect pulseaudioJackSink channels to JackRack_in
Connect JackRack_out to system_playback
002.png
002.png (11.8 KiB) Viewed 776 times
In jackrack add an effect like an multiband equalizer or something
Press 'enable'
Play some youtube sound: you can now equalize it or something
After closing jackrack, you have to reattach system_playback to pulseaudioJackSink to restore original sound 'stream'
You can add other jack tools as well, and chain them all up. Like ReNoise, or audacity etc.

All alsa and pulse applications only have one combined audiostream in each direction: pulseaudioJackSink (playback) and pulseaudioJackSource (record)
You can only manipulate them 'all together at once' in patchage. The only way to influence the sound individually is inside the app itself (turn volume down on youtube etc)
Look at vlc, if you set it to 'alsa default out' or 'pulseaudio out', you can run two, but you only can get the combined sound through pulseaudioJackSink in jack...
So you cannot set an individual equalizer on each vlc, only on the both combined: as long as they come from alsa (and/or pulse).
But if you open two vlc's with preferences set to jack-out, they will pop up in patchage and you can plug them in to whatever you want, open op two jackracks each with an equalizer, and connect them to the vlc's_out and system_playback, and you will be able to equalize them individually

Another example
Open two vlc's with preferences set to audio jack-out, load some music in them, and pause them
Open up a youtube music page, and pause the sound
Open three jack-racks, select one (or more) effects in each of them, like a multiband equalizer, and preset and enable them

In patchage, disconnect all from system_playback
Connect each vlc and the pulseaudiosink to a different jack-rack, and the audio out from the jack-racks to to system_playback
Play the youtube and vlc sounds, fiddl with their jackracks to make the sound sound pretty.

Offcourse you can load any jack-program, and include them into any stream you create. You could put a fourth jack-rack (with, say, an amplifier) just in front of the system_playback, for example, etc, ect, etc
005a.png
005a.png (43.11 KiB) Viewed 776 times
.

A note on setting the audio out in vlc: you have to quit/restart vlc for the new settings to be in effect.

10. Panic: Howto reset audio
In case sound stops working or qjackctl hangs and such (which happens mostly while trying out some faulty new settings etc):

Stop all sound using software
Including browsers.

Kill jack processes:

Code: Select all

ps aux | grep 'jack'
Output:

Code: Select all

root 1537 0.0 0.0 7828 880 pts/3 S+ 09:15 0:00 grep jack
bas 7861 0.8 0.7 187256 91364 ? SLsl Sep09 10:06 /usr/bin/jackd -T -ndefault -dalsa -r44100 -p1024 -n2 -D -Chw:0,0 -Phw:0,1
bas 11109 0.0 0.0 99084 4448 ? Ss Sep09 0:06 /usr/bin/jackdbus auto
bas 12186 0.0 0.0 4176 576 ? S Sep09 0:00 /bin/sh /usr/bin/qjackctl
bas 12192 0.3 0.9 588840 114112 ? SLl Sep09 4:29 /usr/lib/qjackctl/qjackctl.real
So I do:

Code: Select all

kill -9 7861
kill -9 11109
kill -9 12186
kill -9 12192
Kill pulseaudio
as normal user:

Code: Select all

pulseaudio -k
Restart alsa
as superuser:

Code: Select all

alsa force-reload
Restart pulseaudio
as normal user:

Code: Select all

pulseaudio -D
Restart jack
start jack with qjackctl

Or else...
reboot
danboid
Established Member
Posts: 1327
Joined: Sun Aug 26, 2012 11:28 am
Location: England
Has thanked: 1 time
Been thanked: 4 times

Re: Wheezy fresh install, Jack and youtube (alsa), patchage.

Post by danboid »

People wanting to install vanilla Deb (instead of say Mint Debian or Kanotix) may find installation easier using a non-free firmware inclusive installer, like from here:

http://cdimage.debian.org/cdimage/unoff ... -firmware/

Ubuntu and some of the more desktop orientated Deb distros like Kanotix include such firmware by default, but the official Deb installers do not. It used to be rare 5-10 years ago to find an ethernet card that wasn't supported by Linux OOTB without resorting to firmware blobs but they seem much more common today.
Post Reply