oss4 not compilable on gentoo

OSS specific Linux discussion (x86/amd64)

Moderators: dev, hannu, cesium

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 » Thu Aug 20, 2015 7:53 pm

damn those patches. still don't understand how to apply that specific patch because gcc should be located in some system folder but not in oss installation folder.

However, I managed to install oss from funtoo portage. AND it works as osstest has shown. I could switch on production quality in ossxmix.

If i switch off cooked_mode will vmix still continue to work? I need vmix for jackd things.

Here is the manual to install OSS4 on Gentoo:

Code: Select all

install -d /root/git && cd /root/git && git clone git://github.com/funtoo/funtoo-overlay.git

Code: Select all

mv /root/git /var/db/


Code: Select all

vi /etc/portage/repos.conf/gentoo.conf


Put there as follows:

Code: Select all

[funtoo-overlay]
location = /var/db/git/funtoo-overlay
sync_type = git


Now:

Code: Select all

USE="oss_cards_cmi878x oss_cards_cmpci -pax_kernel oss_cards_emu10k1x oss_cards_sblive" emerge -av oss


Note that pax_kernel is disabled, otherwise i could not compile it.

Code: Select all

vi /etc/portage/package.mask

and paste this:

Code: Select all

*/*::funtoo-overlay


Code: Select all

vi /etc/portage/package.unmask

and paste this:

Code: Select all

media-sound/oss*


I have not uninstalled alsa to have alsa midi input but i have blacklisted modules conflicting with oss:

Code: Select all

vi /etc/modprobe.d/blacklist.conf


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


I have not yet checked if alsa midi input works. I disabled oss usb midi in /etc/oss4/installed_drivers by removing the string specifying usb midi.

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

Re: oss4 not compilable on gentoo

Postby igorzwx » Thu Aug 20, 2015 9:22 pm

ossuserr wrote:If i switch off cooked_mode will vmix still continue to work? I need vmix for jackd things.


Yes. VMIX can work without the "cooked mode".
The "cooked mode" can be disabled in /usr/lib/oss/conf/osscore.conf
Then you have to reload OSS.

ossuserr wrote:I have not uninstalled alsa to have alsa midi input but i have blacklisted modules conflicting with oss


The most reliable method of "blacklisting" is complete removal.
You can simply remove those ALSA modules, which may conflict with your OSS4 drivers.
Or, you may better remove all those ALSA modules, which you do not need.
It is supposed that you have a copy of your ALSA drivers.

Code: Select all

$ rm --help
Usage: rm [OPTION]... FILE...
Remove (unlink) the FILE(s).

  -f, --force           ignore nonexistent files, never prompt
  -i                    prompt before every removal
  -I                    prompt once before removing more than three files, or
                          when removing recursively.  Less intrusive than -i,
                          while still giving protection against most mistakes
      --interactive[=WHEN]  prompt according to WHEN: never, once (-I), or
                          always (-i).  Without WHEN, prompt always
      --one-file-system  when removing a hierarchy recursively, skip any
                          directory that is on a file system different from
                          that of the corresponding command line argument
      --no-preserve-root  do not treat `/' specially
      --preserve-root   do not remove `/' (default)
  -r, -R, --recursive   remove directories and their contents recursively
  -v, --verbose         explain what is being done
      --help     display this help and exit
      --version  output version information and exit

By default, rm does not remove directories.  Use the --recursive (-r or -R)
option to remove each listed directory, too, along with all of its contents.

To remove a file whose name starts with a `-', for example `-foo',
use one of these commands:
  rm -- -foo

  rm ./-foo

Note that if you use rm to remove a file, it might be possible to recover
some of its contents, given sufficient expertise and/or time.  For greater
assurance that the contents are truly unrecoverable, consider using shred.


Before experimenting with ALSA drivers, you may want to read some "howtos":
1. _http://www.opensound.com/forum/viewtopic.php?f=3&t=5204&p=19271
2. _http://www.opensound.com/forum/viewtopic.php?f=3&t=5801#p21168

ossuserr wrote:damn those patches. still don't understand how to apply that specific patch because gcc should be located in some system folder but not in oss installation folder.


It was a patch for OSS4, not for gcc.
You are not supposed to recompile gcc.
More precisely, it was a patch for OSS4, which makes OSS4 compatible with GCC 5.

os_linux.h is inside the folder /kernel/OS/Linux/ (source code of OSS4)
You can open it with a text editor and correct something, according to the "patch" _http://www.opensound.com/forum/viewtopic.php?f=3&t=5800#p21152
See also: _https://en.wikipedia.org/wiki/Diff_utility

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 12:47 am

The trick in my previous post in this topic to disable funtoo-overlay for all other packs except for oss, namely string */*::funtoo-overlay in /etc/portage/package.mask seems to not work because when i tried to recompile all packs with oss USE flag ON many lines were printed about 3 or 4 packs from funtoo-overlay having no connection to oss driver pack. So it's better to comment out|disable the mentioned 3 strings in file /etc/portage/repos.conf/gentoo.conf after installing oss. Untill the working solution is found I will keep those lines disabled all the time unless I want to check if a new version of oss driver is available,in which case i will make git pull from /var/db/git folder to update funtoo-overlay and then 3 strings must be enabled again to emerge oss again for upgrading.

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 11:14 am

