Troubleshoot: Common Solutions

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
User avatar
schivmeister
Established Member
Posts: 95
Joined: Sat Apr 12, 2008 9:28 am
Location: Singapore
Contact:

Troubleshoot: Common Solutions

Post by schivmeister »

I think we can have this as a thread where everyone contributes and it'll be updated. The idea is to gather solutions to problems that are simple (not too long) yet informative, plus add any hint or tip alongside as well.

Legend

T = Tip
E = Explanation
A = Answer

General

T: You don't need a Realtime (RT) kernel, nor the RT option in JACK, to carry out simple audio tasks such as editing single files or recording a few tracks, or even sequencing an entire drum track with Hydrogen minus effects (you can use bare ALSA without JACK too).

Application or Realtime not working
E: Realtime is now granted on a per-group or per-user basis via Pam Security. The older, deprecated (to an extent) realtime-lsm method is no longer encouraged.
A: Ensure that you have a login manager like KDM, GDM, XDM or Slim. NEVER start JACK or QJackCtl as root. The group or user privileges are handled by the file /etc/security/limits.conf.

MIDI

Notes are higher by at least half a tone
E: This is caused by resampling. Depending on hardware, you will get mixed results from loading a 44100Hz sample into a 48000Hz project. You have to understand the process of up/downsampling, take a look here.
A: Stick to a uniform sample rate, most commonly 44.1KHz. This is to nullify the effects of bad sample rate conversion. If you have to work on a project with a higher rate, pre-convert the samples; before you start working with them. Sometimes, you may have to set the rate on a per-application basis even if JACK is handling the communication. Check the settings of your program if that is the case.
T: You can use a shell script along with a multimedia editing tool to resample files in a given directory. Copy and paste the following in a terminal:

Code: Select all

cd
wget -O resample.sh http://rafb.net/p/KklzsX52.txt
install -m755 resample.sh /usr/local/bin/resample
rm resample.sh
resample
The above is a custom script suggested by thorgal (partly edited by me) which places the script in /usr/local/bin as simply resample. Self-explanatory.
Last edited by schivmeister on Sun Apr 13, 2008 9:43 am, edited 2 times in total.
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Troubleshoot: Common Solutions

Post by raboof »

schivmeister wrote:I think we can have this as a thread where everyone contributes and it'll be updated. The idea is to gather solutions to problems that are simple (not too long) yet informative, plus add any hint or tip alongside as well.
Good idea! Nathan mentioned setting up a wiki for linuxmusicians, this should be good content for it once it's up!
thorgal
Established Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Post by thorgal »

T: my little shell script to resample an entire directory full of wav files

Prerequisite : make sure you have the 'samplerate-programs' package installed. For debianized systems :
sudo apt-get install samplerate-programs.

Then, the home-made script (no big deal)

Code: Select all

#!/bin/sh

newrate=96000
opt=$1
val=$2

if [ -n "$opt" ]; then
   if [ "$opt" != "-r" ]; then
      echo " *** command line option is -r <your sample rate value>"
      echo "     example : resample_wav.sh -r 48000"
      echo "     You can also do it without option, internal default is 96000"
      exit 1
   fi
   if [ -z "$val" ]; then
      echo " *** if you're using the -r option, provide a sample rate value"
      exit 2
   fi
   newrate=$val
fi

echo " RESAMPLING ALL WAV FILES to NEW SAMPLERATE $newrate ... "
echo " ========================================================"

for fname in `ls -1`; do
   wav_file=`file $fname | grep "WAVE audio"`
   if [ -z "$wav_file" ]; then
       echo "'$fname' is NOT a wav file, skipping ..."
   else
      mv $fname $fname.old && sndfile-resample -to 96000 -c 0 $fname.old $fname && rm $fname.old
   fi
done
save it to a file called e.g. resample_wav.sh, make it executable (chmod +x resample_wav.sh) and place it in your PATH (somewhere like /usr/local/bin or $HOME/bin. The /usr/local/bin requires sudo to be able to move the script).

Then go to a directory full of wav files, and type

resample_wav.sh (default to 96000Hz)

or

resample_wav.sh -r 48000 for a value other than the default one.

You can do exactly the same with flac files, except that the script shall grep on "FLAC audio" instead. You can expand the script at your own will to include both types or more if you want. I found it very useful when I switched sample rate and ardour would play 48000Hz files twice faster (or slower) ... :)
User avatar
schivmeister
Established Member
Posts: 95
Joined: Sat Apr 12, 2008 9:28 am
Location: Singapore
Contact:

Post by schivmeister »

Yeah a wiki would definitely be good. This one has a limit whereby only the threadstarter can edit. Another way would be to create a separate forum account eg. "wiki" and let everyone have access to it. This was how it was done in the Arch Linux forums some many years ago :lol:

Thanks thorgal, edited to include a few more things.
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: yes!

Post by raboof »

eryereo wrote:bump up then lurk
(spambot, please remove)
User avatar
nathan
Site Admin
Posts: 405
Joined: Mon Dec 11, 2006 8:53 pm
Location: Phoenix, AZ
Been thanked: 5 times
Contact:

Post by nathan »

Killed the bot.

Also, those of you thinking about the wiki..., it's always a work in progress, but http://wiki.linuxmusicians.com is up. Check it out!
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Post by raboof »

nathan wrote:Killed the bot.
cool, thanks. His posts still seem to be there, can they be removed also?
Post Reply