Sunday, September 29, 2019

mpg123 codec and MPlayer 1.1.1 test

My compile of mplayer did not have mpg123 codec. So it uses ffmp2float decoder for mp3.

In 486 PC i downloaded mpg123-1.22.4.tar.bz2

Replaced write_alsa function in alsa.c with this one:
static int write_alsa(audio_output_t *ao, unsigned char *buf, int bytes)
{
snd_pcm_t *pcm=(snd_pcm_t*)ao->userptr;
snd_pcm_uframes_t frames;
snd_pcm_sframes_t written;
frames = snd_pcm_bytes_to_frames(pcm, bytes);
written = snd_pcm_writei(pcm, buf, frames);
if (written == -EINTR) /* interrupted system call */
written = 0;
else if (written == -EPIPE) { /* underrun */
if (snd_pcm_prepare(pcm) >= 0)
written = snd_pcm_writei(pcm, buf, frames);
}
if (written >= 0)
return snd_pcm_frames_to_bytes(pcm, written);
else
{
if(snd_pcm_state(pcm) == SND_PCM_STATE_SUSPENDED)
{
/* Iamnothappyabouthisnothappyreallynot. */
snd_pcm_resume(pcm);
if(snd_pcm_state(pcm) == SND_PCM_STATE_SUSPENDED)
{
error("device still suspended after resume hackery... giving up");
return -1;
}
}
return 0;
}
}
This is present in mpg123-1.14.4 and changed in later versions. If above change is not made then it will not play mp3 files and cpu usage is 100%.

Patch file for download.

Then created package.
Configuration line was:
./configure --prefix=/usr i486-kola-linux --enable-int-quality=yes  --enable-buffer=yes  --enable-modules=no --with-optimization=3
Installed it on 486 and also on my virtual box so i can compile mplayer 1.1.1

After transferring new mplayer binary to 486 made test. Player command line options: -lavdopts lowres=0:skiploopfilter=all:skipidct=bidir -framedrop -af channels 1



Friday, September 27, 2019

mpg123 retest after sound is back

So i still have test file i made older post.
Sad thing is i have lost source changes i made to the lib to get it working. It may be on my Pentium III machine.
But i think i can get it to compile and work again. Maybe will try newer version.

In this video i ran it in X Window. But it will work also strait no console.

./mpg123 http://live-mp3-128.kexp.org:80/kexp128.mp3

alsa-driver-1.0.23 compile

First downloaded alsa-driver-1.0.25
ftp://ftp.alsa-project.org/pub/driver/

made package and installed.
after boot got:
snd.o: unresolved symbol lock_kernel

Reading here about it:
https://www.alsa-project.org/pipermail/alsa-devel/2011-November/046173.html

So, going back to 1.0.23 version
 wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.23.tar.bz2
 Still there is defined CONFIG_SND_HAVE_NEW_IOCTL on older versions. This is where lock_kernel and unlock_kernel originates.

Need to dig deeper so i can compile v1.0.25. But for now v1.0.23 is ok.

After building v1.0.23 and installing it i removed v1.0.25. But a lone driver snd-es18xx was present in modules dir. It was compiled for older kernel. I removed it and ran:
depmod

Now kernel will not complain about missing drivers.

Here is build and install process:


I need to compile also alsa programs. System has some older version and complains about it on bootup.

Saturday, September 14, 2019

Make hell of compilation in Linux enviroment

So i have 486dx4 CPU running 120MHz. And i want to build X.org. etc.

It takes insane time in make process, and it repeats in every package and directory.
Like checking:
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking return type of signal handlers... void
checking for rename... yes
checking for fchmod... yes
checking for special C compiler options needed for large files... no
Its not fast, and every make will do this. Why isn't there per source build one check and that is it. Like why? If source code is small it takes longer in make checking then compiling...

Like make one include file and done.

Friday, September 13, 2019

Mplayer 1.1.1

I needed to recompile Mplayer again, so started with version 1.4.0
Building it on virtual machine and transfer later to 486 PC.

I have gcc 3.4.6

After ./configure --options.....
i get:
Checking for inttypes.h (required) ... no
Checking for sys/bitypes.h (inttypes.h predecessor) ...
Error: Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed.
After searching i found out that it depends on compiler version libdc++, i think its present since gcc 4.0

