Pages

2014-02-25

Alsa problem on new Wheezy

I just did Wheezy netinstall to really old box. Athlon64, sound through nforce chipset. Wheezy called the working sound (mostly) 'Nvidia CK804'.
Alsa was installed as per usual:
alsa-base, alsa-utils, alsa-tools, libsound, alsamixer, (and dependencies) and lastly volumeicon (started from Openbox autostart file).

alsactl init did the trick and everything seemed dandy.
Unfortunately, the sound worked alright only to first reboot. Then it didn't anymore, and volumeicon also disappeared (and refused to start from terminal with quite a lengthy fail-message).

I tried various stuff to diagnose and fix:
The simple alsactl init again, and heavier alsa force-reload.
Pried from terminal with:
lspci | grep audio
aplay -l
aplay -L 

and even with hwinfo (install from repo)...
Visited alsas' home for information and for possible source download.
Peeked into files:
cat /proc/asound/cards
cat /proc/asound/modules
cat ~.config/volumeicon/volumeicon
cat /etc/modprobe.d/alsa-base.conf


Conclusion:
1. Nvidia or no, the drivers are:
snd-hda-intel => card0 (default), and not working for me,
snd-intel8x0 => card1, and working when manually chosen.
2. Solution is that the second one should be the first, default choice. And then there wouldn't be also need to change the last block in volumeicon file:
[Alsa]
card=default


sudo nano /etc/modprobe.d/alsa-base.conf
After lines of 'install' and before 'options' I added two lines:
options snd-intel8x0 index=0
options snd-hda-intel index=1


sudo alsa force-reload
And there was sound! And it still is - also after reboot.
That's it.

2014-02-08

New hardware, old Linuxes

I swapped out my 5 years old machine to a bit more contemporary one.
Everything except video card (gtx 560) and one irrelevant hdd got swapped out.
Relevant changes were - ahci/ehci mode for hdd-s, new sound chip, new network chip.

Practical philosophy for hardwaring:
Decide what you really need - for example, in my case:
- inverted-layout box, as I keep it against wall and wanted to turn back panel to front (which would have caused blocked cooling for classic box). AND - it's very, very inconvinient to have big video card and hdd-s kissing each other.
- bigger hdd bay, for not cramming several hdd-s on top of each other.
- modular psu, as miditowers are bloody tight really.
- and if you do not need raid or full-ATX or simply-mucho-expencive MB, then really, you don't.
Why back panel in front, you ask? Because it irritates me to have usb-s divided between ends of box. So I cannibalized the front and planted usb-s, switches and leds to back panel, closed holes in front panel and - done.
- There are two things one have to read - as RTFM - MB manual and Bios. Don't skip!

Software, fixing it:
I packed (and backed) up all my current 5 linuxes with fsarchiver. Then I connected the new system-hdd to the old machine and unpacked distros to their new partitions.
When the new box was ready - bios checked etc, it got it's hdd-s installed. First boot was from usb stick (which happened to be PartedMagic).
Usb because, with such a total overhaul there are some things to be done before you can have any hope to see your dear display manager again.

# Did the distros end up on different partitions (of originals)? Open up all etc/fstab-s and correct them. There is no such problem if fstab uses UUIDs (sudo blkid to get whole list) as fsarchiver restores systems with original UUID.

# Chroot.
For that procedure it's better to google and find your own recipe - I am not sure that mine is the very right one.
What you have to do is, basically: mount and bind targets' /sys, /proc and /dev (for debian, better to mount also sysfs) to /mnt, then
sudo chroot /mnt. And fun begins.
Patients: Slackware, Salix, Vsido and my own netinstalled Wheezy and Sid. All need new initrd files (changed drivers!)
- Slackware and Salix have most nice mkinitrd script, currently ran like that:
/usr/share/mkinitrd/mkinitrd_command_generator.sh -k 3.10.17
which works no problems. Run lilo afterwards. In my case, lilo is in root part (not MBR), and has to be run with partition-number: lilo -b /dev/sda2 -c
- Debians: dpkg-reconfigure linux-image-3.x.x... (number is uname -r). Which is dandy, except that uname -r in chroot shows number for host kernel. So I checked up how old initrds look and - seems that everything between kernels' number-start and .gz IS the right thing. Example:
dpkg-reconfigure linux-image-3.11-10.dmz.1-liquorix-amd64
The good thing with previous command is - it also renews your grub.
Done with chroot. 'exit' and 'umount' everything you mounted.

- And that was all that Slackware needed for reaching the desktop.
- Not so with Debians - error: no screens, and no xorg. To cut it short, the solution was  simple: delete /etc/X11/xorg.conf and recreate it. Mind! I am talking of Nvidia binary driver. It installs itself and also makes new xorg.conf. I do not know what happens with other video drivers.

# Network: new chip, new interface = no network.
The important file is
/etc/udev/rules.d/70-persistent-net.rules
Only Wheezy - somehow - managed to create new entry there (with new mac number!), and named it as eth1. And/but - eth1 does not start automatically - still no network.
So, I copied this new entry to every other distro, changed NAME="eth0", and that was that. I still do not know where to find mac numbers :)
It is also said that deleting that file and rebooting creates automagically the new (correct) one.

# alsa gave a looooong list of warnings when starting (but worked). In Slackware, delete
/var/lib/alsa/asound.state
and create new, 'alsactl store', done.
In Debians.... I think it just went away after first boot.

# Sid and sensors. Or, really - no sensors... Run:
sudo sensors-detect, answer questions, let it write modules and run:
sudo /etc/init.d/kmod start
Done.

# Annoyances:
- monitor dimensions changed and some (desktopy) things were not in right places anymore.
- sensors data presentation errors in conky (new cpu, new 'cut's  etc)
- console resos out of whack. None that is possible according to vbeinfo is fitting for 1920x1080. and KMS doesn't work as I use proprietary driver... bugger. Still no solution here.
- some 5-6 irritable hours thrown into googling.
And I am sure there will be more things creeping out.

But all in all - it was quite alright compared to coming reinstall of borked Windows. Always hated that...
'Old Linux in new box' can be summed like that: fstab, initrd, 70-persistent-net.rules. Done.