Are audio plugins(ie. LADSPA alike) supported by OSS?

OSS specific Linux discussion (x86/amd64)

Moderators: hannu, dev, kodachi, cesium

Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby bearson » Thu Apr 29, 2010 2:32 pm

I notice that I can create audio plugins easily in ALSA, for example, add a pseudo device which applys a delay effect to the sound.

For example, delay 5s in ALSA conf:
Code: Select all
pcm.delay {
   type ladspa
   slave.pcm "default";
   #alternatively, "plughw:0.0", etc...
   path "/usr/lib/ladspa";
   plugins [
      {
         label delay_5s
         input {
            controls {
               0 0.2
               1 0.3
            }
         }
      }
   ]
}


Then "pcm.delay" is a device where sound sent in will appliy delay 5sec effect.

I wonder if OSS has a similar API or could I do similar things using OSS ?
I have read some OSS references. No clear clues have been found.
Last edited by bearson on Thu Apr 29, 2010 3:52 pm, edited 1 time in total.
bearson
 
Posts: 12
Joined: Thu Apr 29, 2010 2:04 pm

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby igorzwx » Thu Apr 29, 2010 2:58 pm

bearson wrote:I notice that I can create audio plugins() easily in ALSA, for example, add a pseudo device which applys a delay effect to the sound.

For example, delay 5s in ALSA conf:
Code: Select all
pcm.delay {
   type ladspa
   slave.pcm "default";
   #alternatively, "plughw:0.0", etc...
   path "/usr/lib/ladspa";
   plugins [
      {
         label delay_5s
         input {
            controls {
               0 0.2
               1 0.3
            }
         }
      }
   ]
}


Then "pcm.delay" is a device where sound sent in will appliy delay 5sec effect.

I wonder if OSS has a similar API or could I do similar things using OSS ?
I have read some OSS references. No clear clues have been found.


You may try ALSA emulation
http://wiki.archlinux.org/index.php/OSS

Although, of course, ALSA emulation and "sound effects" may surely reduce sound quality.
igorzwx
 
Posts: 863
Joined: Sun Jun 28, 2009 9:31 pm

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby bearson » Thu Apr 29, 2010 3:22 pm

@igorzwx

I have noticed that workaround.
I choose OSS4 mainly because it has higher quality audio output and lower CPU usage compared with ALSA on my laptop. Thus, I am not willing to sacrifice audio quality, nor unnecessary CPU resource.


Is there any way to create a pseudo device ?
If yes, does it must be implemented in kenel space ?
bearson
 
Posts: 12
Joined: Thu Apr 29, 2010 2:04 pm

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby igorzwx » Thu Apr 29, 2010 3:29 pm

bearson wrote:@igorzwx

I have noticed that workaround.
I choose OSS4 mainly because it has higher quality audio output and lower CPU usage compared with ALSA on my laptop. Thus, I am not willing to sacrifice audio quality, nor unnecessary CPU resource.


Is there any way to create a pseudo device ?
If yes, does it must be implemented in kenel space ?


There is a kind of shamanism of the sort
viewtopic.php?f=3&t=3576#p14257

You may better ask Cesium
igorzwx
 
Posts: 863
Joined: Sun Jun 28, 2009 9:31 pm

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby bearson » Thu Apr 29, 2010 3:52 pm

igorzwx wrote:There is a kind of shamanism of the sort
viewtopic.php?f=3&t=3576#p14257

You may better ask Cesium

Thanks for your reply. Things seem to be promising.
Looking forward for Cesium's reply on this post :D
bearson
 
Posts: 12
Joined: Thu Apr 29, 2010 2:04 pm

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby cesium » Thu Apr 29, 2010 5:35 pm

OSS runs entirely in kernel so it's nowhere as easy. The closest is oss_userdev driver, but you'll need to write a server (compare udserver example, e.g. if it writes to soundcard instead of server_fd). oss_audioloop is simpler (like a named pipe), but less fitting here (client must use exact same format/chan as the server). Both of these drivers have manpages ("oss_userdev" and "oss_audioloop" respectively).
cesium
 
Posts: 896
Joined: Sun Aug 12, 2007 12:51 am

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby bearson » Thu Apr 29, 2010 6:09 pm

cesium wrote:OSS runs entirely in kernel so it's nowhere as easy. The closest is oss_userdev driver, but you'll need to write a server (compare udserver example, e.g. if it writes to soundcard instead of server_fd). oss_audioloop is simpler (like a named pipe), but less fitting here (client must use exact same format/chan as the server). Both of these drivers have manpages ("oss_userdev" and "oss_audioloop" respectively).

Thanks for the information!
I will try oss_userdev later :)
bearson
 
Posts: 12
Joined: Thu Apr 29, 2010 2:04 pm

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby Temüjin » Thu Apr 29, 2010 11:11 pm

Wouldn't it be better to use gstreamer, which already has support for slv2?
Temüjin
 
