oss4 not compilable on gentoo

OSS specific Linux discussion (x86/amd64)

Moderators: dev, hannu, cesium

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: oss4 not compilable on gentoo

Postby igorzwx » Fri Aug 21, 2015 10:37 pm

ossuserr wrote:May be you can help me load alsa midi modules via modprobe? Tell me the names of alsa midi modules to help load them via modprobe.


I do not use ALSA.

You may find it yourself.

1. Load ALSA, then

Code: Select all

$ lsmod | grep snd


2. Plug-in your USB/MIDI thing, then

Code: Select all

$ lsmod | grep snd


You can simply boot a kind of Ubuntu LiveCD, and plug-in your USB/MIDI thing.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: oss4 not compilable on gentoo

Postby ossuserr » Fri Aug 21, 2015 10:52 pm

How to load alsa?

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: oss4 not compilable on gentoo

Postby igorzwx » Fri Aug 21, 2015 10:54 pm

ossuserr wrote:How to load alsa?


You can simply boot a kind of Ubuntu LiveCD, and plug-in your USB/MIDI thing.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: oss4 not compilable on gentoo

Postby ossuserr » Sat Aug 22, 2015 12:29 am

Some progress: the cause of not finding alsa modules was that /lib/modules/.../kernel/sound folder just magically disappered! I simply recompiled all modules:
cd /usr/src/linux-4.0.5-gentoo
zcat /proc/config.gz > .config
make && make modules_install

This restored /sound folder. Now i could start loading alsa modules. But before it i edited /etc/modprobe.d/blacklist.conf like that:
blacklist snd_hda_nvidia
blacklist snd_emu10k1
blacklist snd_hda_intel
blacklist snd_hda_codec
blacklist snd_pcm
blacklist snd_hda_controller
blacklist snd_cmipci
blacklist snd_timer
blacklist snd_opl3_lib
blacklist snd_hda_codec_generic
#blacklist snd_seq_device
blacklist snd_util_mem
blacklist snd_ac97_codec
blacklist ac97_bus
blacklist snd_hwdep
blacklist snd_pcm
#blacklist snd_usb_audio

Now:
modprobe snd-usb-audio && modprobe snd-seq-device && modprobe snd_seq_midi && a2jmidid -e
and my midi keyboard magically appeared in patchage! And midi input works!!!

TO DO: How to make these 3 alsa modules load at boot?

Bad news # I: If i start musescore its jack-midi IOs are shown in patchage normally but if i load any mscore file, mscore box disappears in patchage! I remember i had the same problem while testing oss+jackd1 on debian.
I can't figure out why this happens...
Some possible workaround is to try to use denemo instead of mscore. I will try it later.

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: oss4 not compilable on gentoo

Postby igorzwx » Sat Aug 22, 2015 12:50 am

ossuserr wrote:Now:

Code: Select all

# modprobe snd-usb-audio && modprobe snd-seq-device && modprobe snd_seq_midi && a2jmidid -e

and my midi keyboard magically appeared in patchage! And midi input works!!!

TO DO: How to make these 3 alsa modules load at boot?


You can modify the soundon script:

1. Disable the removal of ALSA modules → _http://www.opensound.com/forum/viewtopic.php?f=3&t=5801&start=15#p21194

2. Add to the soundon script:

Code: Select all

modprobe snd-usb-audio && modprobe snd-seq-device && modprobe snd_seq_midi && a2jmidid -e


See also: _http://www.opensound.com/forum/viewtopic.php?f=3&t=5204&p=19271

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: oss4 not compilable on gentoo

Postby ossuserr » Sat Aug 22, 2015 1:28 am

a2jmidid -e should not be added into soundon script because this command can be executed only after jackd is started.

We can try as follows i suppose:
modprobe snd-usb-audio && modprobe snd-seq-device && modprobe snd_seq_midi
jackd -vv -d oss -p1024 -r48000 -n2
wait 3
a2jmidid -e

Is this correct?

