f-log

just another web log

30 Nov 2019:
alsa pcm test show nothing usful
Back to Alsa hacking

First I wanted to see if all .WAV files were causing the same affect. Looking specifically for sizes, for buffers and memory restrictions.

bytes sent to PCM
/usr/share/sounds/alsa/ (all around 130k)
    Front_Center.wav    0,71,167,787,31
    Front_Left.wav     0,71,191,42,crashed getting data contents (hung after reporting size)
    Front_Right.wav     0,1,61,10,29
    Noise.wav         5,5,19,28,3
    Rear_Center.wav     0,275,9,153,7
    Rear_Left.wav     10,105,3,8,crashed getting data contents (hung after reporting size)
    Rear_Right.wav     0,57,205,67,57
    Side_Right.wav     0,5,46,169,144
    Side_Left.wav     1,19,27,111,77
    
/usr/share/sounds/
    email.wav [8.1k]            11 - exited after 30secs consistently (but no sound)
    error.wav [87k]             1,121,77,1 - exited after 30secs consistently (but no sound)
    login.wav [864k]            21,215,175,11,9 - required double CTRL+c to exit (is linked to startup3.wav and exactly the same result if using that file directly)
    info.wav [42424 bytes]     5,25 - exited after 30secs consistently (but no sound)
    

    
Which is very annoying! Almost no consistency. There are even a couple or a files that exit, eventually. Does not matter what the file size is, so what next?

Well I know the problem seems to be the write to the PCM device. So lets hassle that :)

cat /dev/random > /dev/dsp
sudo cat /dev/random > /dev/dsp


No sound, no errors and nothing relevant in the logs.

or is there?
/var/log/syslog
Nov 30 12:50:57 myuser pulseaudio[1372]: [pulseaudio] alsa-util.c: Disabling timer-based scheduling because running inside a VM.
Nov 30 12:50:57 myuser rtkit-daemon[1374]: Supervising 0 threads of 0 processes of 1 users.
Nov 30 12:50:57 myuser rtkit-daemon[1374]: Successfully made thread 28647 of process 1372 (n/a) owned by '1000' RT at priority 5.
Nov 30 12:50:57 myuser rtkit-daemon[1374]: Supervising 1 threads of 1 processes of 1 users.
Nov 30 12:51:49 myuser osspd[606]: ossp-padsp[osboxes:28593] WARN: pa_stream_drain() failed (Timeout)
Nov 30 12:52:28 myuser osspd[606]: ossp-padsp[osboxes:28650] WARN: pa_stream_drain() failed (Timeout)


The first four lines are repeated continuously, but I have not seen the osspd before.
sox ~/test.mp3 -t ossdsp /dev/dsp
hangs, no sound
then could not killall sox or root kill -9 the sox process had to kill this process
/usr/lib/osspd/ossp-slave -u 1000 -g 1000 -c 8 -n 10 -m -1 -o 0x100000 -s 0x100000 -l 4