Posts: 84
Joined: Tue Jul 24, 2007 7:55 pm
Location: Pennsylvania, USA

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby bearson » Fri Apr 30, 2010 2:49 am

Temüjin wrote:Wouldn't it be better to use gstreamer, which already has support for slv2?

gstreamer is a library, mainly to decode media.
It is not responsible for how to output audio via hardware like ALSA/OSS.

I plan to apply some simple audio effects globally, so gstreamer is not suitable here I think.
bearson
 
Posts: 12
Joined: Thu Apr 29, 2010 2:04 pm

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby igorzwx » Fri Apr 30, 2010 12:39 pm

bearson wrote:
Temüjin wrote:Wouldn't it be better to use gstreamer, which already has support for slv2?

gstreamer is a library, mainly to decode media.
It is not responsible for how to output audio via hardware like ALSA/OSS.

I plan to apply some simple audio effects globally, so gstreamer is not suitable here I think.


You see, resampler is in the mixer (ossmix). You can enable "Production quality", for example.
Perhaps, the mixer might be hacked in a way to add effects.
We had already discussed this. The Russian hackers wanted to use their own resampler with OSS4.
That discussion resulted in nothing.
igorzwx
 
Posts: 863
Joined: Sun Jun 28, 2009 9:31 pm

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby bearson » Fri Apr 30, 2010 2:16 pm

igorzwx wrote:You see, resampler is in the mixer (ossmix). You can enable "Production quality", for example.
Perhaps, the mixer might be hacked in a way to add effects.
We had already discussed this. The Russian hackers wanted to use their own resampler with OSS4.
That discussion resulted in nothing.


Oh... this way is ugly. My opinion is that resampler is not always enabled (when input sample rate = output sample rate), thus these things should not be done in resampler...
bearson
 
Posts: 12
Joined: Thu Apr 29, 2010 2:04 pm

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby igorzwx » Fri Apr 30, 2010 5:32 pm

bearson wrote:
igorzwx wrote:You see, resampler is in the mixer (ossmix). You can enable "Production quality", for example.
Perhaps, the mixer might be hacked in a way to add effects.
We had already discussed this. The Russian hackers wanted to use their own resampler with OSS4.
That discussion resulted in nothing.


Oh... this way is ugly. My opinion is that resampler is not always enabled (when input sample rate = output sample rate), thus these things should not be done in resampler...


What is ugly? The real world is not one-dimensional.
There are many factors which affect sound quality, and to achieve the best possible result, you have to compromise and optimize.
igorzwx
 
Posts: 863
Joined: Sun Jun 28, 2009 9:31 pm

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby bearson » Fri Apr 30, 2010 5:54 pm

igorzwx wrote:What is ugly? The real world is not one-dimensional.
There are many factors which affect sound quality, and to achieve the best possible result, you have to compromise and optimize.


You're right.

Indeed, I want to try to implement a simple flexible scriptable DSP, something like Winamp SPS, maybe in lua (LuaJIT now seems promising).
Performance always conflicts with flexibility / portability.
If performance is not critical (for example, HD video decoding, or 3D game rendering), I perfer flexibility.
bearson
 
Posts: 12
Joined: Thu Apr 29, 2010 2:04 pm

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby igorzwx » Fri Apr 30, 2010 6:08 pm

bearson wrote:
igorzwx wrote:What is ugly? The real world is not one-dimensional.
There are many factors which affect sound quality, and to achieve the best possible result, you have to compromise and optimize.


You're right.

Indeed, I want to try to implement a simple flexible scriptable DSP, something like Winamp SPS, maybe in lua (LuaJIT now seems promising).
Performance always conflicts with flexibility / portability.
If performance is not critical (for example, HD video decoding, or 3D game rendering), I perfer flexibility.


Imagine that you can use plugins with vmix to add resamplers or effects.
The real problems with vmix is that you get overtones of 50Hz on cheap notebooks (such as Dell ones).
But the same is with any "software solutions".
vmix might be the least possible evil.
With ALSA, this problem is more severe, not to mention about PulseAudio.

EDIT: You can make sound processing in hardware, in the kernel, or in the userland.
In OSS4, mixing is implemented within kernel space. There are many reasons for this.
igorzwx
 
Posts: 863
Joined: Sun Jun 28, 2009 9:31 pm

Re: Are audio plugins(ie. LADSPA alike) supported by OSS?

Postby bearson » Sat May 01, 2010 2:44 am

I'd say that I haven't written these kinds of codes before. I will try and possibly it takes time. I also have a little knowledge about kernel module, there must be some way to load user space script into kernel space. Now I think it's better to do some things. I will report important progress here. Since I am maintaining some other projects, and still in university. It takes time...
bearson
 
Posts: 12
Joined: Thu Apr 29, 2010 2:04 pm

Next

Return to Linux

Who is online

Users browsing this forum: No registered users and 2 guests

cron