Downloaded 1.3.0. Same problem.

Downloaded 1.1.1.

 ./configure --yasm='' --target=i486-Linux --disable-ftp --disable-tv-v4l1 --disable-tv --disable-qtx --disable-real --disable-win32dll --disable-gif --disable-mmx   --disable-3dnow   --disable-sse --disable-sse2  --disable-fastmemcpy --disable-xanim --disable-vm --disable-vesa --disable-svga --disable-jpeg --disable-gl --disable-mga --disable-sdl --disable-fbdev  --disable-caca --disable-aa --disable-dga1 --disable-dga2 --disable-tga --disable-md5sum --disable-pnm --disable-mng --disable-libvorbis --disable-esd --enable-libmpeg2-internal --enable-libmpeg2 --disable-decoder=mlp --disable-mencoder --disable-freetype --disable-ass --disable-postproc --disable-unrarexec --disable-vidix --disable-vidix-pcidb   --disable-encoder=mlp  --disable-parser=mlp  --disable-protocol=mlp  --disable-demuxer=mlp  --disable-muxer=mlp --disable-yuv4mpeg     --disable-cmov  --disable-fast-clz --disable-fast-cmov --disable-mtrr  --enable-xv  --disable-ladspa --disable-smb

I get dsputil errors on mlp and truehd.
Had to manualy disable in source code decoders. But problematic part still remained (dsputil.c):
#if CONFIG_MLP_DECODER || CONFIG_TRUEHD_DECODER
    ff_mlp_init(c, avctx);
#endif
Commented this also out.
And i got my compiled binary.


Thursday, September 12, 2019

Linux kernel 2.4.37.11 rebuild on 486 (2)

Booting up, dmseg and startx



Linux version 2.4.37.11 (root@dialog:) (gcc version 3.4.6) #2 Wed Sep 11 12:44:15 EEST 2019
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 0000000001000000 (usable)
 BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
16MB LOWMEM available.
On node 0 totalpages: 4096
zone(0): 4096 pages.
zone(1): 0 pages.
zone(2): 0 pages.
DMI not present.
Kernel command line: BOOT_IMAGE=Linux-2.4.37.11 ro root=301
Initializing CPU#0
Console: colour VGA+ 80x25
Calibrating delay loop... 59.80 BogoMIPS
Memory: 13580k/16384k available (1449k kernel code, 2420k reserved, 478k data, 80k init, 0k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
CPU:     After generic, caps: 00000001 00000000 00000000 00000000
CPU:             Common caps: 00000001 00000000 00000000 00000000
CPU: AMD 486 DX/4-WB stepping 04
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
PCI: PCI BIOS revision 2.10 entry at 0xfc020, last bus=0
PCI: Using configuration type 1
PCI: Probing PCI hardware
PCI: Probing PCI hardware (bus 00)
isapnp: Scanning for PnP cards...
isapnp: Card 'D-Link DE-220P PnP ISA Card'
isapnp: Card 'ESS ES1868 Plug and Play AudioDrive'
isapnp: 2 Plug & Play cards detected total
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
VFS: Disk quotas vdquot_6.5.1
Journalled Block Device driver loaded
pty: 512 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with HUB-6 MANY_PORTS MULTIPORT SHARE_IRQ SERIAL_PCI ISAPNP enabled
ttyS00 at 0x03f8 (irq = 4) is a 16550A
ttyS01 at 0x02f8 (irq = 3) is a 16550A
Real Time Clock Driver v1.10f
Floppy drive(s): fd0 is 1.2M, fd1 is 1.44M
FDC 0 is an 8272A
ne.c: ISAPnP reports Generic PNP at i/o 0x240, irq 5.
ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com)
Last modified Nov 1, 2000 by Paul Gortmaker
NE*000 ethercard probe at 0x240: 00 80 c8 f0 00 9a
eth0: NE2000 found at 0x240, using IRQ 5.
loop: loaded (max 8 devices)
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
hda: FUJITSU MPB3032ATU, ATA DISK drive
hdc: SAMSUNG MP0402H, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: attached ide-disk driver.
hda: 6335280 sectors (3244 MB), CHS=785/128/63
hdc: attached ide-disk driver.
hdc: host protected area => 1
hdc: 78242976 sectors (40060 MB) w/8192KiB Cache, CHS=4870/255/63
Partition check:
 hda: hda1 hda2
 hdc: hdc1