I have disabled cooked mode and issued soundoff command for reloading. But when i issued soundon the command is not completing and its execution is hanging. I Killed the terminal window and issued soundon again in a new window just to get this:
soundon
Previous start of OSS crashed the system
Please resolve the situation and remove file
"/usr/lib/oss/starting". Then start OSS by
running soundon again.

Olrite, i deleted the file /usr/lib/oss/starting and issued soundon again. But the same problem persists. Execution is not completing. I suspect that alsa modules may interfere. Perhaps it's a good idea to move them to some other place to backup thus accomplishing the same task as removal. In which folder are those modules stored and what's their extension?

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 12:48 pm

ossuserr wrote:I have disabled cooked mode and issued soundoff command for reloading. But when i issued soundon the command is not completing and its execution is hanging. I Killed the terminal window and issued soundon again in a new window just to get this:

Code: Select all

# soundon
Previous start of OSS crashed the system
Please resolve the situation and remove file
"/usr/lib/oss/starting". Then start OSS by
running soundon again.


Olrite, i deleted the file /usr/lib/oss/starting and issued soundon again. But the same problem persists. Execution is not completing. I suspect that alsa modules may interfere. Perhaps it's a good idea to move them to some other place to backup thus accomplishing the same task as removal. In which folder are those modules stored and what's their extension?


Post here the output of these commands:

Code: Select all

$ dmesg | grep oss

Code: Select all

$ dmesg | grep osscore


The simplest way to remove ALSA modules, is to load one ALSA module, and, then, start OSS4

Code: Select all

$ sudo modprobe soundcore
$ sudo soundon


You may want to read this: _http://www.opensound.com/forum/viewtopic.php?f=3&t=5204&p=19271

ALSA modules are not difficult to find:

Code: Select all

$ cd /lib/modules/$(uname -r)/kernel/sound
$ ls -1
ac97_bus.ko
core
drivers
firewire
i2c
isa
pci
pcmcia
soc
soundcore.ko
synth
usb


You may also try to disable "production quality" and/or VMIX

Since, you can always re-install OSS4, it makes sense to make some experiments in order to find out the true cause of crashes.

If OSS4 continues to crash, you may simply delete the folder /usr/lib/oss/
and re-install OSS4.

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 3:25 pm

I have searched through /lib/modules/$(uname -r)/ recursively to find .ko files by find ./ -print|grep -i .ko and to my surprise i found no alsa modules at all! I either do not have kernel/sound folder. I wonder what happened to alsa since i did not uninstall it. I suspect that since alsa modules were blacklisted in modprobe.d/blacklist.conf they were not loaded at boot into /lib/modules/... folder from some other place if of course such place exists. I issued commands as follows:

aplay -l
aplay: device_list:268: no soundcards found...