so, not any further and I am going to have to give up at some point :(
26 Nov 2019:
flogging a dead horse in exchange for sftp supremecy
Not in the mood for aplay alsa hacking, so I thought I would just note my next big hurdle.

Getting the f-log scripts up and running.

Most of it is perl or bash scripts from 10-15 years ago, but there was the time I need to migrate to sftp using lftp.

Not sure what the correct process is(all fool me for not blogging it), but rather scarily the fix was to copy verbatim my old .ssh folder.

Had spent ages trying to get lftp to tell me it was compiled with SSL but
ldd /usr/local/bin/lftp

did not show anything re SSL and nothing in the Gentoo USE flags seemed to make any difference.

and as you can see from the flurry of f-log posts it all works!
26 Nov 2019:
making a play for aplay in a vb universe
The machine is dead, long live the machine!

I installed VirtualBox and copied the config and files and it just worked !!

But, it had the same issue I had had before, YouTube would not play and the sound was not working(pretty sure they are related).

and down the rabbit hole I fell. I could have trashed the VM and create a new ... nah.

I tried both of the software based sound cards offered by VirtualBox and both had the same result.

aplay /usr/share/sounds/alsa/Side_Right.wav
would just hang, never completing and having to be killed.

I remember having an issue about a year ago that was similar and it was solved by restarting the pusleaudio and alsa systems.
pulseaudio -k && sudo alsa force-reload

accept that did not work and gave a strange error
Unloading ALSA sound driver modules: snd-seq-midi snd-seq-midi-event snd-seq snd-rawmidi snd-seq-device snd-hda-codec-idt snd-hda-codec-generic snd-hda-intel snd-hda-codec snd-hda-core snd-hwdep snd-pcm snd-timer (failed: modules still loaded: snd-hda-codec-idt snd-hda-codec-generic snd-hda-codec snd-hda-core snd-hwdep snd-pcm snd-timer).
Loading ALSA sound driver modules: snd-seq-midi snd-seq-midi-event snd-seq snd-rawmidi snd-seq-device snd-hda-codec-idt snd-hda-codec-generic snd-hda-intel snd-hda-codec snd-hda-core snd-hwdep snd-pcm snd-timer.


I could see the card was recognised by the system and that
pavucontrol
was recognising when apps tried to play sound.

But weirdly it would only sometimes show the VU meter changing from 0

I tried a lot, lots or reboots(virtual) but nothing worked and there seemed to be nowhere to go...

With Linux there is always somewhere to go, not always an easy path but there is always the SOURCE!

So I downloaded the alsa-utils source and tried to build aplay.

Which led to another collection of hours being lost.

Basically the instructions to build the alsa-utils was

./configure
    make install

    
which sounded simple but there was no configure file.

hmmm

It needed to be generated with
aclocal

But that was erroring with a message about duplicate po.makefile

Surely the file cannot be faulty? It must be being built in a constant loop for patches, release etc.

Nope.

Need to edit out the duplicate in configure.ac

then it would build the configure file, then I could follow the other steps in the INSTALL file, because the two lines above were not the only commands required.

Finally everything built without error. Or did it?

the aplay folder did not have aplay executable and running make did error!

Now what?

Looked and the Makefile and it was really simple, so I just copied out the gcc lines and it worked!
gcc -DHAVE_CONFIG_H -I. -I../include -I../include -g -O2 -c -o aplay.o aplay.c
gcc -g -O2 -o aplay aplay.o -lrt -lasound -lm -ldl -lpthread


And now I am adding printf statements everywhere to try and pin point where it is getting hung up.
26 Nov 2019:
fell the foe by giving kernel more than I wanted
The machine is dead, long live the machine!

With email sorted I had one more big foe to fell, sound.

Not sure why, but sound still seems to be an issue with Linux

Tried a lot and in the end(after many hours of rebuilding the kernel and rebooting), I just enabled everything, even though I knew I did not have the hardware, that fixed it.

With my new found sound system knowledge I decided to take on a bigger sound foe.
26 Nov 2019:
my claws of stupidity clause
The machine is dead, long live the machine!

First real problem was email. Installed Claws(the greatest mail email program of all time) and found I should be able to just copy all the config files and all the data files and it would just.
This seemed to work and loading up Claws showed all my folders(I have many) with the correct counts and then it got my email over the last few days!

Winner!

NOPE!

Clicking on anything other than the new mail returned nothing. No errors and the folder counts started zero-ing out!

... a lot of time trying to find out what was wrong ...

Oops! I had put not one but two sets of data files in ever so slightly the wrong place so Claws could not find them. Doh!
26 Nov 2019:
kurput phenonom II
My machine died, luckily not the new one. It went completely, the power would turn on for a few seconds and then turn off again.

I knew what to do, make sure everything is plugged in and seated correctly, no change. Start unplugging things, external things. No change, drives, no change, graphics card, no change, memory modules. If both modules were removed then the system beeped.

Now the motherboard was bare except for the CPU and one memory module(I tried both as singles). Swapped CMOS battery for new one ... no change.

That's it. No happy ending. But that machine had been running almost continuously for 10 years(short by about 3 months).

This is right pain as I had only just got a booting Gentoo install on the new machine and I had lots of plans for small, slow migration.
25 Nov 2019:
emergency BURP
BURP!
16 Nov 2019:
nivdia loses fight to blender cuda gpu
And Blender loaded but would not let me set the GPU for rendering :(

After a bit of searching found that a separate component called nvidia-cuda-toolkit was required.


emerge -av nvidia-cuda-toolkit


rebuilt GCC and the NVIDIA drivers and gave a rather startling message about CUDA not working with GCC >= 8.3
But it looks like it built as special 8.3 version and set it up to work with CUDA because...

even without a reboot Blender now shows NVIDIA 1660ti and allows me to select GPU compute!

now its late, but tomorrow I will run the render tests and see if Blender is faster in Linux
16 Nov 2019:
mouse shines through xfces keyboard settings
So the mouse issue was user error. The new machine case is metal and it seems the cheap spare mouse I was using sometimes just plain did not work on it. Quick drag over my trousers and operates fine.

The keyboard is issue is more odd. Could not find any sign that I had set a specific keyboard variant on the old machine and every guide I followed made no difference.

The fix in the end was to use the XFCE Settings Keyboard app and disable the system defaults and add English(UK).

Very frustrating!

Time to test Blender out and compare the numbers I got from Windows on the same machine.
16 Nov 2019:
xfce sits on xorg and nvidia plays the fiddle
Gentoo Loads!!

But now I need X XFCE and to get my NVIDIA card working.

Quickly created a local user and ssh'd in. It is great they default root to no allowing ssh ...

Documentation tries to be super flexible, but this also makes it quite awkward to know how to proceed.

No. 1 install XFCE as my preferred window manager. This gives the ability for programs to have windows and common functionality otherwise X is a bit unforgiving.
I had hoped that this would pull Xorg with it, but no.

No. 2 rebuild the kernel with the correct settings to allow the proprietary NVIDIA driver to work. As I had no intramfs disk to work about this was very simple.

No. 3 install the NVIDIA drivers and reboot

No. 4 install Xorg

run startx
screen goes blank ... and then lots of errors about missing twm, xclock and more.

Oh, I needed to tell the startx to start xfce
exec startxfce4
in ~/.xinitrc

run startx
and get a default desktop!

Try and click on anything ... oh, mouse pointer does not move.
and although I can get a XFCE terminal running the pipe character is not working so no grep :(

Weirdly, the mouse could click just not move.
14 Nov 2019:
uefi is a secure pain in the fdisk
Gentoo was now ready for me to build the kernel - spent far too long reading all(a lot) of the options and then just accepting the defaults.
Gentoo even has a Gentoo Options config flag to force some of the required options.

My previous machine had required lots of very specific flags to be set or it could not even load the kenerl from the disk.

Got to the boot loader install step and Grub said it was not UEFI ready, which seemed a bit odd as everything implied that was what all the defaults were.
Went back and found a note saying that if you are using UEFI then to make sure boot partition is formatted as VFAT. Then had to format the boot partition, mount it and install the kernel to it again.

Shutdown time. Followed the steps to un-mount everything and removed USB key. One final command ...

reboot
reboot: command not found

oops, I removed the media that had the reboot command on it :)

Time for a good old "turn it off and on again"

please insert system disk and press any key to boot

:(

The way the Gentoo install works the install can be continued. So just boot off the USB again, remount the root file system and /boot and chroot again ...

Time to start checking things.

fdisk /dev/sda
shows the boot partition as UEFI so lets run Grub again.

grub-install --target=x86_64-efi --efi-directory=/boot

Installing for x86_64-efi platform.
EFI variables are not supported on this system.
EFI variables are not supported on this system.
Installation finished. No error reported.


No error reported!?

what can I check?

Oddly
fdisk /dev/sdb
does not show UEFI and a number of notes indicate you must boot in UEFI mode to be able to build/install a new UEFI system.

Time for a quick post for help https://forums.gentoo.org/viewtopic-p-8388606.html#8388606

Oh, the USB needs to be booted in UEFI mode.
I had tried that previously and got
uefi security verification failed (0x1A) security violation
and I had interpreted UEFI Secure Boot as being synonymous to UEFI and Secure Mode.

Secure Mode is greyed out in my BIOS, but I can change the OS from Windows Secure to Other. Which did not say it had disabled Secure Boot, but it had.

(not sure I needed to, but I rebuilt my USB with dd from the old Gentoo system)

I can now boot the UEFI option for the USB key!
fdisk /dev/sdb
clearly shows the USB is running in UEFI mode.

Once again mount root and /boot and chroot

grub-install --target=x86_64-efi --efi-directory=/boot
No errors

Could this be it?

Reboot and ...

Gentoo loads !!
14 Nov 2019:
night night monitor
quick note for me in the future;

The command to force the monitor to sleep from X is

xset dpms force off

moving the mouse will then re-enable the signal.

This was needed to avoid a second machine switching the video signal when it rebooted. This monitor is very nice except for the incredibly fiddly and barely accessible controls.
12 Nov 2019:
gentoo install slog
Some things you cannot prepare for; I got a new computer!

To fair the old one was coming up to 10 years in service(running 24/7). I had spec'd and built that machine, opting for 8GB ram and 64bit processor when both were rarities. Skimping on all the other details HDD, Motherboard and case. 40GB SSD and just about the only motherboard that did not support USB3.

I did not get to build the new one, but I will not look a gift horse in the mouth.

It is an i5-9400f 2.90GHz with 6 cores running at 3.98GHz, 16GB ram and a NVIDIA GeForce GTX 1660Ti (6GB, 1536 cores). It even comes in a Blue LED lit case and is very quite.

As with nearly all PCs pre-built, it came with Windows 10. Used Clonezilla to save its 4 GPT partitions from the nice 500GB SSD to a HDD. Even though I could select it in the BIOS, the cloned drive would not boot into Windows until I had physically disconnected the original.

Oh and the BIOS looks like a movie mock-up. No more blue background with white ASCII text at 80x25. This BIOS screen has USB mouse support and an animated background that really looks cool.

The next job is to Linux-ise it. I want Gentoo again to get the most from it.

So far I have written a Gentoo minimum ISO to USB using the free Windows app Rufus. Rufus is pretty amazing and just gets on with the job. If you ever want something interesting and insightful to read try the FAQ. Read it all, even though I had no reason too. It was just very well written and entertaining, but quite long.

The Gentoo Handbook is not for that faint hearted. The first few pages after selecting your target machine architecture lists the 10 steps required and each is quite involved.

Last time I did this it was to harness the power of a 64bit CPU when nearly all other Linux distros were ignoring it. So I had a fair idea what I was getting into.

You ideally need another machine with a web browser open to the Gentoo installation and also networking so you can SSH and control the install and access the internet for updates.

I currently have, wiped the old Windows partitions, created all the required Linux partitions, formatted them and mounted them. Copied all the install files to the new disk and transferred control via CHROOT.

The scary bit is now to build the Linux Kernel and install it for booting.
12 Nov 2019:
apple makes you laugh all the way to their bank
I always tell people that I cannot and will not do Apple support, yet here I am again.

Parent had setup Apple family sharing and had gifted an old iPhone 5 to her child. Fast forward to a while later and the phone died, would not charge, dead to the world.

Time passed and the parent got an carrier upgrade to a newer phone so they gifted their old device to the child and this is where it all went wrong.

Trying to setup the old phone with the child account requires verification, but it was so long ago that not only did they not have the verification phone they did not even know what the number would have been.

Apple in it's infinite wisdom hides the details of the verification device/number.

Now I am not sure if it is a UK thing, but holding onto your phone number has never been that big, so why Apple think any phone number you use to register will be yours for life is a mystery. Remember, this was a required step on the oringal account setup and first phone to hand was used.

This were it gets a bit ranty. There are lots of inconsistent messages and options in iOS for recovering your Apple ID account and I even went through them all after the parent had, very confusing and in no way instructive or informative.

In the end I stated there was nothing I could do and they should contact Apple. Except Apple, like most tech companies has no support phone number, but they did have live chat, so they tried that.

After 2 and bit hours they found that the account was now under review and this would not be resolved until the EARLIEST 4 days.

At this point I got involved again. The agent on the live chat was obviously dealing with multiple users and would take minutes to reply to the simplest of messages. They also would not state that the owner would have to wait 4 days(minimum) except until I had grilled them repeatedly. Instead stating the issue was out of their hands and to await the results of the review. For sometime they continued to use the line "Wait for the Apple email" and were unsupportive when the owner repeatedly clicked "Send and Receive" and reported no emails from Apple.

I had to ask how, when the whole point of having a Parent/Child relationship was supposed to eliminate this sort of technical/account issue, this was so difficult.

The Parent had a new properly setup iOS device with the correct Apple ID and family sharing options.
The Child had an iOS device that was known to be working and have had all the Parents details on it. The Child had the Apple ID and password.

The only thing neither of them had was control of the mobile number that setup the child account many years ago.

On top of that, they had to go out of their way to find a reference TO the old phone number as almost none of the recovery processes would operate without it.

And the most confusing thing was, that before contacting support the process had sent a verification number to the brand new device and had been authorised and accepted. It really REALLY need to then explain the review process, because in fact it just went back to the start of the account recovery wizard.

Really, do I have to keep telling people buying Apple is going to lead to heart ache, not to mention a lighter wallet?
12 Nov 2019:
10 inch drop fraid apple device
More tech support stories from recent days.

No 1. and the funniest, is I know someone who got the latest iPhone 10 who then had a little accident with it within 24hrs.

No, not a classic screen crack or case bend. I am talking about the charging cable. If you own any iOS device that uses the lightning connector you probably have already experienced it's less than stellar robustness.

Seen many frayed connector sleeves, but this really takes the biscuit. Then entire lightning connector metal that goes into the phone has snapped off. Luckily not stuck in the phone.

So, how did this happen? Rabid dog? dropped on to hard surface from two floors up?

Nope, it fell off a 10" stool, on to carpet.

I will just let that sink in. A fall from ten inches onto carpet.

The owner told me they specifically upgraded to get the wireless charging, but it does not come with the charger...

More iPhone Apple support madness next time.
04 Nov 2019:
three usb drives and a ssd
A couple of weeks ago a friend asked me to "fix" their computer. It was running unbearably slow.

As I had originally spec'd and built this specific PC almost exactly 10 years ago I had a look.

From Windows 10 Task Manager the issues were very apparent. The HDD was in almost constant use due to constant page swapping in and out of RAM. Simply put, the machine was running out of memory and trying to get the needed extra by using the vastly slower hard disk drive.

Based on the original requirements this machine had opted for a larger HDD (1TB) and smaller RAM (3GB). These were serious trade-offs and made sense at the time.

Job 1: More RAM.
Found a number of pages discussing the specific RAM modules required by this motherboard and promptly bought the maximum of 8GB for around £50. I remember when 4MB(not GB) was hundreds of pounds.
This was duly implanted with little ceremony and instantly things got much better.

Job 2: Switch to SSD.
SSD prices have become so cheap we were able to get a 500GB SSD for, again, around £50.
All I had to do was make sure everything was backed up and clear down the current slow HDD from 600+GB to 500GB(or what ever the new drive would actually format too).

I thought this was going to be easy. Firstly I was told a back up was being made regularly and automatically. But when I tried to view the backup the system just spun for hours, maybe the backup was there, but maybe not. Not happy with the inherent risk we opted to buy a new external HDD.
Now began the slow process of backing up a large amount of small files. Mainly songs and photos, but also plenty of random bits.

This took so long that I had to leave the owner twice after promising to do the work. Defragging also took hours on end with no sign or indication of when it would complete.

Eventually everything was backed up and we found lots of duplicates and other rubbish that could be unceremoniously cut.

I had found a lot of guides for moving from HDD to SSD and it seemed straight forward. Create a Windows 7(in Windows 10) System Backup and then restore it to the new drive.

Except that did not work and I ended up looking after the PC while trying to complete this simple task. Hours and hours and more hours were spent trying again and again to create a correctly sized backup and to then restore it.

I started by using Windows 10 Disk Management tools to shrink the 1TB drive. This seemed to go well. Delete stuff, Defrag(multiple hours) and then Shrink. Only, it got to just under 500GB and refused to shrink the partition any further.

I kept deleting more and more until the total size was 50GB. But it would not shrink even one byte smaller than the previous 500GB. I tried many many things none worked and it all appears to be down to unmovable NTFS system file call $BitMap.

There were many examples of users having this issue and then solving it. There were a couple that had my problem and there were no solutions. Any attempt to use the SysInternals tool contig or contig64 resulted in an Access Denied message. Even when an attempt had been made to be Admin and disable interfering processes. I even tried from the Windows Recovery console and got the same message. Which should be impossible?

This was a big issue as the Windows System Restore would always report the target drive was too small.

Despondent, I changed tact and created a GParted USB drive. This allowed me to forcibly shrink the partition and ignore the NTFS $BitMap issue. Once the deed was done everything continued to work in Windows so I made a new System Backup.

But, the System Restore STILL said the target drive was too small. I was gob struck and tried many solutions to no avail.

What was more annoying than anything else was the number of guides that showed all this *just worked*, just not for me.

At my wits end, I created another USB boot drive, this time for Clonezilla. I now had a Windows System Recovery USB, a GParted USB and Clonezilla USB.

The guides for cloning Windows 10 with Clonezilla were a few years old and the interface I was using was from the USB creation tool UBootin.

*snip*

Turns out the version of Clonezilla that UBootin uses is really REALLY out of date and caused no end of issues, from just not being very good. Eventually got the latest Clonezilla and overwrote the USB.

Now I could follow the guides screenshots for screenshot and command for command.

*snip*

Got confused with MBR and GPT partitioning systems, assuming the Windows NTFS was GPT and wasted a lot of time.

*snip*

Do not want to talk about it, but at one point I was manually creating partitions using sector byte sizes just to make Clonezilla accept partition designations.
There was also a lot of mess regarding overlapping partitions(that weren't).
But after what seem an age a 150GB partition was cloned onto the 500GB SSD. Job done?

NO!

Would not boot, or, more to the point would boot and then would say no system to boot. You know, even though it had booted and we saw the Windows flag during it booting, before it reported it could not boot.

Luckily the Windows System Rescue USB was able to fix this and Windows finally booted all the way with the new SSD.

At this point I had disconnected the old HDD and I started on my merry way resizing the partition (and finding I had stranded 30GB at the wrong end of the disk and is now lost) and restoring all the programs and files.

This went swimmingly and finally shutdown, reattached the old HDD and booted to Clonezilla. I had realised that I need to ensure the old HDD did not boot and just sat as data drive. fdisk disabled the BOOT flag and rebooted.

First problem. The BIOS did not want to boot the SSD that I knew should have booted fine. Quick cable swap fixed that and Windows booted.

Except no old data HDD. Showed as Offline in Disk Manager and in a unusual sign of helpfulness I was informed it was offline due to duplicate Drive ID.

Fixed that and told Windows to use the new D Drive for all the Music.

That bit went well and ITunes picked up on the change.

The machine is now in a reasonably healthy state. A lot of other things were "worked on" but I am exhausted from doing the work(that should have been easy) and from writing all this.
loading results, please wait loading animateloading animateloading animate
[More tags]
rss feed

email

root

flog archives


Disclaimer: This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk In fact I'm not responsible for anything ever, so there!