Otherwise, we may add a2jmidid -e into NSM. And start NSM with jackd at once by:
(jackd -vv -d oss -p1024 -r48000 -n2 &); (non-session-manager &)

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: oss4 not compilable on gentoo

Postby igorzwx » Sat Aug 22, 2015 8:49 am

Yes. You do not need to start jackd with the soundon script.

When everything works, check which ALSA modules are loaded:

Code: Select all

$ lsmod | grep snd


Then, you may better delete all those ALSA modules, which you do not need.
If they do not exist, they cannot be loaded.
It is supposed that you have a copy of all your ALSA modules.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: oss4 not compilable on gentoo

Postby ossuserr » Sat Aug 22, 2015 10:02 am

So it's a success now.

I left only

Code: Select all

modprobe snd-usb-audio && modprobe snd-seq-device && modprobe snd_seq_midi

string before 'exit 0' in the soundon script.

/etc/modprobe.d/blacklist.conf is like that:

Code: Select all

blacklist snd_hda_nvidia
blacklist snd_emu10k1
blacklist snd_hda_intel
blacklist snd_hda_codec
blacklist snd_pcm
blacklist snd_hda_controller
blacklist snd_cmipci
blacklist snd_timer
blacklist snd_opl3_lib
blacklist snd_hda_codec_generic
#blacklist snd_seq_device
blacklist snd_util_mem
blacklist snd_ac97_codec
blacklist ac97_bus
blacklist snd_hwdep
blacklist snd_pcm
#blacklist snd_usb_audio


Soundon script is also modified as you indicated.

Code: Select all

if test -d /proc/asound || grep -q '^ *14 ' < /proc/devices
then
   if ! sh $OSSLIBDIR/scripts/remove_drv.sh>> $LOG
   then
      echo Failed to disable conflicting sound drivers >> $LOG
      echo Failed to disable conflicting sound drivers
      echo Reboot and try running soundon again
      echo
      echo Also check that you have not compiled sound support statically
      echo into the kernel.
      exit 50
   fi
fi

replaced by

Code: Select all

if test -d /proc/asound || grep -q '^ *14 ' < /proc/devices
then
#   if ! sh $OSSLIBDIR/scripts/remove_drv.sh>> $LOG
#   then
#      echo Failed to disable conflicting sound drivers >> $LOG
#      echo Failed to disable conflicting sound drivers
#      echo Reboot and try running soundon again
#      echo
#      echo Also check that you have not compiled sound support statically
#      echo into the kernel.
#      exit 50
#   fi
   lsmod | grep snd
fi


Now on booting both oss and needed alsa midi modules are loaded.
lsmod shows:

Code: Select all

$ lsmod | grep snd
snd_seq_midi            4876  0
snd_seq_midi_event      6404  1 snd_seq_midi
snd_seq                51359  2 snd_seq_midi_event,snd_seq_midi
snd_usb_audio         153770  0
snd_usbmidi_lib        21282  1 snd_usb_audio
snd_hwdep               6272  1 snd_usb_audio
snd_rawmidi            20148  2 snd_usbmidi_lib,snd_seq_midi
snd_seq_device          6669  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_pcm                90705  1 snd_usb_audio
snd_timer              20703  2 snd_pcm,snd_seq
snd                    66322  8 snd_usb_audio,snd_hwdep,snd_timer,snd_pcm,snd_seq,snd_rawmidi,snd_usbmidi_lib,snd_seq_device
soundcore               6563  1 snd


I made an alias to start jackd with nsm, a2jmidid -e is started by nsm:

Code: Select all

vi ~/.bash_aliases

Added string:

Code: Select all

(jackd -vv -d oss -p1024 -r48000 -n2 &); (non-session-manager &)


Save and close vi
Now:

Code: Select all

source ~/.bashrc

Now I can start jackd and nsm at once by issuing command 'nsm' in a terminal. Nsm has an added a2jmidid client with the command a2jmidid -e If you don't know how to add clients to nsm, read the manuals about nsm. If you don't want to use nsm, you may run a2jmidid -e separately after running jackd by one command:

Code: Select all