ide: late registration of driver.
hdh: _NEC CD-RW NR-9300A, ATAPI CD/DVD-ROM drive
ide3 at 0x168-0x16f,0x36e on irq 12
hdh: attached ide-cdrom driver.
hdh: ATAPI 48X CD-ROM CD-R/RW drive, 2048kB Cache
Uniform CD-ROM driver Revision: 3.12
ide3: ESS ES1868 Plug and Play AudioDrive IDE interface
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
Initializing Cryptographic API
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 1024 bind 2048)
Linux IP multicast router 0.06 plus PIM-SM
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 80k freed
Adding Swap: 32252k swap-space (priority -1)

X Window System (2)

Make it

make World > World.log 2>&1

And i fallow it in another terminal window

tail World.log -f

Compile time: 24 hours
It took so long because it built all tools and libs.

I removed or renamed old version of X, then:
make install

ln -s /etc/X11/app-defaults /usr/X11R6/lib/X11
ln -s /etc/X11/fs /usr/X11R6/lib/X11
ln -s /etc/X11/lbxproxy /usr/X11R6/lib/X11
ln -s /etc/X11/proxymngr /usr/X11R6/lib/X11
ln -s /etc/X11/rstart /usr/X11R6/lib/X11
ln -s /etc/X11/twm /usr/X11R6/lib/X11
ln -s /etc/X11/xdm /usr/X11R6/lib/X11
ln -s /etc/X11/xinit /usr/X11R6/lib/X11
ln -s /etc/X11/xsm /usr/X11R6/lib/X11
ln -s /etc/X11/xserver /usr/X11R6/lib/X11
chmod ug-w /usr/X11R6/lib           # Make sure the permissions are OK
/sbin/ldconfig /usr/X11R6/lib       # For Linux
 reboot

Testing it

Well it worked fine. But it built allot useless modules, extensions etc.
So i changed config files, added s3 driver support. And did rebuild.
Took another 24 hours almost.

Window manager i use is icewm 1.0.6.

Linux kernel 2.4.37.11 rebuild on 486 (1)

Download and config

Lets rebuild Linux kernel on 486.

Made directory at
mkdir /usr/src/linux-2.4.37.11
cd /usr/src/linux-2.4.37.11
Downloaded tgz file into that directory over a network.
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v2.4/linux-2.4.37.11.tar.gz df -h 
Be sure that there is enogh free space. 170MB is needed.

tar -xzf linux-2.4.37.11.tar.gz
make menuconfig

edit your conf

make dep
make clean
make bzImage
make modules
Install modules to temp, will copy later to right place.

make modules_install INSTALL_MOD_PATH=/tmp/linux 

Wednesday, September 4, 2019

X Window System (1)

X11R7