# amidi -l
no sound card found

# arecordmidi -l
ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.0.29/work/alsa-lib-1.0.29/src/seq/seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
Cannot open sequencer - No such file or directory

Now i strongly hezitate about that i will have a usb midi input via alsa modules.

The problem about soundon resolved by itself. I had xfce4-mixer which somehow blocked oss from starting I suspect. I killed the xfce4-mixer process, then had meal, returned and did soundon again. This time it worked!

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 5:48 pm

During installation of oss driver the wrong card Cmedia was assigned to dsps. It caused the fact that Cmedia was used to playback everything. I figured out that i should resymlink /dev/dsp to sblive(audigy2) to make it be used for playback. I did it by 2 commands:
ln -sf /dev/oss/oss_sblive0/pcm0 /dev/dsp
ossdevlinks

But what about other pcm devices? ossinfo -v9 | grep "/dev/oss" shows:
Device file /dev/oss/oss_sblive0/mid0, Legacy device /dev/midi00
Device file /dev/oss/oss_cmpci0/mix0, Legacy device /dev/mixer0
Device file /dev/oss/oss_sblive0/mix0, Legacy device /dev/mixer1
CMedia CM8768 (rev 68) /dev/oss/oss_cmpci0/pcm0 (device index 0)
CMedia CM8768 (playback only) /dev/oss/oss_cmpci0/pcm1 (device index 1)
SB Audigy2 main /dev/oss/oss_sblive0/pcm0 (device index 2)
SB Audigy2 front out /dev/oss/oss_sblive0/pcm1 (device index 3)
SB Audigy2 front out /dev/oss/oss_sblive0/pcm2 (device index 4)
SB Audigy2 front out /dev/oss/oss_sblive0/pcm3 (device index 5)
SB Audigy2 raw S/PDIF (output only) /dev/oss/oss_sblive0/pcm4 (device index 6)
/dev/dsp -> /dev/oss/oss_sblive0/pcm0
/dev/dsp_in -> /dev/oss/oss_cmpci0/pcm0
/dev/dsp_out -> /dev/oss/oss_cmpci0/pcm0
/dev/dsp_ac3 -> /dev/oss/oss_cmpci0/pcm0
/dev/dsp_mmap -> /dev/oss/oss_cmpci0/pcm0
/dev/dsp_multich -> /dev/oss/oss_cmpci0/pcm0
/dev/dsp_spdifout -> /dev/oss/oss_cmpci0/pcm0
/dev/dsp_spdifin -> /dev/oss/oss_cmpci0/pcm0

I want to completely remap all dsps to audigy's pcms instead of cmedia's. But which dsps correspond to which audigy's pcms?

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 6:06 pm

ossuserr wrote:I want to completely remap all dsps to audigy's pcms instead of cmedia's.


You may try this:
Changing the default sound output
1. ...
2. ...
3. Alternative: $OSSLIBDIR/etc/installed_drivers influences the order of sound cards set by ossdetect. By removing other devices or moving the desired sound card to the first place, the default device can be modified. After the change, restart OSS and run "sudo ossdevlinks -v -r" and it will relink /dev/dsp for you.
_http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output


ossuserr wrote:I have searched through /lib/modules/$(uname -r)/ recursively to find .ko files by find ./ -print|grep -i .ko
and to my surprise i found no alsa modules at all!

I either do not have kernel/sound folder.


Code: Select all

$ find /lib -name sound\*.*
/lib/modules/3.5.0-25-generic/kernel/sound/soundcore.ko
/lib/modules/3.5.0-17-generic/kernel/sound/soundcore.ko


Code: Select all

$ find /lib -name snd\*.*
/lib/modules/3.5.0-25-generic/kernel/sound/synth/snd-util-mem.ko
/lib/modules/3.5.0-25-generic/kernel/sound/synth/emux/snd-emux-synth.ko
/lib/modules/3.5.0-25-generic/kernel/sound/firewire/snd-firewire-speakers.ko
/lib/modules/3.5.0-25-generic/kernel/sound/firewire/snd-firewire-lib.ko
....


