Showing posts with label Slackware. Show all posts
Showing posts with label Slackware. Show all posts

Tuesday, May 14, 2024

Slackware64 in a Raspberry Pi 3 Model B

Slackware also provides a version for ARM processors. The installation depends on the ARM implementation and system you are using. Here I'm installing Slackware on an RP3B, to use it as a file server (NFS) and a media server over DLNA.

My main source of information is from Sarpi, this post is just a summary of their "How to ...". 

Installation

First, download:

- Installer image: sarpi3_64-installer_slackcurrent_03May24_sp1.img.xz

- Slackware: rsync -Pravv --delete slackware.uk::slackwarearm/slackwareaarch64-current .

Then, a micro SD card is used to boot the RP and start the Slackware installer. The Slackware root directory (installation files) is stored in a USB stick. 

- Write the installer image to a micro SD card.

- Write the Slackware files to a USB stick.

Alternatively, if you have used the micro SD card to boot the RP before, you can just copy the boot files from the image and delete the old files in your micro SD. This is handy if you are reinstalling Slackware over the same system.

Slackware will be installed in the same micro SD card used to boot the installer. Then, we need to create the partitions to hold the system. That is the boot, swap and root. The boot partition was already created when writing the installer, so you only need to make the other two.

To enable the network interface from the boot and start an SSH server, edit the file 'cmdline.txt' appending the following:

kbd=de nic=e1000:eth0:static:192.168.2.7:24:192.168.2.254

I used a static IP address because my router is slow in assigning it dynamically. So slow that the installer cancels the SSH server start before getting an IP.

When connecting to the installer via SSH, it is common to get the message "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!" and the connection is closed. To avoid that, delete the keys for that IP from your ~/.ssh/known_hosts file.

Connect to the RP's SSH server: ssh root@192.168.2.7

# setup

After installation, don't reboot immediately.

At this point, the future root tree of Slackware is mounted in /mnt. So, if for some reason you reboot the RP and the installer boots up again (ups...), you have to mount, manually, the partition containing / (/dev/mmcblk0p3 for example) in /mnt. By doing so, you can continue with the configuration.

Now, remove some unnecessary packages:

# ROOT=/mnt removepkg kernel_armv8 kernel-*-armv8

Next, remove the initramfs file from the boot partition. Mount the boot partition in /mnt/boot and then:

#  rm /mnt/boot/initramfs.xz

Install some extra RP exclusive packages:

# ROOT=/mnt installpkg /rpi-extra/kernel* /rpi-extra/sarpi*

Now you can update your config files.

And finally, reboot the system.




References: 

https://sarpi.penthux.net

https://alien.slackbook.org/blog/remote-installation-of-slackware-using-ssh/

Saturday, March 03, 2018

Working with MIDI in Slackware

If you want to play MIDI files in Slackware you do need to install special software (synth, mixer, sequencer, etc.). There is a great page where it is explained clearly how to set up a basic environment in order to start working whit MIDI in Linux. All the software mentioned in that webpage is available for Slackware in Slackbuilds.org. Instead of copy-paste what is already clearly explained in the mentioned site, here, I highlight the differences I have observed.

Basically, the MIDI instructions are generated by reading a midi file, by a virtual instrument or by a hardware MIDI controller (as a keyboard), then the synth interprete the instructions a convert them into a sound signal. Several signals can be mixed (Jack), decoded and put in the speakers. 

1. I had by default a low latency kernel and a audio group in my Slackware box. 
2. I don't know how to modify the group limits, but I have realised that it is not strictly necessary. IT is possible to follow the procedure skipping this configuration and using the option -r when you run jackd (jackd -r ...), you will see a warning message. In my case, the performance is ok for what I want to do.
3. Considering that, at the end, you want to be able to use a MIDI sequencer (Rosegarden in this case). You will need to install the following set of software.
- Rosegarden : Sequencer
- liblo, liblrdf, dssi, lilypond : Rosegarden dependencies
- jack-audio-connection-kit, lirc, perl-xml-twig : Optional Rosegarden dependencies.
- fluidsynth : Softsynth
- fluid-soundfont : Base sound samples
- vmpk : Virtual piano keyboard. Used for testing purposes.
- qjackctl : GUI front end to configure Jack
- Qsynth : GUI front end to configure Fluidsynth.

4. Strictly, you don't need to use Jack to use MIDI, but it is recommended if you want to do more than very basic thinks. You do need Alsa and fluidsynth.

5. It is important to remark that Slackware is currently using Pulseaudio as sound engine. When Jack is running, Pulseaudio is shouted down.

Thursday, July 27, 2017

Slackware 14.2

Slackware 14.2 was released two days ago and, although I'm running an updated -current version, I want to use this milestone to do a complete new, fresh and clean installation. But with some customisation of course. This first post is only to organise the installation and system configuration.

There are two major tuning I want to do. First is installing multilib capabilities, which I need mainly to run Skype and Wine, and second to change KDE 4.x with Plasma 5. I'm using the Plasma 5 packages made by AlienBob for a wile and I could say that it works pretty ok. There are still some small details still laying around but the performance is most than acceptable and I like the new look of Plasma 5

