From Mageia wiki
(Redirected from Dev Soundstudio)
Jump to: navigation, search


Mageia Sound Studio

(A subgroup for sound and audio creation with mageia)

The idea

Create an easy way to turn Mageia into a soundcreation studio / digital audio workstation without creation of a spin-off or derivate.

State of thoughts

The kernel

  • do we need the RT-Preemption-patch ??
    • This will depend on the kernel-features the standard kernel will offer
    • Thomas Backlund offers a Kernel that has all features in, called kernel-tmb
      • Complete Preemption (Real-Time)
      • Timer frequency>> 1000 HZ
      • RCU Implementation (Preemptable tree-based hierarchical RCU)
      • Tickless System can be switched off by booting with "nohz=off"
  • which other flags could be needed ??

The installation

  • use several tasks-sound-... that install packages for group "base", "effects", "soundfonts", .... too much stuff in the repository
  • use a wizard that installs the basic packages and alters/adds files needed for audio creation
    • will depend on if something like **drakwizard** will be available in Mageia
      • advantages: no extra packages needed, nice structure with page and sub section
      • can install packages, check system, alter/add files
  • use a script that installs the basic packages and alters/adds files needed for audio creation
    • muny's proposal with **kdialog** or **zenity**:
      • question is how many packages have to be installed to run kdialog in pure Gnome or zenity in pure KDE
      • can do both all of the above
  • or maybe a **Python** script with **Tk**
    • python includes Tk and mostly Python is installed by default so no add packages would be needed


Files that have to be altered/added

add to limits.conf:

@audio - rtprio 95
@audio - memlock unlimited

@audio - nice -10 not really needed

add to /etc/rc.d/rc.local:

echo 2048 >/sys/class/rtc/rtc0/max_user_freq
echo 2048 >/proc/sys/dev/hpet/max-user-freq
echo 0 > /proc/sys/vm/swappiness 

add file 40-rtc-permissions.rules in /lib/udev/rules.d

KERNEL=="rtc0", GROUP="audio"

add file 40-hpet-permissions.rules in /lib/udev/rules.d

KERNEL=="hpet", GROUP="audio"

Set pulseaudio off in /etc/sysconfig/pulseaudio

Pulseaudio and Jack both use Alsa, but we want Jack

PULSE_SERVER_TYPE=none 

NB Rather than editing /etc/sysconfig/pulseaudio, it would be much better to create a "sound profile". PA does this and it's a way to convert between a pure ALSA and a PA setup. Another profile could easily add support for JACK instead. See "update-alternatives --display soundprofile" Ask me (coling) for more info.

Packages installed by wizard or script

  • provide all sound-packages this distribution offers and install them
  • install basic packages needed to run a sound studio - user can install apps he wants to using MCC
  • install basic packages needed to run a sound studio plus some up-to-date apps for audiocreation
  • provide user-driven installation "ala carte"
    • automated checkroutine for sound requirements
    • installs groups in basic mode (midi-utilities, soundfont-creation, score&tabalure, LADSPA, LV2, DSSI, Synths, DAW&Sequencer, Effectracks, RT-Kernel)
    • single apps choosing in advanced mode

Kerneltests

I (saschas) did a simple XRUN-test to compare the kernels:

same song in same daw with qjackctl, same everything, except the kernel

I used the Hunz-Demo-song in Renoise 2.6 with low Frames in QJackctl to force some XRUNS on my Laptop with onboard soundcard.

  • kernel-desktop-2.6.33.7-2mnb => 14 XRUNS
  • kernel-desktop-tmb-desktop-2.6.34-10mdv => 10 XRUNS
  • kernel-rt-2.6.33.5-1.rt23.1 => 2 XRUNS


libs/packages absolutely needed

app/lib link status issues last update
E ((essential)) W ((worth to have in configurator)) P ((provide package - but not include in configurator))
jackit http://jackaudio.org/ X no known 2010
qjackctl http://qjackctl.sourceforge.net/ X JACK2 (>= 1.9.7) needed 2010
cadence http://kxstudio.sourceforge.net/Applications:Cadence/ X Alternative to qjackctl, providing more tools. 2014
lash http://savannah.nongnu.org/projects/lash X needed to compile some apps 2005
ladish http://ladish.org/ X still in prerelease state 2010
laditools http://marcochapeau.org/software/laditools X no known 2009
rtirq http://www.rncbc.org/drupal/search/node/rtirq X only makes sense with preempt-rt kernel 2009
ffado http://www.ffado.org/ X only makes sense if firewire interface is used 2010
libalsa-plugin-jack ??? X no known ???

Script Idea, to review and improve

could be kdialog or zenity

#!/bin/bash
clear
if [ $UID != 0 ] ; then
        exit
fi

hello=`kdialog --yesno "WARNING : This script totally broke your system \
not sure... but possible... \
WARNING : are you sure you execute it ? (yes or no ?) "`
if [ $? != 0 ] ; then
        exit
fi

