You are not logged in.

#1 2022-10-27 05:38:32

Maeda
Member
Registered: 2015-02-17
Posts: 44

OSS v4.2 ELF object error

Hello,

I am using ALSA, but have some POP (probably) due to power on when my sound card is changing the sample rate (annoying), I opened a bug report directly on kernel-ALSA. But looking at the list of current opened bug, I am doubting I will get one day an answer.

So I wanted to try an (only?) alternative: OSS.

I followed the OSS wiki page and downloaded the OSS non-free AUR package. The OSS AUR package does not install and the git is close to OSS non-free. So I stick with the OSS non-free (I want stability).

My system is currently using Arch 5.15.70-1-lts 64 bits (I also have 5.19.10.arch1-1).

After downloading the snapshot and untar and `makepkg -si`, it installs well. `sudo ossdetect -v` detects my sound card.

Issue appears when trying to `sudo soundon` (note: I removed lot of similar lines between [...]):

Relinking OSS kernel modules for ""
This may take few moments - please stand by...

OSS build environment set up for REGPARM kernels

Building module osscore
Failed to compile OSS
/lib/modules/5.15.70-1-lts/kernel/fs/ubifs/ubifs.ko.zst is not a valid ELF object
/lib/modules/5.15.70-1-lts/kernel/fs/ubifs/ubifs.ko.zst is not a valid ELF object
/lib/modules/5.15.70-1-lts/kernel/fs/ubifs/ubifs.ko.zst is not a valid ELF object
[...]
/lib/modules/5.15.70-1-lts/kernel/crypto/essiv.ko.zst is not a valid ELF object
make -C /usr/lib/modules/5.15.70-1-lts/build M=/usr/lib/oss/build modules
make[1] : on entre dans le répertoire « /usr/lib/modules/5.15.70-1-lts/build »
  CC [M]  /usr/lib/oss/build/osscore_lnk.o
/usr/lib/oss/build/osscore_lnk.c: Dans la fonction « oss_get_time »:
/usr/lib/oss/build/osscore_lnk.c:89:10: erreur: déclaration implicite de la fonction « get_seconds » [-Werror=implicit-f
unction-declaration]
   89 |   return get_seconds ();

      |          ^~~~~~~~~~~
/usr/lib/oss/build/osscore_lnk.c: Dans la fonction « alloc_fop »:
/usr/lib/oss/build/osscore_lnk.c:1012:15: attention: variable inutilisée « tmp_compat_ioctl » [-Wunused-variable]
 1012 |   new_ioctl_t tmp_compat_ioctl = (new_ioctl_t) op->compat_ioctl;
      |               ^~~~~~~~~~~~~~~~
/usr/lib/oss/build/osscore_lnk.c:1011:15: attention: variable inutilisée « tmp_unlocked_ioctl » [-Wunused-variable]
 1011 |   new_ioctl_t tmp_unlocked_ioctl = (new_ioctl_t) op->unlocked_ioctl;
      |               ^~~~~~~~~~~~~~~~~~
cc1 : certains avertissements sont traités comme des erreurs
make[2]: *** [scripts/Makefile.build:289 : /usr/lib/oss/build/osscore_lnk.o] Erreur 1
make[1]: *** [Makefile:1898 : /usr/lib/oss/build] Erreur 2
make[1] : on quitte le répertoire « /usr/lib/modules/5.15.70-1-lts/build »
make: *** [Makefile:21 : default] Erreur 2

Relinking the OSS kernel modules failed

I found this and that on OSS forums, but is not the same error I am getting.

Is the AUR package working on other users Arch system?

Thanks for your help.

Last edited by Maeda (2022-10-27 05:39:11)

Offline

#2 2022-10-27 07:52:49

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 17,610

Re: OSS v4.2 ELF object error

... The pop is likely due to power saving you can try to disable via  /etc/modprobe.d/disableHDAPower.conf

options snd-hda-intel power_save=0

-- apparently not that module, still check the params of your module whether it has an option to disable power saving or the like.

In general, to be able to switch the sample rate it is indeed the case that the device has to be closed and reopened with a new rate, only one rate can be played back at the same time, that is true for all audio cards, that the card "powers down" might indeed be a quirk either of the driver or the card. Depending on how important that is to you, you might also opt for the "traditional" case of adding dmix/pipewire/pulse to take care of sample rate conversions more fluidly