ossuserr wrote:I wonder what happened to alsa


You may want to read this: _http://www.opensound.com/forum/viewtopic.php?f=3&t=5204&p=19271

Do you have sound-preoss.tar.bz2 ?
It might be inside /lib/modules/$(uname -r)

You may try find sound-preoss.tar.bz2:

Code: Select all

$ find /lib -name sound-preoss\*.*

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 7:09 pm

Strange, i removed cmedia card string from installed_deviced and issued ossdevlinks -v -r
but instead of linking all dsps to audigy's pcms, it linked everything to cmedia, even the /dev/dsp which i had linked to audigy manually before...

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 7:15 pm

ossuserr wrote:Strange, i removed cmedia card string from installed_deviced and issued ossdevlinks -v -r
but instead of linking all dsps to audigy's pcms, it linked everything to cmedia, even the /dev/dsp which i had linked to audigy manually before...


You may read that once more:

After the change, restart OSS and run "sudo ossdevlinks -v -r" and it will relink /dev/dsp for you.
_http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output

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 7:59 pm

I think i did soundoff, then tried to relink but it told that /dev/mixer was missing and did not relink anything, then i did soundon and tried to relink but it relinked that wrong way to cmedia. I solved the problem by recompiling oss driver but this time with USE flag only for sblive and audigy cards. Then i issued ossdevlinks -v -r and now it's linked to sblive correctly. Anyway that cmedia must give a low-quality sound and i would not use it.

My next question is 'Is it possible to route everything from front channel (fronts output of soundcard) to rear channel (rear out) because i want to plug headphones into rear-out and hear the same what comes from speakers connected to front-out.

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 8:26 pm

ossuserr wrote:i want to plug headphones into rear-out and hear the same what comes from speakers connected to front-out.


With Intel HDA codec, you can set the "rear" jack to "front".
This can be done with "ossxmix".

I have 3 jacks on the "rear panel" (green, pink, and blue);
and 2 jacks on the "front panel" (fp-green and fp-pink).
They all can be configured for "front", or "input", or else.

Post here the output of this command:

Code: Select all

$ ossmix

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 9:24 pm

Code: Select all

$ ossmix
Selected mixer 0/SB Audigy2 (STAC9721)
Known controls are:
line [<leftvol>:<rightvol>] (currently 32:32)
line.rec ON|OFF (currently ON)
mic <monovol> (currently 0)
mic.rec ON|OFF (currently OFF)
cd [<leftvol>:<rightvol>] (currently 75:75)
cd.rec ON|OFF (currently OFF)
igain [<leftvol>:<rightvol>] (currently 75:75)
aux1 [<leftvol>:<rightvol>] (currently 32:32)
aux1.rec ON|OFF (currently OFF)
phone [<leftvol>:<rightvol>] (currently 0:0)
phone.rec ON|OFF (currently OFF)
autorese ON|OFF (currently OFF)
spkmode <FRONT|SURR|FRONT+SURR|DISCRETE> (currently FRONT)
pcm.main <monovol> (currently 100)
vmix0-enable ON|OFF (currently ON)
vmix0-rate <decimal value> (currently 48000) (Read-only)
vmix0-src <Fast|High|High+|Production|OFF> (currently Fast)
vmix0-outvol <monovol> (currently 25.0 dB)
vmix0-invol <monovol> (currently 25.0 dB)
vmix0.pcm1 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm2 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm3 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm4 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
pcm2 [<leftvol>:<rightvol>] (currently 100:100)
vol [<leftvol>:<rightvol>] (currently 65:65)
equalizer.prescale <monovol> (currently 100)
equalizer.lo <monovol> (currently 128)
equalizer.mid <monovol> (currently 128)
equalizer.hi <monovol> (currently 128)
equalizer.xhi <monovol> (currently 128)
equalizer.bypass ON|OFF (currently ON)
front.spdif <monovol> (currently 100)
front.digcd <monovol> (currently 100)
front.ac97 <monovol> (currently 0)
front.pcm <monovol> (currently 100)
front.aux <monovol> (currently 100)
front.mic <monovol> (currently 100)
front.vol [<leftvol>:<rightvol>] (currently 100:100)
surr.spdif <monovol> (currently 0)
surr.digcd <monovol> (currently 0)
surr.ac97 <monovol> (currently 0)
surr.pcm <monovol> (currently 100)
surr.aux <monovol> (currently 0)
surr.mic <monovol> (currently 100)
surr.vol [<leftvol>:<rightvol>] (currently 100:100)
record.spdif <monovol> (currently 100)
record.digcd <monovol> (currently 100)
record.ac97 <monovol> (currently 100)
record.pcm <monovol> (currently 75)
record.aux <monovol> (currently 100)
record.mic <monovol> (currently 0)
record.vol [<leftvol>:<rightvol>] (currently 100:100)