Another change I want to do this time is to move Slackware to Unicode UTF-8. This is not something that I really need, but I just want to try it.

There are a couple of thinks to which I want to set special care. One is a problem I have already with the Suspend to Ram feature. I have not spent so much time in this, but now is time to solve it. Second is the HDMI port sound. Now I have to change manually the sound device output to the HDMI port, otherwise, the sound still remains flowing by the computer speakers. I guess I need to recheck this because Slackware 14.2 adds Pulseaudio, and I guess that could change a bit the sound cards configuration.

[Update] I had to change my laptop and now I have one with a Kaby Lake Intel processor (Asus UX330U). This detail did a big difference in Slackware, the current kernel version used in Slackware64 14.2 and -current (4.4.x) are not compatible with this microarchitecture. Although the computer was able to boot, Xorg failed, showing the error message "(EE) no screens found (EE)". The problem was discussed in the Slackware forum, where I was suggested to upgrade the kernel to one above 4.5. After building the 4.8.10 version, the problem was solved. I have added a new item in the list below considering this additional step in the Slackware 14.2 setting up.

Details for the step by step process, problems solving and comments are in another posts:

- Booting the Slackware installer from a USB drive in UEFI mode.
- Packages selection and extra software.
Keyboard configuration.
Internationalisation.
- Kernel upgrade.
Elilo configuration.
- Fine tuning.
- Adding Plasma 5.
- Adding Mutilib.
- Setting Hidpi.
- Bluetooth configuration.
- Sound configuration.
- Installing Wine and MS Office 2010. (What is the devil doing here!??)

Saturday, November 26, 2016

Kernel upgrade

As I mention in another post, Kaby Lake processors are not supported by the kernel version currently used in Slackware 14.2 and -current (4.4.x). So, in order to use Slackware in a system using this architecture, it is need to upgrade the kernel to someone above 4.5. In this case I used the version 4.8.10, the last stable available in that moment.
In general the upgrading was done by following the procedure explained in Aliens Bob's wiki. In simple, it is as follow:

- Configure the EFI boot loader to show two options, one with the old kernel and other with the new one. This is a bit different at what is explained in the Alien's wiki, because he uses lilo instead of elilo (it is an old post), but the situation is almost the same, even easier. I did this before compiling because I wanted to be sure that the configuration and both booting options were working properly (I loaded the same kernel in both option).

- Download the Kernel sources.
$ wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.8.10.tar.xz

- Check the source authenticity.
# wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.8.10.tar.sign
# gpg --keyserver wwwkeys.pgp.net --recv-keys 38DBBDC86092693E
# gpg2 --verify linux-4.8.10.tar.sign

- Extract the source to a local directory.
# tar -Jxvf linux-4.8.10.tar.xz

- Download an initial .config file from a Slackware mirror.
$ wget http://mirrors.slackware.com/slackware/slackware64-current/testing/source/linux-4.6-configs/config-generic-4.6.x64

- Configure the Kernel compilation.
# make oldconfig
# make menuconfig

- Make and Install.
# make bzImage modules
# make modules_install

- Add the new Kernel to elilo.
# cp arch/x86/boot/bzImage /boot/efi/EFI/Slackware/vmlinuz-custom-4.8.10
And edit to image=vmlinuz-custom-4.8.10 the second boot option in elilo.conf.

- Reboot.

Wednesday, July 27, 2016

Fine tuning

There was several acctions I had to take in order to configure the system better.

- I forgot to set the network during the installation, and I like to use a differnt hostname than the default. To run the network configuration program run the command:

# netconfig


- I changed the kernel from Huge to generic, I did it by following this procedure stated in SlackDocs. The only one difference was the configuration of lilo, in my case, I'm ussing elilo, so the procedure is a bit different.
I copyed the Slackware bootloader folder in EFI partition (/boot/efi/EFI/Slackware) and I renamed as Slackware-generic (/boot/efi/EFI/Slackware-generic), then I copyed the files /boot/vmlinuz-generic-4.4.14 and the RAM disk /boot/initrd.gz which were created previously into the Slackware-generic folder. Then, it is needed to modify the elilo configuration file to:

# /boot/efi/EFI/Slackware-generic/elilo.conf

chooser=simple
delay=1
timeout=1
default=Slackware-generic
#
image=vmlinuz-generic-4.4.14
    initrd=initrd.gz
    label=Slackware-generic
    root=/dev/sda3
  append="resume=/dev/sda2"
    read-only

This configuration includes the line that enables hibernation ("resume=/dev/sda2").

To finish I added the Slackware-generic boatloader to the UEFI boot configuration using the computer's firmware menu


- In Windowmaker, I used nm-applet to connect to a wifi network. The application loads in the system tray, so first it is needed to install and load wmsystemtray.


- I set the network time protocol script to run at starting the computer.

# chmod 755 /etc/rc.d/rc.ntpd

