# Pulseaudio/linux-compat/flash



## BlueCoder2 (Oct 19, 2011)

I run several servers/workstations and I've been playing with Pulseaudio and rather like the concept of a network sound server so please no flames, I'm just experimenting.

First does linux-f10 compat have an ALSA Pulseaudio "driver"?  I see there is a linux-f10-pulseaudio but that just looks like the libraries for Linux apps to connect to.  I would like to see if I can get linux-flash working with Pulseaudio over the network as well as other Linux audio apps.

Last... so far I haven't found mention of a Freebsd OSS driver for Pulseaudio. Did I miss something? Is there anyone out there working on a beta or anything?


----------



## adamk (Oct 20, 2011)

I've managed to get most apps to work through pulseaudio, including quite a few linux ones.  

First, make sure that OpenAL and SDL are both configured to use pulseaudio (and, of course, built with pulseaudio support...  I don't remember if that's enabled by default).

Second, make sure that you install audio/linux-f10-pulseaudio-libs.

Third, make sure audio/alsa-plugins is built with pulseaudio support.  Then configure alsa to use pulseaudio by default.  Create/edit /usr/local/etc/asound.conf so that it reads:


```
pcm.pulse {                                                                                               
    type pulse                                                                                            
    hint {                                                                                                
        description "PulseAudio Sound Server"                                                             
    }                                                                                                     
}                                                                                                         
                                                                                                          
ctl.pulse {
    type pulse
    hint {
        description "PulseAudio Sound Server"
    }
}

# Let's make it the default!

pcm.!default {
    type pulse
    hint {
        description "Default"
    }
}

ctl.!default {
    type pulse
    hint {
        description "Default"
    }
}
```

These two steps will get any application compiled with alsa support (both linux apps and FreeBSD apps) to use pulseaudio.

Fourth... Well, flash is the one tricky thing.  By default on FreeBSD, with the linux-compat layer, flash uses OSS, not alsa.  There may be a simpler way of doing this, but I built a linux version of libflashsupport on an F10 virtual machine.  This was a special version compiled with pulseaudio support (http://www.pulseaudio.org/wiki/FlashPlayer9Solution).  If you'd like, you can grab it from http://thorn.visualtech.com/libflashsupport.so

So, to summarize:  You need both the FreeBSD and linux versions of pulseaudio installed from ports.  Only the FreeBSD version needs to be running, obviously: the linux version only installs the necessary libs.  OpenAL and SDL both support pulseaudio, and can be configured to use pulseaudio by default (via ~/.alsoftrc and SDL_AUDIODRIVER, respectively). Any audio application that can be built with alsa support (mplayer and audacious come to mind, but they are bad examples as they also have support for pulse) can be directed to use pulseaudio.  And flash will work, but requires a special libflashsuspport library.

As for:



> so far I haven't found mention of a Freebsd OSS driver for Pulseaudio. Did I miss something?



I'm not sure I understand...  audio/pulseaudio will compile/install the pulseaudio OSS module, and should detect all your OSS devices.  If you have more than one, for example, you can move audio streams between devices using pavucontrol.

Adam


----------



## adamk (Oct 20, 2011)

Oh, by "FreeBSD OSS driver" do you mean a driver/plugin for OSS that directs all OSS output to pulseaudio? 

I'm not aware of any such option, which is why I reverted to the methods above.  You might be surprised the large percentage of audio applications are covered with the above directions.

Adam


----------



## BlueCoder2 (Oct 20, 2011)

I suppose I'm confusing libflashsupport with libflashplayer and seeing the 9... so ignored it...

I'll give it a go although I don't suppose you'd make a port... just neater when there is a port.  Should it be installed under root or under compat?  System directory or plugin directory?

And yes I meant the latter meaning.  I almost want to create a native Freebsd Pulseaudio driver myself.  Would work for everything that just wanted to output event sounds or streams.  Not good for multimedia though which needs native support to sync, e.g. video to audio.

<quote>I'm not sure I understand... audio/pulseaudio will compile/install the pulseaudio OSS module, and should detect all your OSS devices. If you have more than one, for example, you can move audio streams between devices using pavucontrol.</quote>

That statement makes me curious. I have default-server set in client.conf; is it possible to have pulseaudio daemon running locally as a sink and be able to redirect streams back with pavucontrol?  So far all I see is pavucontrol able to control volumes for pulseaudio running on the box hooked up to speakers.... now you have me wondering about mix and match from different computers... didn't even consider it before.  The configuration seems confusing. One computer has to be the "sound server".  But how to setup a sink locally... and still have default-server in client.conf....  sorry for rambling.

I wish pulseaudio was setup more conventionally with the sinks/sources daemons different from the userland mixer/coordinator.  But then I'm just new to it, I'll probably get use to in the end.

Thank you for your guidance with pulseaudio.


----------



## adamk (Oct 20, 2011)

The libflashsupport.so library should be in /compat/linux/usr/lib/.

There might be a way to get it work installed somewhere else, but that's where the flash plugin expects it.

As for using PA as a sound server for multiple machines, I've never actually tried that though I know it should be possible.

Adam


----------