Well audigy2 zs platinum has rear out, center-sub out, side out. Strangely, ossxmix shows only front, no rear, no side, no center\sub. However i have found that phone-out on the external module of the soundcard (in dvd slot) works. So i can do without routing front to rear-out though it would be more high quality than using external module.

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 9:51 pm

You may try to change this:

Code: Select all

spkmode <FRONT|SURR|FRONT+SURR|DISCRETE> (currently FRONT)


The "spkmode" setting selects how front/rear speakers are used for PCM playback (outputs from programs using /dev/dsp#).
The possible settings are FRONT, REAR and FRONT+REAR.
The default is FRONT+REAR.
Change this setting if you like to get PCM playback only from front or rear speakers.
The "autoreset" flag is used to control the "/dev" section.
_http://manuals.opensound.com/usersguide/oss_sblive.html


Code: Select all

autorese ON|OFF (currently OFF)


If you want to get PCM playback from both front and rear speakers,
you may try something like this:

EXAMPLE: A command to change mixer settings (it may do what you want):

Code: Select all

$ ossmix spkmode FRONT+SURR


You can also use OSS Mixer GUI:

Code: Select all

$ ossxmix


Start OSS Mixer GUI in background:

Code: Select all

$ ossxmix -b

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:28 pm

Thanks, will try that later. Now i have new pleasant important news. I managed to install jack-audio-connection-kit-1 which supports OSS. How to install it:
1. If you don't have proaudio layer add it:
layman -a proaudio
2. Install jack:
emerge -av =jack-audio-connection-kit-1.9999

Beware that jack-audio-connection-kit-1 fails to compile from ::gentoo portage. That's why proaudio was needed.

Now set excl_policy=2 in /usr/lib/oss/conf/osscore.conf
Restart oss: soundoff && soundon
Now you may start jackd: jackd -vv -d oss -p1024 -r48000 -n2

Pleasant important news # II - Non-session-manager works!!! And all connections made are remembered and restored, amazing!!!
Of course since a2jmidid could not start because alsa modules are not loaded some connections, namely midi ones, could not be restored by non-session-manager (NSM). I don't have midi input either... All the rest midi connections are observed, for example to lv2 plugins loaded via jalv.gtk, to linuxsampler, to and from musescore.

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.

Nsm is the perfect tool to remember jackd1 connections. THUS jackd2, carla and other ALSA-ORIENTED software capable of remembering jack connections but spoiling sound ARE NOT NEEDED AND YOU CAN HAPPILY EMPLOY OSS AND REMEMBER JACKD1 CONNECTIONS THANKS TO NSM. We can say it's our big victory over sound-spoiling software and dark forces standing behind it. It means revival of OSS driver. Only activating midi input is left to do.
Another good program to use with NSM is non-mixer. May be some day i will explain how to achieve 3d sound ambisonics positioning using non-mixer and jconvolver. Non-mixer is a good and powerful tool to use in your sound chain.

Good news # III. Denemo program which is the direct rival of mscore, finale and sibelius is to get sustain support within the nearest days according to its developer. All this hints that soon we will have the most convenient software for composing + best oss-based sound.


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 96 guests