That OT info out of the way: Just from logistics, you might have to uncompress the modules that are listed as invalid  due to the  soundon tool not having support for compressed modules.

Last edited by V1del (2022-10-27 08:50:11)

Offline

#3 2022-10-27 10:42:46

Maeda
Member
Registered: 2015-02-17
Posts: 44

Re: OSS v4.2 ELF object error

Thanks.

We can focus on ALSA issue if more relevant (I will change the topic title in case of dealing with it at the end).

I am not sure where to verify if powersaving parameter is supported by my RME card, but using that below path, it does not seem to be supported:

$ ls /sys/module/snd_rme96/parameters/
enable  id  index

That is why I was wondering if OSS (driver) would be better on that (i.e. not supporting powersaving at all smile).

The reason is that the sound card is directly connected to an amplifier (no preamp) and I am using the `amixer` as preamp to control the volume.

I can give dmix a try, but I would like to avoid (software) resampling (I think that is what are doing every mixers), because my card is able to deal with almost all of the needed sample rates without resampling.

Pulse: I tried and will never use it anymore.
I will try with dmix to see if it helps, but I am afraid it will resample "by default", so probably not an option too.

If at the end, it is all the sound cards behaving like this on switching sample rates, I will probably have to use a mixer to take care of resampling to avoid the power down/up of the sound card.

Any suggestion to get the best quality mixer setting is welcome (if some are carrying about sound quality), I will search deeper on that too.

Last edited by Maeda (2022-10-27 10:46:57)

Offline

#4 2022-10-27 11:05:28

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 17,610

Re: OSS v4.2 ELF object error

That's technically a different topic. If you really want to focus on getting OSS to build we can look at that and you might want to open a distinct thread for ALSA/other mixers. As for avoiding resampling, you can configure pipewire and/or pulse to avoid resampling if not necessary: https://wiki.archlinux.org/title/PulseAudio#daemon.conf or https://wiki.archlinux.org/title/PipeWi … le_rate(s) -- but if you want to look at these closer I'd suggest a new topic, sorry for even triggering the initial derail, but it looked like this might possibly be something simpler before I saw the used card driver

As metioned from the error as we see here you might have to uncrompress the modules --- (for a simple test going to the modules that are mentioned there and decompressing them with zstd as is and removing the compressed variants should be sufficient). If that doesn't help already, post the complete output of the soundon command in english by prepending it with LC_ALL=C.

Offline

#5 2022-10-27 11:25:01

loqs
Member
Registered: 2014-03-06
Posts: 15,477

Re: OSS v4.2 ELF object error

Have you tried in osscore.c replacing

oss_time_t
oss_get_time (void)
{
#if 1
  return get_seconds ();
#else
  return xtime.tv_sec;
#endif
}

with

oss_time_t
oss_get_time (void)
{
#ifdef _LINUX_TIMEKEEPING32_H
  return get_seconds ();
#else
  return ktime_get_real_seconds();
#endif
}

https://bbs.archlinux.org/viewtopic.php?id=278259

Offline

#6 2022-10-27 11:39:33

Maeda
Member
Registered: 2015-02-17
Posts: 44

Re: OSS v4.2 ELF object error

Not sure where to change that when not compiling from source?
I tried to change it in pkg/oss-nonfree/usr/lib/oss/build/osscore.c, then ran `makepkg -si`, but the osscore.c in /usr/lib/oss/build/ does not contain the change.

By the way, I have a LOT of ZST files to uncompress as per the output, I am not sure about disc space. If uncompressing ZST files is mandatory to continue the troubleshoot, I will probably give a try to ALSA (and elaborate on that on an other topic).

As per the output, there is also an issue with "alloc_fop" and "tmp_unlocked_ioctl" along with "get_seconds" (not sure all is linked to the same root cause).

Last edited by Maeda (2022-10-27 11:40:07)

Offline

#7 2022-10-27 11:51:36

loqs
Member
Registered: 2014-03-06
Posts: 15,477

Re: OSS v4.2 ELF object error

cd oss-nonfree
curl -o PKGBUILD.diff http://ix.io/4eeK
git apply PKGBUILD.diff
makepkg -rsi

Last edited by loqs (2022-10-27 11:55:13)

Offline

#8 2022-10-27 12:04:52

Maeda
Member
Registered: 2015-02-17
Posts: 44

Re: OSS v4.2 ELF object error

Thanks, that is a quick step smile.
Same error as before.

Full output available here.

