Thursday, December 19, 2013

setting up Archlinux for hiface Dac

Thanks to Rob of the Hifiwinkel Iwas able to test the hiface Dac
I was  not content about how I was able to play my digital files and how the music came through on  my high end hifi. Indeed the usb dac is plug and play and instantly recognized by the Linux Os. (On windows you have to install some drivers.)
Start alsamixer, for instance by typing that in the terminal and do f6 to change  your soundcard and choose M2Tech Usb Audio.

You will be able to play and use the sound card but will also have to set up audio player to recognize the right audio source.
After trying some I decided for using Deadbeef. And found here how to set it up :
 DeaDBeef:  (a) Click on the Edit menu, then Preferences.
                       (b) In the Preferences window under "Sound" : "Output plugin" = "ALSA"
                                                                          "Output device" = "M2 Tech USB Audio"              
                       (c) In the same Preferences window select: Plugins
                            In the left column select "Alsa Output Plugin" and then click the "Configure" button
                            In the configuration window make sure that ALSA resampling is unchecked and that you place a check in box to "Release device when stopped".
This made the sound already quite acceptable.
This post in the same thread opened the way to an even better sound:


Theres an option to achive even higher sound quality with alsa and jack. Jack in general is the linux alternative to ASIO (to achieve low latency it bypasses kernel mixing just like ASIO on windows) and its has nice server app. After installing JACK You just need to start sound server, set it like this:



(I've highlighted with red important ones)
This setup should output bit-perfect SD audio. (I cant do a null-test with my setup to check if it's 100% bit perfect but my ears feel fine with the reproduction quality :))
I recomend Audacious with JACK output plugin or using system wide sound capture to jack and then You can use whatever You like.
You can use JACK with ALSA system wide by creating .asoundrc in Your home directory containing:

# use this as default
pcm.!default {
type plug
slave { pcm "jack" }
}

ctl.mixer0 {
type hw
card 1
}

# pcm type jack
pcm.jack {
type jack
playback_ports {
0 system:playback_1
1 system:playback_2
}
capture_ports {
0 system:capture_1
1 system:capture_2
}
}

 I set asound.conf system wide in the etc folder.
And I made some changes to the set up of Jack  using qjackctl
Frame period is 256 and of course another sound card, see below.
 Here is first some help for installing jack:

#pacman -S jack qjackctl
Qjackctl is an essential gui for configurating and starting jack and also here you have to set the right sound card; so the hw:0 will become hw:1
Use to find out, what you have to choose:

ls /proc/asound/cards

Using Deadbeef which is a fine audio player install from AUR the  deadbeef-plugin-jack-git .
$yaourt -S deadbeef-plugin-jack-git

To allow Alsa programs to play while jack is running you must install the jack plugin for alsa with alsa-plugins.
To set up the usb sound card as the default:
Add in /etc/modprobe.d/alsa-base.conf:
# Assign USB Audio as default sound card
options snd_usb_audio index=-1
Delete these last TWO lines in the file:



# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2

Procedure of starting up jack:
First be sure the right sound card is chosen
Go to qjackctl and start jack (click start button) and get jack rolling by clicking the play button.
Configuring openbox for qjackctl
You may have to set up your desktop environment to automatically start up cjackctl, in openbox by adding something like this to /home/user/.config/openbox/autostart
(sleep 62s && qjackctl) &
or with a keyboard shortcut in /home/user/.config/openbox/rc/xml
There are more options like using jack2, see the Arch wiki for that

There are people saying that jack isn't needed for playback:
Since ALSA is said to be already very efficient and low latency, providing very good quality playback with no additional mixing when stated within it's .asoundrc file, unlike MS Windows, Jack probably isn't needed for most. 
Just try all the options and see what works best for you...

Want to dive into the world of Linux Audio on Archlinux; go here

If you have a nvidia card and a lot of xruns using jack (see messages), you should use nvidia-settings and set under Powermizer GPU to Maximum Performance.

No comments:

Blog Archive