and I used the confuguration file:

# /etc/ntp.conf

driftfile /etc/ntp/drift
logfile /var/log/ntp.log

server 0.nl.pool.ntp.org
server 1.nl.pool.ntp.org
server 2.nl.pool.ntp.org
server 3.nl.pool.ntp.org

server 127.127.1.0
fudge 127.127.1.0 stratum 10

restrict default nomodify nopeer notrap
restrict 127.0.0.1 mask 255.0.0.0

Keyboard layout

My current laptop uses a German keyboard (QWERTZ), also I use to use another US-international, so I have to configure the system to use both.

I need to write in Spanish frequently. The default German layout (no death keys) works fine but it doesn't allow to write the ñ letter. The legacy version uses death keys and allows to write the lovely ñ.

Linux console:
To change the default keyboard layout, create the file:
# /etc/rc.d/rc.keymap

#!/bin/sh
# Load the keyboard map.  More maps are in /usr/share/kbd/keymaps.
if [ -x /usr/bin/loadkeys ]; then
 /usr/bin/loadkeys de-latin1.map
fi

Xorg
This settings will affect all the Xorg application, thats include KDE and Window Maker. Just create the following config file.

# /etc/X11/xorg.conf.d/90-keyboard-layout.conf

Section "InputClass"
Identifier "keyboard-all"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "XkbLayout" "de"
Option "XkbVariant" "legacy"
Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

KDE
Normaly KDE will use the keymap defined by Xorg, but in the case you want to set it again in KDE, just choose the German variant German (legacy) as keyboard layout in the Input devices section of the System Settings.

There still a problem prowling around. It is the special keys, most of them works ok with the exception of the airplane mode and the increase and decrease brightness. They doesn't work, I think they are not visible in linux, but I have to check this.

Also I have to try what happens with the second keyboard, I have not tried yet.

Tuesday, July 19, 2016

Internationalization

Normally I use to handle files in Spanish, English a few in Dutch and nowadays others in German. The traditional en_US locale have worked nicely since I started with Slackware. Additional to the classic issue of the decimal separation symbol ('.' instead of ','), which can be  solved easily in KDE,  I have had some problems with the file names from an external disk formatted in NTFS wish I use to use in Windows as well. Probably the problem will nor be solved changing the codeset in the Linux system (perhaps configuring better the mounting parameters of the disk) but at least I would like to try and at the same time give more consistency to the system.

Localization

Mora than changing the language I'm interested in set Slackware to UTF-8 codeset.
To modify globally the locale variables it is needed to edit the file /etc/profile.d/lang.sh and change the values of the variables set there. I will use:

export LANG=en_GB.UTF-8

This codeset already considers LC_COLLATE=C. Although it is should not be necessary set it, by default it set in the script and I did not comment it.

To configure the locale for only a user, the same sentence have to be added to the file ~/.profile

During the installation process is also possible to set the console to use unicode, there is an option during the lilo configuration that allows this. This is not the case when you use elilo.

The only problem with using en_GB is, of course, the currency. So I also set the variable LC_MONETARY with an euro locale:

export LC_MONETARY=nl_NL.UTF-8

I'm not sure about the metrics.

In KDE it is abailable the translation to British English and other common languages without installing any KDEi package (I did not install anyone).


___
Source: http://docs.slackware.com/slackware:localization

Monday, July 18, 2016

Adding Plasma 5

I did not install any KDE package during the Slackware installation. Then, I have installed the Alien's Plasma 5 framework. The instructions are very clear and everything worked nice. After that,  I have not installed any package from KDE4 and Plasma 5 is working perfect. Although the README says that there are some KDE4 packages essential to the proper functioning of Plasma 5, I have not had any problem that suggest me to install one of them. But still I will i,nstall some optional packages:

- Amarok
- Calligra


All the magic is here: http://alien.slackbook.org/blog/kde-5_16-06-for-slackware-current/


Saturday, July 16, 2016

Packages selection and extra software

I like the set of application included in Slackware, but still I like to add and replace some. From the included packages, I don't use to install xfce, because I prefer Plasma or Window Maker. Also I use to replace Tetex with TeX Live. This time I also want to replace Plasma 4 with the alien's Plasma 5 packages.

Do not install:
- xfce
- Tetex
- KDE
- KDEi

There are several extra applications I use which I have to install (and its dependencies):
- TeX Live
- Aspell es de nl (/extra)
- Java (/extra)
- Google Chrome (/extra)
- wmCalClock (SBo)
- wmpower (SBo)
- wmsystemtry (SBo)
- Unrar (SBo)
- emelFM2 (SBo)

- Plasma 5 (Alien)
- Kile (SBo)
- Calligra (Slackware 14.2)
- Amarok (Slackware 14.2)
- Megasync (SBo)
- Mendeley (SBo)
- ImageJ (SBo)
- Xmind (SBo)
- Inkscape (SBo)
- Libreoffice (Alien)

- Easytag (SBo)
- VLC (SBo)
- Octave (SBo)
- qTox (SBo)
- SciDAVis

