Installing OSS in FreeBSD Jail with no sound card

OSS specific BSD discussion (FreeBSD/NetBSD/OpenBSD)

Moderators: hannu, dev, kodachi, cesium

Installing OSS in FreeBSD Jail with no sound card

Postby ClubPetey » Thu Mar 05, 2009 4:37 pm

Hello all, This may seem like an odd request but...

I am looking to install OSS inside a FreeBSD jail with no sound card on the system. Basically I have another application that needs to link to libasound (linux-ALSA drivers). I am on a Virtual BSD server however, and cannot link a native BSD app with a linux lib.

I head that OSS has a compatible library, so I am looking to install. However:
- I am inside the Jail and thus, linking /dev/dsp isn't supported.
- There is no sound card in this server.

I've attempted to install the BSD package, however I receive the following error:
/usr/src]# pkg_add oss-freebsd7-v4.1-1051-amd64.tbz
Build Open Sound System for FreeBSD-amd64 7.1-RELEASE-p3
Compiling module osscore
Compiling osscore module failed
"/usr/share/mk/", line 12: "can't find kernel source tree"
Starting Open Sound System
ln: /dev/dsp: Operation not permitted
No /usr/lib/oss/etc/installed_drivers
Please run ossdetect to create it.
pkg_add: install script returned error status

Can anyone provide me some guidence?
Posts: 2
Joined: Thu Mar 05, 2009 4:31 pm

Postby cesium » Thu Mar 05, 2009 4:54 pm


1) Maybe libdssialsacompat will be good enough for the application? The OSS libsalsa requires ALSA headers to compile, and it's based on pretty old version of libasound anyway...
libsalsa binary is not compiled by default in the FreeBSD package, so you'll have to hack the source tree to compile it manually (e.g. edit lib/libsalsa/.config and remove "targetos" line to make the build system try to compile it under FreeBSD). See here for general building instructions.

2) It'll be much better to install OSS on the host. There's a nice port too. Isn't there a FreeBSD equivalent of "mount --bind" to export a directory to chroot? Maybe unionfs can be used for this? If you're not comfortable with exporting /dev, you can settle for exporting /dev/oss directory to the jail and creating a /dev/dsp symlink manually inside (Not having /dev/mixer that way is annoying though).

3) You can create a virtual soundcard with oss_userdev or possibly oss_audioloop drivers. For some reason the first isn't compiled in the FreeBSD package by default (you can edit kernel/drv/oss_userdev/.config and remove "forgetos" line).
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby ClubPetey » Thu Mar 05, 2009 5:14 pm

Thanks for the info, alas:

1) libdssialsacompat does not come with a version of which is the file I need to link with my application.

2) I am merely a user of the Jail, not the owner of the host. While I can petition the host owners to install OSS, I think that will be an uphill battle. Justifying a sound system on server-farm machine is tough, and no idea how the licensing of that would work is 4Front (Would the hosting company buy a license per-jail?)

3) I don't really NEED a sound card, I do not plan to play any audio. What I am trying to do is get a text-to-speech engine installed, I will be producing sound to WAV files, but the compile requires the library.

In fact, if someone out there emailed me a compile libasound (or equivalent) compiled for FreeBSD 7.1 amd64 I may be able to install it and be done. I just don't know where to get the file.


NOTE: I do have the following file:

not sure if that is relevent tho...
Posts: 2
Joined: Thu Mar 05, 2009 4:31 pm

Postby cesium » Fri Mar 06, 2009 1:10 am

1) Well, you could create a symlink to No idea if the required symbols are exported though.

2) You can install OSS on a machine/VM with a similiar kernel and then copy the modules or put the kernel source inside the jail and do the install inside, but it looks weird to me - I don't think you have permission(s) to load kernel modules from inside a jail... It's easy to breakout once it's possible. I think license questions can be ignored for now.

3) A libasound2 plugin which will capture to file would also do the job, not requiring emulating /dev/dsp or a kernel module. I don't know if one exists, but it should.

4) That's probably the libao OSS plugin - I don't think it's relevant.

5) What program are you trying to run? Why not use linux-compat?
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Return to BSD

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 1 guest