Offline

#9 2022-10-27 12:18:28

loqs
Member
Registered: 2014-03-06
Posts: 15,477

Re: OSS v4.2 ELF object error

What is the output of

file /usr/lib/oss/build/osscore_lnk.c
cat /usr/lib/oss/build/osscore_lnk.c

Offline

#10 2022-10-27 12:29:00

Maeda
Member
Registered: 2015-02-17
Posts: 44

Re: OSS v4.2 ELF object error

1-
/usr/lib/oss/build/osscore_lnk.c: symbolic link to osscore.c

2- Full content of osscore_lnk.c

Offline

#11 2022-10-27 12:46:59

loqs
Member
Registered: 2014-03-06
Posts: 15,477

Re: OSS v4.2 ELF object error

What is the contents of pkg/oss-nonfree/usr/lib/oss/build/osscore.c?

Offline

#12 2022-10-27 12:54:59

Maeda
Member
Registered: 2015-02-17
Posts: 44

Re: OSS v4.2 ELF object error

It contains the changes you want me to try (full content).

Offline

#13 2022-10-27 13:00:42

loqs
Member
Registered: 2014-03-06
Posts: 15,477

Re: OSS v4.2 ELF object error

Assuming you did install the updated package then /usr/lib/oss/build/osscore_lnk.c  which is a symbolic link to /usr/lib/oss/build/osscore.c should match the output from post #12 instead of the output from post #10.

Offline

#14 2022-10-27 13:02:15

Maeda
Member
Registered: 2015-02-17
Posts: 44

Re: OSS v4.2 ELF object error

Let me remove that folder and untar from the AUR package and make changes (git diff apply) to be sure nothing bad remains in the folder.
+ remove /usr/bin/oss folder

Last edited by Maeda (2022-10-27 13:04:36)

Offline

#15 2022-10-27 13:14:37

Maeda
Member
Registered: 2015-02-17
Posts: 44

Re: OSS v4.2 ELF object error

I can not see the change on any files.

Summary:

tar -xvf oss-nonfree.tar.gz
cd oss-nonfree
curl -o PKGBUILD.diff http://ix.io/4eeK
git apply PKGBUILD.diff
makepkg -rsi
sudo soundon

Offline

#16 2022-10-27 13:25:04

loqs
Member
Registered: 2014-03-06
Posts: 15,477

Re: OSS v4.2 ELF object error

# pacman -Rdd oss-nonfree
# rm -rf /usr/lib/oss/build
# pacman -U oss-nonfree-4.2_2020-1-x86_64.pkg.tar.zst

Last edited by loqs (2022-10-27 13:25:12)

Offline

#17 2022-10-27 14:21:40

Maeda
Member
Registered: 2015-02-17
Posts: 44

Re: OSS v4.2 ELF object error

Not better.

But I did the changes directly in /usr/lib/oss/build/osscore.c and ran soundon again, went better!

Then, I blacklisted the ALSA modules and restarted the system.

The soundon is now stating:

Relinking OSS kernel modules for ""
This may take few moments - please stand by...
Relinking OSS kernel modules finished
SNDCTL_SYSINFO: Inappropriate ioctl for device
SNDCTL_SYSINFO: Inappropriate ioctl for device

OSS started OK

ossdetect -v is OK :

$ sudo ossdetect -v
Detected RME Digi96/8 PAD
USB support available in the system, adding USB driver
Detected Generic USB audio/MIDI device (BETA)
$ sudo ossmix -a | grep -i vmix
SNDCTL_MIX_NRMIX: Inappropriate ioctl for device
$ ls /dev/oss/oss_digi960/
mix0  pcm0
$ sudo vmixctl attach /dev/oss/oss_digi960/pcm0 
SNDCTL_ENGINEINFO: Inappropriate ioctl for device
$ sudo osstest
SNDCTL_SYSINFO failed: Inappropriate ioctl for device
Cannot get system information. Perhaps you are not running OSS 4.x
but some slightly incompatible sound subsystem.

sad

Last edited by Maeda (2022-10-27 14:52:58)

Offline

#18 2022-10-29 10:28:22

Maeda
Member
Registered: 2015-02-17
Posts: 44

Re: OSS v4.2 ELF object error

OK I will use ALSA with dmix/resample (hi-res) instead, that is working well enough.

Last edited by Maeda (2022-10-29 10:28:45)

Offline

Board footer

Powered by FluxBB