- Multilib
- Brother-DCP755_64
- Skype (SBo)
- Adobe Reader (SBo)
- Wine (alien)
- Winetricks (SBo)
- MS Office 365

- Opera (SBo)
- tor-browser (SBo)

- audacity (SBo)
- fluidsynth (SBo)
- frescobaldi (SBo)
- Jack (SBo)
- portaudio (SBo)
- qsynth (SBo)
- rosegarden (SBo)
- vkeybd (SBo)
- lilypond

- Kicad
- Kile  (SBo)
- subtitleeditor (SBo)

- aws command line
- cinelera

Booting the Slackware installer from a USB drive in UEFI mode

I found difficulties to boot the Slackware installer from a USB drive  in UEFI mode. I works perfect in Legacy mode (BIOS), but I'm curious about how to do it in UEFI. These are a couple of options to do it.

1. Using the script usbimg2disk.sh located in usb-and-pxe-installers directory. There are two options to use it, but the second is which I found more useful, that is, to create a complete installation USB drive which is editable. To do this, I find better to download the Slackware file tree instead of an iso image.

#  ./usbimg2disk.sh -f -s ../../slackware64-14.2 -o /dev/sdx

The -f option is used to format the drive before copying the files, this is optional.

2. Copying directly the iso image into the USBdrive. This can be done directly by using:
# dd if=./slackware.iso of=/dev/sdx

In both cases, when you boot the computer, you should call the EFI bootloader (pressing Esc in my case) and select the correct option. A Grub menu will be loaded from which you can load the Slackware installing system.

The last option should work, but I don't like it because I prefer to have a writable installation media which allows me to add and remove packages. Also I would like, in the short future, to maintain and update the installer with the fresher -current version.

Of course there are another ways to do it but, for me, these worked well.

Note:
To clear the GPT and the MBR partition table of a drive you can use gdisk:
# gdisk /dev/sdbx

go to expert menu by presing the key x
Use zap (z) to destroy the GPT data structure. In the same process the application will ask you if you want to blank the MBR, I use to do it in order to erase any boot option.

Although the preceding process cleans the booting information from the drive, some debris could remain, in particular if you previously wrote directly the iso DVD image into the drive using dd. To clean that you also should apply wipefs to the drive:

# wipefs -a /dev/sdbx



Sunday, May 29, 2016

Hibernation

By default, Slackware restarts from hibernation following the standard booting, loosing the state previously saved in the swap partition. To solve this, I edited the boot loader configuration, which in my case is ELILO. This is the result.

# /boot/efi/EFI/Slackware/elilo.conf

# The prompt line tells ELILO to display a prompt for you to choose a kernel.
#prompt

# tells ELILO to wait 5 seconds for you to respond. (This value is specified in 
# tenths of a second.) If you don't respond, it boots the image specified by the 
# default line.
#timeout=50

# Sets the default stanza to load (the name is sets by 'label=').
default=Slackware

# chooser specify kernel chooser to use: 'simple' or 'textmenu'.
#chooser=simple

# delay specifies the number of tenths of a second the boot loader should wait 
# before automatically booting a locked command line, a command line pre-stored 
# by "lilo -R", or the default 'image=' or 'other='.
#delay=10

# Stanzas
image=vmlinuz
label = Slackware
root = /dev/sda3
        read-only
        append="resume=/dev/sda2"

The magic here is done by the line append="resume=/dev/sda2", now ELILO knows that it have to start Slackware from the swap partition.

Reference: http://docs.slackware.com

Saturday, March 26, 2016

Office 2010 in Wine + winetricks

It is possible to run Office 2010 (Professional Plus, x86) in Linux using Wine (1.8 Staging, 64 bits, -compat32). Its performance is good enough but it needs some tweaks. I followed the following procedure to install it and make it functional.

Installation
1. Create a new WINEPREFIX:
$ WINEARCH=win32 WINEPREFIX=~/.wine/Office2010_32  winecfg

2. Configure
a) Leave the Windows version as Windows XP.
b) Change the screen dpi in order to improve the fonts and GUI visualization. 
$ WINEPREFIX=~/.wine/Office2010_32 winecfg 
Graphics > Screen resolution: 160 dpi > OK
c) To allow Powerpoint to run properly, set 'riched20' to (native,builtin)

3. Mount the Office 2010 ISO file:
# mkdir -p /run/media/userx/dvd
# mount -t iso9660 -o loop ./officeproplus2010uk32.iso /run/media/userx/dvd

4. Run the installer:
I use to install only Word, Excel, Powerpoint, Publisher and its shared tools. Nothing about web sites, Access or SharePoint.
 $ WINEPREFIX=~/.wine/Office2010_32 wine /run/media/userx/dvd/setup.exe

5. Register and play.