So X11 latest version is X11R7.7. Downloaded and cant find S3 ViRGE drivers. Hmmm.
https://www.x.org/releases/X11R7.7/doc/xorg-docs/ReleaseNotes.html
Removed in this Release section reveals that in this release its removed. :(

Previous version has it:
https://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html
Can we add it back?

Build script: https://cgit.freedesktop.org/xorg/util/modular/tree/?h=X11R7.6

Well, looking at the source its hell to compile.
More updated version in gitlab https://gitlab.freedesktop.org/xorg

Xfree86

I currently have Xfree86.
XFree86 Version 4.2.1 / X Window System
(protocol Version 11, revision 0, vendor release 6600)
Release Date: 3 September 2002
Latest version is:
XFree86 Version 4.8.0
Release Date: 15 December 2008
X Protocol Version 11, Revision 0
And its really easy to compile. New host.def and some changes in xfree.cf
make World
And done. Like what? :D

Still, my new video card S3 ViRGE  i bought so i can use hw accelerated yuv for Mpleyer has some problems.

Mplayer Xv req
http://www.mplayerhq.hu/DOCS/HTML/en/xv.html
It must support YUY2 packed, and YV12 planar pixel formats to be usable with MPlayer.

In S3 driver there is.
s3v_xv.c
/* Looks like ViRGE only supports YUY2 and Y211?, */
Hardware manual (link 10MB)

I need to compile X server, and Mplayer again to see if it all actually works.

Building it


States that XFree86-4.8.0-src-7.tgz has hardcopy of documents, so i will not need it.
Made directory at

mkdir /usr/src/XFree86
cd /usr/src/XFree86
Downloaded tgz files into that directory over a network.
wget ftp://ftp.xfree86.org/pub/XFree86/4.8.0/source/XFree86-4.8.0-src-1.tgz
wget ftp://ftp.xfree86.org/pub/XFree86/4.8.0/source/XFree86-4.8.0-src-2.tgz
wget ftp://ftp.xfree86.org/pub/XFree86/4.8.0/source/XFree86-4.8.0-src-3.tgz
wget ftp://ftp.xfree86.org/pub/XFree86/4.8.0/source/XFree86-4.8.0-src-4.tgz
wget ftp://ftp.xfree86.org/pub/XFree86/4.8.0/source/XFree86-4.8.0-src-5.tgz
wget ftp://ftp.xfree86.org/pub/XFree86/4.8.0/source/XFree86-4.8.0-src-6.tgz
df -h 
Be sure that there is enogh free space. 280 MB is needed.
Exctract and make preparations.

tar -xzf XFree86-4.8.0-src-1.tgz
tar -xzf XFree86-4.8.0-src-2.tgz
tar -xzf XFree86-4.8.0-src-3.tgz
tar -xzf XFree86-4.8.0-src-4.tgz
tar -xzf XFree86-4.8.0-src-5.tgz
tar -xzf XFree86-4.8.0-src-6.tgz
mkdir build
cd build
lndir ../xc
Last line is to make a shadow directory of symbolic links. So all new files will not be in source tree.
Made a new host.def and some changes in xfree86.cf in xc/config/cf. So it has what i need.

Monday, September 2, 2019

GCC 3.4.6 build

GCC 3.4.6 

My 486 system has old compiler, version 3.3.4.
To bring it sort of up to date i need to compile newer version.

Using only c,c++,obj-c parts of it.

Build script and package creation is done by script witch is based on slackware (11.0) source files.

Compile is done on 486.

First build

Changed config script so no ada, fortran java. 
--enable-languages=c,c++,objc

10 hours later it failed.  :D
This error was not dominant but present:
gcc: Internal error: Terminated (program cc1)
https://stackoverflow.com/questions/30887143/make-j-8-g-internal-compiler-error-killed-program-cc1plus

dmesg
Out of Memory: Killed process 14779 (cc1).Out of Memory: Killed process 14779 (cc1).Out of Memory: Killed process 15487 (sh).Out of Memory: Killed process 15487 (sh).Out of Memory: Killed process 16049 (cc1).Out of Memory: Killed process 16049 (cc1).Out of Memory: Killed process 15488 (genattrtab).Out of Memory: Killed process 15488 (genattrtab).Out of Memory: Killed process 16202 (cc1).Out of Memory: Killed process 16202 (cc1).Out of Memory: Killed process 16071 (make).Out of Memory: Killed process 16071 (make).Out of Memory: Killed process 16977 (cc1).Out of Memory: Killed process 16977 (cc1).Out of Memory: Killed process 16207 (make).Out of Memory: Killed process 16207 (make).
Adding more swap it seems is needed. Lets hope so.

Created a zero-filled regular file of 16M and turned it on (until restart):
dd if=/dev/zero of=/.swapfile bs=16 count=1M
mkswap /.swapfile
swapon /.swapfile
swapon -s

To disable swap if needed:
swapoff /.swapfile
Removed objc also. And removed j 2 from make comand. :D

Compile started again.

9 hours later fail again. Killed it.
cc1: out of memory allocating 9867200 bytes after a total of 7585952 bytes
dd if=/dev/zero of=/.swapfile bs=32 count=1M
Try again.

Finaly done.

Compile time: 1 day 11 hours.
Memory usage: 16 MB RAM+64MB swap (minimum swap free was 11MB by top)

Install


installpkg gcc-3.4.6-i486-1.tgz
installpkg gcc-g++-3.4.6-i486-1.tgz