Showing posts with label alsa. Show all posts
Showing posts with label alsa. Show all posts

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

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.