6. To solve the window resizing problem:
I tried the solutions given in WineHQ, the first two worked but I didn't like the final behaviour. The third didn't work directly but I found the solution. This settings allows PowerPoint to show in full screen.
a) Go to System Settings > Window Management > Window Rules.
b) Create a new rule.
c) Give it a description such as MS Office.
d) Set Window class as Regular Expression.
e) As regex string use (without quotation marks): "\b(winword.exe|excel.exe|powerpnt.exe|mspub.exe)\b."
f) Check Match whole window class.
g) On tab Size & Position check Ignore requested geometry and set Force Yes.

7. Improve font rendering in Wine.
For more details check this, but I did not find a big difference in the visualisation.
a) Open regedit.
b) Go to [HKEY_CURRENT_USER\Control Panel\Desktop].
c) update the following entries:
    FontSmoothing=2
    FontSmoothingType=dword:00000002
    FontSmoothingGamma=dword:00000578
    FontSmoothingOrientation=dword:0000000

In case of problems or errors, try :
8. Configure the DLL:
$ WINEPREFIX=~/.wine/Office2010_32 winecfg
Libraries:
gdiplus (native)
msxml6 (native)
> OK

9. Install MS XML Core Service 6.0 sp1 (solves the problem of saving files):
$ WINEPREFIX=~/.wine/Office2010_32 winetricks 
Install and app > Cancel > Install a Windows DLL or Co/ mponent > OK > (check) msxml6 > OK
[I need to check the DLL configuration]

10. Create the folder ~/.wine/Office2010_32/drive_c/users/userx/Recent :
This avoids the creation of multiple .lnk files when you work in Office. The files will be created anyway, but inside the mentioned directory not in the office file's folder.
$ mkdir -/.wine/Office2010_32/drive_c/users/userx/Recent

Uninstalling
I couldn't make the uninstaller program work, first I tried with the wine uninstaller program, but I got an error after launching the Office uninstall application.
$ WINEPREFIX=~/.wine/Office2010_32 wine uninstaller

So, I uninstalled Office 2010 by brute force. 
1. Delete the wineprefix where it is installed:
$ rm -rf ~/.wine/Office2010_32

2. Remove the K menu and desktop entries:
$ rm -f ~/.config/menus/applications-merged/wine-Programs-Microsoft\ Office*
$ rm -rf ~/.local/share/applications/wine/Programs/Microsoft\ Office/
$ rm -f ~/.local/share/desktop-directories/wine-Programs-Microsoft\ Office*

3. Remove the Office applications icons:
Do it by hand looking in the folder: ~/.local/share/icons/

4. Remove the extensions .desktop definitions (remove from "Open With ..."):
Do it by hand looking in the folder: ~/.local/share/applications/



Saturday, January 23, 2016

Sound in Slackware64 current (14.2)

UPDATE:
I installed Plasma 5.2 and now it is possible to change the output device from the System Settings > Multimedia window. Still is not a clean process but, it is cleaner than to copy and delete the asound.conf file. The procedure consisted in just to move upwards the HDMI output device in the Audio Playback option from the Audio and Video section. In my case the sub device connected to the HDMI port is the 0,7 (HDMI 2). Then, this devise also should be selected as profile in the Audio Hardware Setup tab. I tried to make a new Activity with the new configuration, but it didn't work due to the fact that all the activities share the same System Configuration, if you change something in one, it will also change in the others. Also, the configuration file snd-hda-intel.conf is not needed anymore.
---

After installing Slackware64-current (2015.12.29) I did not have sound neither in the speakers nor in the headphones. So I checked how ALSA had detected the soundcards:

$ cat /proc/asound/cards
0 [HDMI ]: HDA-Intel - HDA Intel HDMI
               HDA Intel HDMI at 0xb211c000 irq 50
1 [PCH  ]: HDA-Intel - HDA Intel PCH
               HDA Intel PCH at 0xb2118000 irq 47

So, ALSA configured the HDMI card as first device and it used it as default. Connecting the HDMI port to a TV the sound flew from the TV speakers. The problem was solved by switching the name of both cards in the file /etc/modprobe.d/snd-hda-intel.conf


/etc/modprobe.d/snd-hda-intel.conf
options snd-hda-intel model=auto

alias char-major-116 snd

alias snd-card-0 snd-hda-intel
alias snd-card-1 snd-hda-intel

options snd-hda-intel id=PCH index=0

options snd-hda-intel id=HDMI index=1
#

After rebooting, the sound started to work properly in the speakers and headphones. Auto-mute mode worked fine as well. 

$ cat /proc/asound/cards
0 [PCH   ]: HDA-Intel - HDA Intel PCH
                HDA Intel PCH at 0xb2118000 irq 47 
1 [HDMI ]: HDA-Intel - HDA Intel HDMI
                HDA Intel HDMI at 0xb211c000 irq 50

In the other hand, connecting the HDMI port did not change the sound output. In other words, although there was video in the TV, the sound came out from the computer's speakers or headphones.  
The solution of this problem is not trivial. Some people try to solve it changing the default card every time they use a different card. Although it seem that it is possible to build a script to overwrite the setting (defined in /etc/asound.conf) i found this solution too dirty. Instead, I followed the idea of cloning the sound from one card to the another, so, always in both cards (PCH and HDMI) will sound the same audio and will be possible to just mute the computer's speakers when it will be connected to a TV.

