Showing posts with label audio. Show all posts
Showing posts with label audio. Show all posts

Thursday, June 5, 2014

Installing Ubuntu/Xubuntu 14.04 on the Dell XPS model 9333

Installing Ubuntu 14.04 on my Dell XPS 13 model 9333 requires a little more work than anticipated. This guide will show you how to get the touchpad working correctly and fix headphone jack audio bug.  This guide works for Ubuntu and any of it's derivatives using 14.04 as its code base.

I use Xubuntu on my XPS 13. I love Ubuntu, but Xubuntu offers me more control and a workspace that matches my workflow. No matter what edition of Ubuntu you decide to use, Trusty Tahr works really well on the Dell XPS 13.


Terminal commands are highlighted in blue. Ubuntu users need to use gedit instead of mousepad in their terminal commands.

Update your system
sudo apt-get update

Upgrade
sudo apt-get update

Reboot if necessary
sudo reboot

The updated Synaptic drivers for the XP3 13 touchpad are currently in Test Kernels. Canonical is doing their best to try and backport this functionality into 14.04 LTS so that users can take advantage of native i2c touchpad support. Until then you can download a test kernel or enable the testing repository. I downloaded acelan's testing kernel. Make sure you download all 4 debs. Install and reboot.



There is constant white noise that can be heard when headphones are plugged in, it makes using the audio jack impossible. There is also a poping noise heard when plugging in headphones. The fix involves creating a script and disabling the power saving mode of the audio card.The good news is this bug has been fixed in 3.16 kernels.

It is easier to run the commands as root, open a root terminal:
sudo su
Setup an init script to load the headphone fix at boot:
mkdir -p /etc/init.d/
wget -q -O /etc/init.d/xps http://xps13-9333.appspot.com/root/etc/init.d/xps
chmod +x /etc/init.d/xps
update-rc.d xps defaults

Create the audio fix script:
mkdir -p /usr/local/bin
wget -O /usr/local/bin/white_noise_fix.py http://xps13-9333.appspot.com/root/usr/local/bin/white_noise_fix.py
chmod 744 /usr/local/bin/white_noise_fix.py

Disable the power saving mode"
mkdir -p /etc/pm/config.d
echo INTEL_AUDIO_POWERSAVE=false > /etc/pm/config.d/snd_hda_intel

Apply the changes without needing a reboot:
echo 0 > /sys/module/snd_hda_intel/parameters/power_save
white_noise_fix.py

exit root permissions:
exit


For Xubuntu users:

You'll notice that there is significant screen tearing when watching videos in Xubuntu. Xfce's default window manager xfwm4 does not have sync to VBlank support. Compton supports VBlank and I written a guide for setting it up properly for the Dell XPS 13.

Before you install and configure Compton you need to turn off xfwm4 compositor. Under Settings>Window Manager Tweaks>Compositor


 Install and configure Compton:
sudo apt-get install compton
wget  -O ~/.config/compton.conf https://dl.dropboxusercontent.com/u/6062904/compton.conf

Then set Compton to run at startup. Under Settings>Session and Startup>Application Autostart. Click the Add button:


Name: Compton
Description: lightweight standalone compositor
Command: compton -b

Enable the Intel driver TearFree option:
sudo mkdir -p /etc/X11/xorg.conf.d/
sudo wget -q -O /etc/X11/xorg.conf.d/10-intel.conf http://xps13-9333.appspot.com/root/etc/X11/xorg.conf.d/10-intel.conf

reboot
sudo reboot

Check to see it was enabled
cat /var/log/Xorg.0.log | grep Tear


There are a couple options for configuring multitouch gestures in Ubuntu 14.04. I'm trying to get Touchegg working. Until then I'm using a simple bash script to tweak my synclient settings.

To setup the script:
mkdir ~/.scripts
touch ~/.scripts/touchpad_config.sh
chmod 744 ~/.scripts/touchpad_config.sh
mousepad  ~/.scripts/touchpad_config.sh


These settings change the tapping behavior, you can place whatever tweaks you want inside of it. Having the script wait 10 second or so provides enough time for the system to load, you can remove it but I prefer a bit of a buffer.
 #!/bin/bash
    sleep 10s &&
    synclient TapButton1=1;
    synclient TapButton2=2;
    synclient TapButton3=3

Feel free to leave comments and suggestions in the comments.

Saturday, May 24, 2014

Bit Perfect Audio in Ubuntu

Your operating system, music player, and sound card all work together to process the audio on your computer. While these settings are helpful, the processing of your audio by these devices often leads to distortion and a degradation in quality. Setting up bit perfect audio playback ensures that your audio goes directly to your preferred digital to analog converter (DAC) without alterations; giving you the best possible sound reproduction from your system.


I recently picked up a Schiit Stack for my desktop. Being impulsive, I bought it before I really knew how to setup bit perfect audio in Linux. After a lot of research and a bit of frustration, I found a few viable methods for setting bit perfect audio in Ubuntu.

Ubuntu and many distributions use PulseAudio to pass audio from applications and your hardware. As a burgeoning audiophile I don't really like that it re-samples the audio it processes. If you would like to get bit perfect audio with Pulse, I found an excellent guide that walks your through the steps. But I don't feel that that method is suitable for what I wanted to do on my system and requires more CPU and RAM usage. I wanted a simple and elegant solution for sending my audio stream directly to my DAC and let the  Modi process my audio.

In order to do this I used Advanced Linux Sound Architecture (ALSA) and Gmusicbrowser. The setup and configuration is incredibly easy and only involves a couple of terminal commands (highlighted in blue).


I'm using Xubuntu 14.04 but this guide will work in any Ubuntu/Debian derivative and many modern GNU/Linux distributions.

For non Ubuntu users you need to make sure the necessary ALSA tools are installed (change the sudo apt-get command with whatever is appropriate for your distribution) 
sudo apt-get install alsa alsa-utils

Install gmusicbrowser:
sudo apt-get install gmusicbrowser

Install the correct codecs for mp3, flac, ogg
sudo apt-get install gstreamer0.10-plugins-ugly flac libvorbis0a



This guide installs all the necessary dependencies for stock gmusicbrowser installs and audio playback. Consult the gmusicbroswer site for additional plugin dependencies

List Your audio devices/sound card
a play -l


As you can see my Schiit Modi DAC is listed as card: 1


Alternatively you can use alsa-mixer to find your audio device, once you enter the command press F6 to list your sound card


Now start gmusicbrowser and navigate to Settings>Audio:

Change output device to: alsa

Then click on advanced options 
Enter the correct sound card for your device, use the formula hw:X,0 replacing the X with your prefered sound card. For my DAC I entered hw:1,0

I really enjoy this setup, my audio plays from gmusicbrower without being touched and everything else plays through my speakers.

You can use other music players in Linux to achieve bit perfect playback in Linux, I also like DeaDBeef. Head-Fi user Rizlaw did an excellent write up other music players and his guides inspired this post.

Additionally you can also set VLC to use ALSA to send your audio directly to your DAC. You can find the Audio configuration setting under under Tools>Preferences.

Set Output module to ALSA audio output
And Devices to The Name of Your DAC, USB Audio Direct Hardware