Bluetooth Headphones in Arch Linux

This post has moved to eklausmeier.goip.de/blog/2016/10-26-bluetooth-headphones-in-arch-linux.

There is a big difference between noise-cancelling headphones, and classical headphones without noise-cancelling ability! Especially when you use them in a noisy environment, like a plane or a large office bureau. Inspired by a positive review of the Bose headphones by Marques Brownlee, I bought them.

Here is the review:

Pairing with my OnePlus One smartphone was completely automatic and works like a charm. No further explanation is required.

Paring with a PC/laptop running Arch Linux needed a little more effort. Some advice in Bluetooth headset helped me alot.

One-time configuation:

systemctl start bluetooth.service
hciconfig hci0 up piscan
pacmd list-sinks | grep index:
bluetoothctl

In bluetoothctl enter

help
show
devices
pair xx:yy:...
trust xx:yy:...
connect xx:yy:...
paired-devices

I had to delete the directory below /var/lib/bluetooth. Apparently something was stored there which shouldn’t have been there.

Once the pairing works, as described above, I just use:

systemctl start bluetooth.service
hciconfig hci0 up piscan

for starting bluetooth and making my PC with bluetooth visible. I switch on the headphone, which normally finds the PC in less than a second. Then I have to set the right sink via pacmd:

pacmd set-default-sink `pacmd list-sinks | grep index: | tail -1 | cut -d " " -f6`

Checking that all is well is:

pacmd list-sinks | grep index:

Once paired with your Linux machine, yo have to repeat set-default-sink if you lose the connection to your Linux machine, for example by walking too far away. If you lose Bluetooth connection apparently sound output will go to the regular speakers of your Linux machine. In case you are working in a large office other people will hear your music. Of course, you can mute the regular loudspeakers of your Linux machine using

pacmd set-sink-volume 0 0

assuming sink #0 is regular loudspeaker.

Added 13-Oct-2017: Arch Linux dropped hciconfig+hcictool from package bluez-utils since version 5.44. My latest good package still containing these commands is 5.43-2, for easy reference located here bluez-utils-5.43-2-x86_64.pkg.tar.xz. Download it and use ascii2hex.c to convert from hex to ascii/binary because WordPress.com does not allow XZ-files.

Running bacman in parallel

This post has moved to eklausmeier.goip.de/blog/2016/10-18-running-bacman-in-parallel.

The mailing list for pacman-dev contains an interesting thread when rebuilding packages from source, i.e., running bacman in parallel. Gordian Edenhofer ran some tests on performance when running one, two, three, up to six jobs in parallel.

The results, below, clearly show that using all your cores is of great benefit:

simple_benchmark

Continue reading

Why does deep and cheap learning work so well?

the morning paper

Why does deep and cheap learning work so well Lin & Tegmark 2016

Deep learning works remarkably well, and has helped dramatically improve the state-of-the-art in areas ranging from speech recognition, translation, and visual object recognition to drug discovery, genomics, and automatic game playing. However, it is still not fully understood why deep learning works so well.

So begins a fascinating paper looking at connections between machine learning and the laws of physics – showing us how properties of the real world help to make many machine learning tasks much more tractable than they otherwise would be, and giving us insights into why depth is important in networks. It’s a paper I enjoyed reading, but my abilities stop at appreciating the form and outline of the authors’ arguments – for the proofs and finer details I refer you to the full paper.

A paradox

How do neural networks with comparatively…

View original post 1,545 more words

Setting Keyboard-Language in IceWM

This post has moved to eklausmeier.goip.de/blog/2016/10-04-setting-keyboard-language-in-icewm.

If you start IceWM from GNOME, you can set your language settings in

~/.icewm/startup

For example

#!/bin/sh

setxkbmap de

Setting all available window-managers is done in

/usr/share/xsessions

Example: For starting icewm you can use the following configuration file /usr/share/xsessions/icewm-session.desktop

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=icewm
Name[en_US]=icewm
Comment=Simple and fast window manger
Terminal=false
Exec=icewm-session
TryExec=icewm-session

[Window Manager]
SessionManaged=true