After a couple of hours looking for a solution and a lot of try and error, I found a good reference to follow. Finally, The solution consisted in configure ALSA to create a virtual device which route the audio to both devices. Also, the configuration solves the error that occurs when multiple applications try to access to the virtual card at the same time. The configuration is made in /etc/asound.conf :

# /etc/asound.conf
pcm.PCH {
        type hw
        card 0
        device 0 }
        
ctl.PCH {
        type hw
        card 0
        device 0 }        

pcm.HDMI {
        type hw
        card 1
        device 7 }     

ctl.HDMI {
        type hw
        card 1
        device 7 }        

pcm.PCHDmixed {
   type dmix
   ipc_key 1024
   ipc_key_add_uid false
   ipc_perm 0666
   slave {
       pcm "PCH"
       period_time 0
       period_size 2048
       channels 2
    }
    bindings {
       0 0
       1 1
    }
}

pcm.HDMIDmixed {
   type dmix
   ipc_key 2048
   ipc_key_add_uid false
   ipc_perm 0666
   slave {
       pcm "HDMI"
       period_time 0
       period_size 2048
       channels 2
    }
    bindings {
       0 0
       1 1
    }
}

pcm.both {
    type route;
    slave.pcm {
        type multi;
        slaves.a.pcm "HDMIDmixed";
        slaves.b.pcm "PCHDmixed";
        slaves.a.channels 2;
        slaves.b.channels 2;
        bindings.0.slave a;
        bindings.0.channel 0;
        bindings.1.slave a;
        bindings.1.channel 1;
       
        bindings.2.slave b;
        bindings.2.channel 0;
        bindings.3.slave b;
        bindings.3.channel 1;
    }
   
    ttable.0.0 1;
    ttable.1.1 1;
   
    ttable.0.2 1; 
    ttable.1.3 1; 
}

pcm.!default {
        type  plug
        slave.pcm "both"}
        
ctl.!default {
        type  hw
        card PCH}
#

The sections pcm.PCHDmixed  and pcm.HDMIDmixed are needed to face the problem with concurrent sound from different applications. The section pcm.both defines a new PCM consisting of 4 channels, two from the PCH card and two from the HDMI card. PCM is a stereo card and, I guess, HDMI is it as well (at least the TV is it). The magic is finally done by routing the audio channels to the correct speakers (physical channels). This is done by the ttable sentence. It took me a bit long to understand the logic behind but finally I understood the syntax as follow:

ttable.speaker.channel gain

Here, the speakers are coded as: 0 = front left; 1 = front right; 2 = rear left; 3 = rear right;  4 = center; 5 = subwoofer. Meanwhile, channel is the number of the binding connected to an audio channel. Finally, gain is a factor applied to modify the loudness of the channel (0.5 -> 50%).

In between I found that ALSA stores it last parameters in the file /var/lib/alsa/asound.state (there is a link in /etc/) which is written when the computer shutdown. There is a method to temporarily remove it in this link.

I did a fast check connecting a TV and it works fine. But, I think, it still need to be tested with details.

Update: Skype reported that there is not mic available. It is needed to configure a capture channel with dmix. 

Sunday, June 23, 2013

Installing Slackware 14 from a USB drive

The following notes collect important tips to consider in the installation of Slackware 14.

Before any modification in my computer I use to load a USB drive with Slax, in case something goes wrong I can use it to fix problems or to find help on Internet.
  1. Download Slax
  2. Install it in a USB drive (this erase all data in it).
    1. Extract Slax inside it.
    2. Run the script xxxx.sh for make it bootable.
  3. Boot one time to try it and to verify all works fine.
Downloading Slackware by torrent.
I like download the DVD ISO by using torrent, you can find it in the Slackware official site (~2,3GiB).

Installing the complete distribution in the USB drive and do it bootable
  1. To mount Slackware iso image, it should be done by root user: # mount -t iso9660 -o loop /.../slackware-14.0-iso/slackware-14.0-install-dvd.iso /media/dvd
  2. Go to /../usb-and-pxe-installers folder: $ cd /media/dvd/usb-and-pxe-installers/
  3. Type $ sh usbimg2disk.sh -h to getting help.
  4. With the pendrive unmounted run this command as root: $ sh usbimg2disk.sh -f -s /media/dvd/ -o /dev/sdc where -s /media/dvd/ is the folder were Slackware tree is mounted, and /dev/sdc the path to the pendrive. -f is the parameter to format the pendrive. Note that pendrive shouldn't be mounted before run this script, if you do it, unplug it and plug it again but without mounting it.
Booting from the USB drive
If the computer doesn't boot automatically from the USB drive, you will have to find the correct configuration inside the BIOS setup. Usually you have to change the order of the devices that can boot the system, put the USB drive in the first place. In some systems the USB drive have to be plugged to appears in the devices list.

