Kernel 6.0-> breaks OSS

OSS specific Linux discussion (x86/amd64)

Moderators: dev, hannu, cesium

Nexus
Member
Posts: 11
Joined: Sun Sep 16, 2018 8:14 pm
Sound Card: M-Audio Delta 44, Ap 2496
OS: MX-21.2

Kernel 6.0-> breaks OSS

Postby Nexus » Sun Feb 05, 2023 9:19 pm

Installing OSS using kernel 6.1.0 failed:

Code: Select all

sudo dpkg -i oss-linux-v4.2-2021-amd64.deb

Selecting previously unselected package oss-linux.
(Reading database ... 369178 files and directories currently installed.)
Preparing to unpack .../oss-linux-v4.2-2023-amd64-envy24-kernel-v5.18.deb ...
Shutting down ALSA...done (none loaded).
Unpacking oss-linux (4.2-2021) ...
Setting up oss-linux (4.2-2021) ...
Building OSS Modules for Linux-unknown 6.1.0-2mx-amd64

OSS build environment set up for REGPARM kernels

Building module osscore
Failed to compile OSS
make -C /lib/modules/6.1.0-2mx-amd64/build M=/usr/lib/oss/build modules
make[1]: Entering directory ”/usr/src/linux-headers-6.1.0-2mx-amd64”
  CC [M]  /usr/lib/oss/build/osscore_lnk.o
/usr/lib/oss/build/osscore_lnk.c: In function ‘oss_virt_to_bus’:
/usr/lib/oss/build/osscore_lnk.c:125:10: error: implicit declaration of function ‘virt_to_bus’; did you mean ‘virt_to_fix’? [-Werror=implicit-function-declaration]
  125 |   return virt_to_bus (addr);
      |          ^~~~~~~~~~~
      |          virt_to_fix
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/linux-headers-6.1.0-2mx-common/scripts/Makefile.build:255: /usr/lib/oss/build/osscore_lnk.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.1.0-2mx-common/Makefile:2017: /usr/lib/oss/build] Virhe 2
make[1]: Leaving directory ”/usr/src/linux-headers-6.1.0-2mx-amd64”
make: *** [Makefile:21: default] Error 2
Forcing re-detection of installed soundcards
Starting Open Sound System
Relinking OSS kernel modules for "6.1.0-2mx-amd64 SMP preempt mod_unload modversions "
This may take few moments - please stand by...

OSS build environment set up for REGPARM kernels

Building module osscore
Failed to compile OSS
make -C /lib/modules/6.1.0-2mx-amd64/build M=/usr/lib/oss/build modules
make[1]: Entering directory ”/usr/src/linux-headers-6.1.0-2mx-amd64”
  CC [M]  /usr/lib/oss/build/osscore_lnk.o
/usr/lib/oss/build/osscore_lnk.c: In function ‘oss_virt_to_bus’:
/usr/lib/oss/build/osscore_lnk.c:125:10: error: implicit declaration of function ‘virt_to_bus’; did you mean ‘virt_to_fix’? [-Werror=implicit-function-declaration]
  125 |   return virt_to_bus (addr);
      |          ^~~~~~~~~~~
      |          virt_to_fix
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/linux-headers-6.1.0-2mx-common/scripts/Makefile.build:255: /usr/lib/oss/build/osscore_lnk.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.1.0-2mx-common/Makefile:2017: /usr/lib/oss/build] Virhe 2
make[1]: Leaving directory ”/usr/src/linux-headers-6.1.0-2mx-amd64”
make: *** [Makefile:21: default] Error 2

Relinking the OSS kernel modules failed
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for menu (2.1.48) ...

Seems that the virt_to_bus macro used in osscore.c has been mostly purged from kernel v6.0. https://elixir.bootlin.com/linux/v6.0/C/ident/virt_to_bus

seawright
Known Member
Posts: 118
Joined: Sat Jan 06, 2007 9:10 pm
Location: Hampshire UK

Re: Kernel 6.0-> breaks OSS

Postby seawright » Tue Feb 07, 2023 11:07 am

It appears that the wrapper function oss_virt_to_bus is not used therefore it could be safely removed and all references to it (for Linux) commented out.

Code: Select all

rgrep oss_virt_to_bus opensound-git
opensound-git/setup/Linux/oss/build/osscore.c:oss_virt_to_bus (void *addr)
opensound-git/setup/Linux/oss/build/osscore.c:// EXPORT_SYMBOL (oss_virt_to_bus);
opensound-git/kernel/OS/BeOS/os_beos.h:extern oss_native_word oss_virt_to_bus (void *addr);
opensound-git/kernel/OS/BeOS/os_beos.c:oss_virt_to_bus (void *addr)
opensound-git/kernel/OS/SCO_SV/os_sco.h:extern oss_native_word oss_virt_to_bus (void *addr);
opensound-git/kernel/OS/Linux/os_linux.h:// extern oss_native_word oss_virt_to_bus (void *addr);
opensound-git/kernel/OS/Linux/wrapper/wrap.h:// extern oss_native_word oss_virt_to_bus (void *addr);

This still leaves a reference to "virt_to_bus" in function "oss_contig_malloc" in osscore.c which needs replacing with "dma_map_single".
Unfortunately it is not a drop in replacement as it requires 4 arguments compared to virt_to_bus's one.
A corresponding "dma_unmap_single" will also be required in "oss_contig_free" before "free_pages".
regards
Clive

seawright
Known Member
Posts: 118
Joined: Sat Jan 06, 2007 9:10 pm
Location: Hampshire UK

Re: Kernel 6.0-> breaks OSS

Postby seawright » Mon Mar 20, 2023 9:25 pm

Try replacing virt_to_bus function in osscore.c with virt_to_phys.
regards

Clive

Nexus
Member
Posts: 11
Joined: Sun Sep 16, 2018 8:14 pm
Sound Card: M-Audio Delta 44, Ap 2496
OS: MX-21.2

Re: Kernel 6.0-> breaks OSS

Postby Nexus » Wed Mar 29, 2023 10:31 pm

seawright wrote:Try replacing virt_to_bus function in osscore.c with virt_to_phys.


Yep. That did it. Seems to be working alright with kernel 6.1. Came across this same solution on a 10 year old post on stackoverflow.com and for some reason managed to quickly dismiss it as also deprecated in favor of dma_map_single.

Are you still sending patches to Hannu? Looks like it's almost time for an annual update.

seawright
Known Member
Posts: 118
Joined: Sat Jan 06, 2007 9:10 pm
Location: Hampshire UK

Re: Kernel 6.0-> breaks OSS

Postby seawright » Fri Mar 31, 2023 10:04 am

Nexus wrote:Are you still sending patches to Hannu? Looks like it's almost time for an annual update.

Sent 3 Patches last month (not including this problem).
Reminder sent last week with copy to Dev.
No reply to either.
regards

Clive

nuc
Moderator
Posts: 111
Joined: Fri Aug 03, 2012 10:20 am
Sound Card: Khadas Tone Board
OS: ArchLinux
Contact:

Re: Kernel 6.0-> breaks OSS

Postby nuc » Wed May 03, 2023 9:13 pm

seawright wrote:
Nexus wrote:Are you still sending patches to Hannu? Looks like it's almost time for an annual update.

Sent 3 Patches last month (not including this problem).
Reminder sent last week with copy to Dev.
No reply to either.


Thank you anyways for your efforts @seawright.
https://github.com/Nuc1eoN/4Front-Tech-Website


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 2 guests