(jackd -vv -d oss -p1024 -r48000 -n2 &); (sleep 3) ; (a2jmidid -e &)


The same way you can run many applications at once:

Code: Select all

(jackd -vv -d oss -p1024 -r48000 -n2 &); (sleep 3) ; (a2jmidid -e &) ; (application2 &) ; (application3 &) ; (and so on &)


Of course you can create an alias for such a long command in ~/.bash_aliases the way described above.

Musescore does not work with jackd1+oss :( I remember it worked with jackd1+alsa. So i suspect the cause is not jackd version but lack of support of oss by musescore.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: oss4 not compilable on gentoo

Postby ossuserr » Sat Aug 22, 2015 10:17 pm

Bad news #2 and 3.
Besides that mscore does not work with oss+jackd1, Linuxsampler+Fantasia fail too. The problem is that i load a preset of about 20 channels into Fantasia but only about half of them appear in patchage. I remember i had the same problem while testing oss+jackd1 on debian. All this makes OSS not usable for music making. Sorry, Igor, it's the bitter truth. As far as i understood OSS initially was a good idea like free professional quality sound for everyone but probably due to efforts of corporations it was freezed and changed by alsa.
So no only linuxsampler is not usable on OSS+jackd1 but dssi-vst does not work either which means you won't be able to use a lot of beautiful vst instruments like for example truepianos, spicyquitar, etc...

And the most bitter thing is explained by an ardor guy. Linux guy on ardor channel explained that nowadays OSS does not provide higher quality than alsa. Let me quote:
it gives the exact same sound as ALSA. it's a blocking API (though v4 also introduced some callback method). you'll have less control over the interface and larger latency. besides, linux only supports a OSS compatibility layer these days. you'll basically use OSS -> ALSA -> soundcard
OSS support itself was removed a few years back. -- so unless you patch your kernel, which sounds like some typical gentoo thing to do.., it adds nothing.
OSS suppoers in kernel mixing, but since in the linux kernel not floating-point maths is allowed it's done using integer maths. That's definitly a loss (though maybe not an audible one).
me : may be you can create a new oss-oriented kernel?
The guy: there is no motivation to do that. OSS support these days is mainly for legacy applications (pre 2002) which have not been updated.
That's also why jack1 (which goes back to 1999 has OSS support) but jack2 which was created later does not.
Any float operation requires a register save/restore. Doing that introduces a major overhead and hence linux does not allow it in the kernel.
What jack uses under the hood.. is a different story because the linux kernel and no linux-kernel modules are allowed to use floating point maths. alsa uses a userspace library for that.

So in order to get the benefits from OSS driver on linux, Igor, you must fisrt patch your kernel to get that float point math support. But since you are using deb based linux OS i think you have never ever patched your kernel. I personnaly did not like the way to recompile kernels for debian. All of them did not work well. On gentoo recompiling kernels is not a problem.
So since your kernel was not patched all the benefits from OSS sound was pure placebo? Of course there are differences in sound due to different default sound volume levels which could make you think that OSS sounds better.

Since i need to compose music i have to return to ALSA because jackd2 is needed for LS. dssi-vst and musescore. However if you find the patch for kernel to support float point maths i can test it.
I suppose the benefits you heard with OSS were due to petrov's resampler but not due to OSS itself.
If you have any counterarguments please share them.

Another ALSA guy told that alsa uses its resampler only when the file's samplerate is not supported by the soundcard, in all other cases there is no resampling and quality depends on dac of the soundcard.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: oss4 not compilable on gentoo

Postby ossuserr » Sat Aug 22, 2015 10:27 pm

That guy was right:
_https://www.kernel.org/doc/Documentation/HOWTO
"The kernel is written using GNU C and the GNU toolchain. While it
adheres to the ISO C89 standard, it uses a number of extensions that are
not featured in the standard. The kernel is a freestanding C
environment, with no reliance on the standard C library, so some
portions of the C standard are not supported. Arbitrary long long
divisions and floating point are not allowed."

So, linux kernel is a crap. Linux is not music oriented OS. damn!

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: oss4 not compilable on gentoo

Postby ossuserr » Sat Aug 22, 2015 10:33 pm

To the same matter:

"I am reading Robert Love's "Linux Kernel Development", and I came across the following passage:

No (Easy) Use of Floating Point

When a user-space process uses floating-point instructions, the kernel manages the transition from integer to floating point mode. What the kernel has to do when using floating-point instructions varies by architecture, but the kernel normally catches a trap and then initiates the transition from integer to floating point mode.

Unlike user-space, the kernel does not have the luxury of seamless support for floating point because it cannot easily trap itself. Using a floating point inside the kernel requires manually saving and restoring the floating point registers, among other possible chores. The short answer is: Don’t do it! Except in the rare cases, no floating-point operations are in the kernel."

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: oss4 not compilable on gentoo

Postby igorzwx » Sat Aug 22, 2015 11:31 pm

ossuserr wrote:And the most bitter thing is explained by an ardor guy. Linux guy on ardor channel explained that nowadays OSS does not provide higher quality than alsa...
it gives the exact same sound as ALSA.
besides, linux only supports a OSS compatibility layer these days. you'll basically use OSS -> ALSA -> soundcard
OSS support itself was removed a few years back. -- so unless you patch your kernel, which sounds like some typical gentoo thing to do.., it adds nothing.


Is it your new "conspiracy theory"?
It seems that Ardor can cause a kind of "mental disorder".

OSS compatibility
If you want OSS applications to work with dmix, install the alsa-oss package as well. Then load the kernel modules snd_seq_oss, snd_pcm_oss and snd_mixer_oss to enable OSS emulation.
_https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#OSS_compatibility


The kernel modules snd_seq_oss, snd_pcm_oss, snd_mixer_oss, and all other ALSA modules are usually deleted by OSS4, so what the problem is?

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: oss4 not compilable on gentoo

Postby ossuserr » Sat Aug 22, 2015 11:33 pm

me: Windows kernel support float-point?
yes, it's also C++ to begin with
really there is no real need to support floaing point *in the kernel*. when you mix audio, using floating point maths offers huge advantages (compared to integer maths). it can't clip, there's no aliasing. no limited dynamic range, all pro-audio workstations and tools use float these days. ALSA does not support mixing in the kernel (concurrent access by different programs) because of this. libalsa (userspace) does support it.

igorzwx
Known Member
Posts: 1262
Joined: Sun Jun 28, 2009 9:31 pm

Re: oss4 not compilable on gentoo

Postby igorzwx » Sat Aug 22, 2015 11:43 pm

ossuserr wrote:me: Windows kernel support float-point?
yes, it's also C++ to begin with
really there is no real need to support floaing point *in the kernel*. when you mix audio, using floating point maths offers huge advantages (compared to integer maths). it can't clip, there's no aliasing. no limited dynamic range, all pro-audio workstations and tools use float these days. ALSA does not support mixing in the kernel (concurrent access by different programs) because of this. libalsa (userspace) does support it.


Although ALSA/Linux does not support "pro-audio", it can be used for mass production of "digital crap" for semi-deaf audiophiles.

However, OSS4 supports "pro-audio" hardware mixing with professional souncards, such as LynxTwo.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: oss4 not compilable on gentoo

Postby ossuserr » Sat Aug 22, 2015 11:50 pm

I am afraid that thia guy is right and you are wrong. Have you ever recompiled a kernel? Install gentoo and try. First, you will find out that all OSS strings in the kernel are depricated and even not required to install OSS which yes proves that THERE IS NO IN-KERNEL FLOATPOINT MIXING NOWAdays BY OSS. OSS only supports floatpoint data but not floatpoint kernel mixing since LINUX KERNEL doesn't support floatpoint. And since linux kernel is integer and adapted to alsa, oss has no benefits and really may work via inkernel alsa compatibility layer since kernel is adapted to alsa.
It's not me who makes conspiracy theories. May be it's you who are the ju troll or just a crazy person. Or you just dont understand how linux is constructed.


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 88 guests