Kernel selection
After the Slackware installer boots it will ask you for witch kind of kernel should it use. You have two options: huge.s and hugesmp.s, the first should be used in computer with single processor while the second in multiprocessors computers. I have chose hugesmp.s.

Preparing the hard drive
This time I have change the partitions in the hard drive, I have created one for the / folder (20GiB, ext4), another for swap (2GiB, linux swap), a third for the /home folder (80GiB, ext4) and the rest available space in a fourth partition for a testing area (ext4).

Installing Slackware
I use to avoid the installation of games and FAQs, then I chose the complete installation without prompting.

A good practice is to mount the /home folder in a different partition. This helps when you do an update of the operating system conserving users files and configurations.

Sunday, October 07, 2012

Configuring Slackware 14

Lilo Configuration
By default Lilo gives two options of OS to start, Windows and Linux, and wait a minute to run automatically the first option. I just have Slackware in my PC so it is unnecessary that Lilo asks and wait.

To change the default Lilo behavior you have to change /etc/lilo.conf, this is what I have changed.

1. No waiting until systems starts. Comment prompt line
# Wait until the timeout to boot (if commented out, boot the
# first entry immediately):
#prompt


2. No Windows option. Comment or delete the Windows section at the end of the config file:
#other = /dev/sdb1
#label = Windows
#table = /dev/sdb


3. Use the command compact to skip memtest and start the system quickly.

To apply any modification to the boot loader it is necessary to run the command lilo.
# lilo


Configuring the system to multi user with session manager
Most of the time I use KDE, so I prefer start KDM it when the system goes up. To do that you have to change the default runlevel configuration in file /etc/initab to the option 4:
# 4 = X11 with KDM/GDM/XDM (session managers)
...
# Default runlevel. (Do not set to 0 or 6)
id:4:initdefault:

Problem:
After booting in runlevel 4 the computer showed an error with the sound card and didn't play any sound. This is because in runlevel 4 users don't belong the audio group, so you have to add your user to it.

# usermod -aG audio user_name

This problem can affect other resources, as scanners, printers, etc the solution should be adding the user to the appropriate group.

Network manager configuration
In this distribution KDE gets its own network manager, if you want to use it just changes permissions of rc.networkmanager:
# chmod 755 /etc/rc.d/rc.networkmanager

In case you prefer wicd, you have to install it from /extra/wicd folder in the Slackware installation DVD and change permission to /etc/rc.d/rc.wicd to 755 after installation.

Saturday, December 25, 2010

WD My Passport for Mac on Slackware and formatted in NTFS

Ok, yes, this problem was a little weird, but some reasons I have bought an external USB HD for Mac and I want to use it with my Slackware 13.1 machine.
So step by step the problems I had to use it was:
  1. When I plug the disk on my PC appears two devices in /dev :
    1. /dev/sdb1 : hfsplus filesystem; this is the disk I want use.
    2. /dev/sr1 : udf filesystem; this is other small disk, about 600MB, that I don't care by now.
  2. The HD that was formatted for Mac (/dev/sdb1), it use HFS+ filesystem. I want use the disk on Linux and Windows so I need a NTFS filesystem disk. I have used fdisk to change the filesystem of sdb1 to NTFS and then I have formatted it with mkfs.ntfs -f -L Disk_label /dev/sdb1
  3. When I have mounted sdb1 I had no access to the data stored in the disk, but if I did it on windows it works fine, so the problem was the way that is was mounted. I had installed NTFS-3g and the problem was solved with:
    mount -t ntfs-3g /dev/sdb1 /media/hd
    By this way, now I have complete access to the disk, but I have to mount it manually and as root.
  4. On /etc/fstab I had the row:
    /dev/sdb1 /media/memory0 auto noauto,user,exec,rw 0 0
    When the disk was mounted it is did it using the native NTFS filesystem instead of NTFS-3g. I have changed it by:
    /dev/sdb1 /media/memory0 ntfs-3g defaults 0 0
    With it I can mount the drive with mount /dev/sdb1 but just as root. I suppose that with this change I could have problems with volumes with other filesystems (FAT32 for example) linked to the same device (/dev/sdb1). But this is another problem that don't care by now.
Nothing that I have searched and tried have helped.
  1. I have created the file /etc/filesystems like a copy of /proc/filesystem but changing the line ntfs by ntfs-3g, but doesn't work.
  2. From the FAQ of NTFS-3g I have found something that should have help me but it didn't. http://www.tuxera.com/community/ntfs-3g-faq/#unprivileged
  3. Another page referring to the FAQ but with more information. http://pxnh.wordpress.com/ (at the end of the page).
  4. I have changed the group of ntfs-3g to plugdev but doesn't work.
So much time I have gave it to that little problem, so I'm thinking in changing the HDD filesystem to EXT3 or 4.
Finally I have formatted the HDD with EXT4 supposing that it would resolve the problem. But when I have mounted the HDD, I didn't have access to write in it. I have deleted from /etc/fstab the line that define /dev/sdb1 and after mounting the drive for first time, as root, I have changed the owner and permissions to my user and 760. Now the drive is mounted automatically in KDE using HAL. A dirty solution but is ok by now.