ex="CTRL+C"
sess=/etc/X11/xinit.d/
lim=/etc/security/limits.conf
pulse=/etc/sysconfig/pulseaudio
rcloc=/etc/rc.local
desk=$(cat /etc/sysconfig/desktop |grep -i desktop |cut -d= -f2)
mem=$(cat /proc/meminfo |grep MemTotal |cut -d: -f2 |cut -dk -f1)
wn=$(who -m |cut -d\  -f1) 

trap sor INT
sor() {
        echo $ex
        sleep 1
}

parl() {
        echo $step
}
 
for_phonon() {
        step="3) Change Phonon backend"
        parl
        urpmi --auto phonon-vlc phonon-xine
        urpme phonon-gstreamer
        }

upd_usgr() {
        step="2) Add User in Audio Groups"
        parl
        gpasswd -a $name audio &>/dev/null
        gpasswd -a $name rtkit &>/dev/null
}

ram_limit() {
        step="4) Ram Check"
        parl
        if [ $mem -gt 2800000 ] ; then 
                rlim="unlimited" && upd_lim
        elif [ $mem -lt 500000 ] ; then
               rlim=none && upd_lim && min_rlim
        elif [ $mem -gt 500000 ] && [ $mem -lt 1000000 ] ; then
                rlim="300000" && upd_lim
        elif [ $mem -gt 1000000 ] && [ $mem -lt 2000000 ] ; then
                rlim="500000" && upd_lim
        elif [ $mem -gt 2000000 ] && [ $mem -lt 2800000 ] ; then
                rlim="1000000" && upd_lim
        fi
} 

upd_lim() {
        step="5) Simple Memlock Config"
        parl
        sed -i '/audio/d' $lim
cat > $lim << EOF
# $lim
#
$name           -       rtprio          70
$name           -       nice            -15
$name           -       memlock         $rlim
$name           -       nproc           1500
# End of file
EOF
}

min_rlim() {
lig=$(grep -n memlock $lim |grep \@ |cut -d: -f1)
sed -i $lig\d $lim
}

upd_fstab() {
        step="7) SHM please"
        parl
        echo "tmpfs /dev/shm tmpfs defaults 0 0" >> /etc/fstab
        echo "devpts /dev/pts devpts gid=5,mode=620 0 0" >> /etc/fstab
}

nopulse() {
        step="6) No PulseAudio by Default"
        parl
        mv $pulse $pulse.old
        echo "PULSE_SERVER_TYPE=none" > $pulse
}

ins_jack() {
        step="1) Jack and Audio Plugins"
        parl
        urpmi --auto --no-suggests task-sound-studio schedtool rtirq
}

ins_codec() {
        step="8) Add codecs and encode tools, PLF too if possible"
        parl
        urpmi --auto flac vorbis-tools twolame libffmpeg52 libvorbisenc2 \
        ffmpeg2theora transcode mencoder ffmpeg libdirac0.1 libavformats52 \
        libavutil49 lame lame-mp3x libquicktime-faac libquicktime-faad \
        libquicktime-x264 x264 vorbisgain faac faad2 xanim-codecs win32-codecs real-codecs 
}

clop() {
        step="9) Adjust Udev rights for RTC and Hpet"
        parl
        echo "KERNEL==\"rtc0\", GROUP=\"audio\"" > /lib/udev/rules.d/40-rtc-permissions
        echo "KERNEL==\"hpet\", GROUP=\"audio\"" >> /lib/udev/rules.d/40-hpet-permissions
}

lcal() {
        step="11) some tuning easy in rc.local"
        echo "echo 1500 > /proc/sys/vm/dirty_writeback_centisecs" >> $rcloc
        echo "echo 0 > /sys/module/snd_hda_intel/parameters/power_save" >> $rcloc
        echo "echo 1 > /sys/devices/system/cpu/sched_mc_power_savings" >> $rcloc
        echo "echo 0 > /proc/sys/vm/swappiness" >> $rcloc
        echo "echo 2048 > /proc/sys/dev/hpet/max-user-freq" >> $rcloc
        echo "echo 2048 > /sys/class/rtc/rtc0/max_user_freq" >> $rcloc
        echo "hdparm -B 250 /dev/sda" >> $rcloc 
}

ins_jack && upd_usgr
for_phonon && ram_limit
nopulse && upd_fstab
ins_codec && clop && lcal

echo "restart computer for new kernel and system config ? type yes !"
read resp
if [ $resp == yes ] ; then
        echo "ok, restart"
        shutdown -r now
                else echo "please restart computer"
fi

Volunteers

Please add your name/nick here

nick real name what can you do to help
saschas Sascha Schneider coordination, gathering information, testing
muny testing, rpm
Animtim infos, testing, rpm

Comments/Discussion

Although it is not an official forum, I started a thread on http://www.mageiausers.org/discussion/11/mageia-sound-studio All thoughts and discussions here will be gathered and edited here.

I also added a non official irc channel for discussions on freenode | #mageia-soundstudio

Resources

A very good and up-to-date list of applications useful for audio work is maintained here: http://libremusicproduction.com/tools (note: most of these packages are currently missing or not up-to-date in cauldron, packagers needed..)