The error that appears when I pugged a USB HDD was solved adding my user to the groups users and plugdev and restarting the computer:
# usermod -aG users my_user
# usermod -aG plugdev my_user

Sunday, April 13, 2008

Slackware 12 + i810

Tenía problemas en X, no podía ver videos ni DVD, el openarena colgaba al PC, etc, además al iniciar X salen alguno errores. Buscando en la Internet leí que eso sucede porque el driver de mi tarjeta de video el i810 no estaba presente pues al momento de instalar el SO se instala una versión nueva que se llama intel y que el driver i810 en realidad es un link hacia intel. Para solucionar el problema bajé el paquete original del driver i810 y lo reinstalé.

El paquete está aquí : http://packages.slackware.it/package.php?q=current/xf86-video-i810-1.7.4-i486-2

Comando de instalación : # upgradepkg --reinstall xf86-video-i810-1.7.4-i486-1.tgz

Referencia : slacky.eu

Sunday, April 06, 2008

.poweroff

Por omisión Slackware no permite a los usuarios no root apagar el computador. Para evitar tener que entrar como root cada vez metí este comando a la lista sudo.

Editar con visudo el archivo sudoers agregando la siguiente línea.

felipe TheEnterprise = NOPASSWD: /sbin/shutdown -h now


Con ello el usuario felipe puede ejecutar el comando /sbin/shutdown -h now en el computador TheEnterprise sin necesidad de password. Claro que puede ser inseguro y más aún publicarlo en internet, pero creo que eso no importa porque mi computador es sólo de uso personal.

Luego hice un script de nombre .poweroff que puse en mi carpeta home y dentro de él agregué la siguiente línea:

sudo /sbin/shutdown -h now


Parece trivial, pero la memoria es frágil.

Sunday, March 23, 2008

Synaptics Touchpad + USB mouse

La compilación del driver Synaptics no dió especial problema, sin embargo X no partía pues decía que no encontraba un touchpad Syptics instalado. La solución pasó por editar el archivo /etc/rc.d/rc.modules-2.6.21.5-smp en la sección "PS/2 mouse support" se eliminó la opción "proto=imps" que trae por omición Slackware. Con ello todo funcionó bien. En la configuración de xorg se agregó un mouse USB, uso un MS IntelliMouse Optical 1.1, funciona pero no he probado si se pueden usar los 5 botones, por lo menos los tres tradicionales y la rueda funcionan bien.

El xorg.conf además considera la configuración para el monitor LCD y la salida de Svideo, al iniciar X veo que esto da algunos errores pero se ejecuta de todas maneras. No he probado la salida de Svideo, esto lo solucionaré más adelante. También veo que puede haber un problema con el teclado pues sale un error, pero esto no se nota al momento de usarlo. En resumen, esta configuración funciona, sucio pero funciona.

Slackbuid : synaptics.SlackBuild

xorg.conf : xorg.conf

Wednesday, March 05, 2008

Configurando tarjeta wifi

Este computador tiene la clásica tarjeta ipw2200, los drivers están instalados pero no se por que no está el firmware en su lugar, para instalarlos bajé la versión 3 del firmware desde el sitio del proyecto ipw2200, luego de descomprimir el archivo copié su contenido a la carpeta donde deben ir:
# cp ipw2200-bss.fw /lib/firmware
# cp ipw2200-ibss.fw /lib/firmware
# cp ipw2200-sniffer.fw /lib/firmware

Luego crear el archivo para dar parámetros al módulo cuando sea cargado, esto es, crear un archivo de texto /etc/modprobe.d/ipw2200 y escribir en su interior:
options ipw2200 led=1
Con ello se activará el led que indica el estado de la tarjeta wifi.

- Modifiqué el archivo /etc/rc.d/rc.inet1.conf en las siguientes lineas (se agregó "yes"):
USE_DHCP[0]="yes"
USE_DHCP[1]="yes"

- Se modificó el archivo /etc/rc.d/wireless.conf para la red wifi local que corresponde.
- Luego me cambié de casa y ahora la red wifi está encriptada con WPA. Para conectarse a la red se debe :
- Modificar el archivo /etc/wpa_supplicant.conf y poner los datos que corresponden a la red.
- ejecutar los comandos:
# wpa_supplicant -i eth1 -c /etc/wpa_supplicant.conf -B
# dhcpcd eth1

con ello se configura la tarjeta inalámbrica (eth1) para encriptación WPA.

Para que al iniciar el computador se conecte a al red WPA especificada en wpa_supplicant.conf editar el archivo /etc/rc.d/rc.inet1.conf y agregar esto en la sección de la tarjeta de red que corresponda, en este caso eth1.

WLAN_WPA[1]="wpa_supplicant"

Según leí hay otras opciones que se pueden agregar, pero cuando probé especificando el driver el computador no se pudo conectar a la red.