Help me configure OSS in FreeBSD

OSS specific BSD discussion (FreeBSD/NetBSD/OpenBSD)

Moderators: hannu, dev, kodachi, cesium

Help me configure OSS in FreeBSD

Postby paulfxh » Sun Mar 30, 2008 5:34 am

I've just recently started using FreeBSD 7.0 on my Dell Desktop 4550.
The sound card is a Creative Labs Sound Blaster emu10k1x. It seems that the FreeBSD drivers do not support this card and I have, therefore, installed OSS (from ports audio/oss).
This allows me to load the module emu10k1x.ko and now the kde "welcome" sound can be heard during bootup (whereas before it was just silence).
So, this is a promising start to getting sound working in FBSD but, alas, that's as far as it goes.
So, if I try to start the streaming radio app last.fm I get this message shortly after last.fm starts up:
Your soundcard is either busy or not present. Try restarting the application

If I try to play a CD in the cd drive using
Code: Select all
cdcontrol -f /dev/acd0 play 1

the CD starts normally and appears to play (flickering light) but no sound is heard.
Clearly, I need to configure oss to send the sound to an appropriate output device but have no clue how to do this.
Can someone please advise?

Here is some further info that might just shed some light on this:
1. Output from "# kldstat"
Code: Select all
Id Refs Address    Size     Name
1   14 0xc0400000 906518   kernel
2    1 0xc0d07000 4e1168   nvidia.ko
3    2 0xc11e9000 28658    linux.ko
4    1 0xc1212000 6a32c    acpi.ko
5    3 0xc4810000 7d000    osscore.ko
6    1 0xc4896000 6000     emu10k1x.ko
7    1 0xc48a7000 2000     vmix.ko


2. Output from "# cat /dev/sndstat"
Code: Select all
OSS 4.0 (b1014/200803282359) BSD (C) 4Front Technologies 1996-2007
Kernel: FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008
    root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC


Audio devices:
0: Sound Blaster Live (P16X) (front) (DUPLEX)
1: Sound Blaster Live (P16X) (surround) (OUTPUT)
2: Sound Blaster Live (P16X) (center/LFE) (OUTPUT)
3: Sound Blaster Live (P16X) 5.1 output (OUTPUT)
4: Sound Blaster Live (P16X) (front) (VMIX0) (DUPLEX)
5: Sound Blaster Live (P16X) (front) (VMIX0) (DUPLEX)
6: Sound Blaster Live (P16X) (front) (VMIX0) (DUPLEX)
7: Sound Blaster Live (P16X) (front) (VMIX0) (DUPLEX)
8: Sound Blaster Live (P16X) (front) (VMIX0) (DUPLEX)
9: Sound Blaster Live (P16X) (front) (VMIX0) (DUPLEX)
10: Sound Blaster Live (P16X) (front) (VMIX0) (DUPLEX)
11: Sound Blaster Live (P16X) (front) (VMIX0) (DUPLEX)

Mixers:
0: Sound Blaster Live (P16X) (STAC9708)

History:
/dev/oss/emu10k1x0/pcm0.00: pid 1366 cmd 'last.fm.app' IN OUT
/dev/oss/emu10k1x0/pcm0.00: pid 1366 cmd 'last.fm.app' OUT
/dev/oss/emu10k1x0/pcm0.00: pid 1366 cmd 'last.fm.app' OUT
/dev/oss/emu10k1x0/pcm0.00: pid 1366 cmd 'last.fm.app' OUT
/dev/oss/emu10k1x0/pcm0.00: pid 1009 cmd 'artsd' OUT


Typing "~ ossinfo" gives me
Code: Select all
# ossinfo
Version info: OSS 4.0 (b1014/200803282359) (0x00040003) BSD
Platform: FreeBSD/i386 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008     root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC (freebsd.unix)

Number of audio devices:        12
Number of audio engines:        12
Number of mixer devices:        1


Device objects
0: emu10k1x0 Sound Blaster Live (P16X)
1: vmix0 OSS transparent virtual support


Mixer devices
0: Sound Blaster Live (P16X) (STAC9M (Mixer 0 of device object 0)

Audio devices
Sound Blaster Live (P16X) (front)  /dev/oss/emu10k1x0/pcm0  (device index 0)
Sound Blaster Live (P16X) (surround)  /dev/oss/emu10k1x0/pcm1  (device index 1)
Sound Blaster Live (P16X) (center/LFE)  /dev/oss/emu10k1x0/pcm2  (device index 2)
Sound Blaster Live (P16X) 5.1 output  /dev/oss/emu10k1x0/pcm3  (device index 3)
Sound Blaster Live (P16X) (front) (VMIX0)  /dev/oss/vmix0/pcm0  (device index 4)
Sound Blaster Live (P16X) (front) (VMIX0)  /dev/oss/vmix0/pcm1  (device index 5)
Sound Blaster Live (P16X) (front) (VMIX0)  /dev/oss/vmix0/pcm2  (device index 6)
Sound Blaster Live (P16X) (front) (VMIX0)  /dev/oss/vmix0/pcm3  (device index 7)
Sound Blaster Live (P16X) (front) (VMIX0)  /dev/oss/vmix0/pcm4  (device index 8)
Sound Blaster Live (P16X) (front) (VMIX0)  /dev/oss/vmix0/pcm5  (device index 9)
Sound Blaster Live (P16X) (front) (VMIX0)  /dev/oss/vmix0/pcm6  (device index 10)
Sound Blaster Live (P16X) (front) (VMIX0)  /dev/oss/vmix0/pcm7  (device index 11)

Thanks in advance for any assistance received and please bear in mind that my experience with FBSD is no more than a few weeks.
Paul

[edit by cesium: remove spurious empty lines at end of message]
paulfxh
 
Posts: 7
Joined: Sun Mar 30, 2008 4:50 am

Postby cesium » Sun Mar 30, 2008 12:08 pm

OSS doesn't support multiple sound clients on BSD [edit: on a single device node] (see this thread). arts probably uses the only available spot. Your best bet is to use a sound server which supports multiple client, and make your programs output to that (like arts which is supplied with kde, or esound, etc.).
Last edited by cesium on Sun Mar 30, 2008 7:25 pm, edited 1 time in total.
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby paulfxh » Sun Mar 30, 2008 12:42 pm

Thank you for that information.
I'm almost ready to admit defeat here as it seems to be turning into a marathon just to get music to play on FreeBSD. :( Maybe I'd be better off just getting a new sound card that was more compatible with FBSD. :cry:
Nevertheless, perhaps you might be able to point me to a guide that can assist me in setting up a sound server system in FBSD.
Thanks a lot
Paul
paulfxh
 
Posts: 7
Joined: Sun Mar 30, 2008 4:50 am

Postby cesium » Sun Mar 30, 2008 1:47 pm

On an unrelated note, as a new FreeBSD user you may wish to check PC-BSD. I'm told it's more user friendly than "regular" FreeBSD.

Back to the subject, you probably already have arts installed. So now you have to convince apps to use it:

As a rule, check if:
A) An application can output to arts directly. If so, use the app's supplied option.
B) Said app's port has an option to add arts support. If so, enable the option (method described in the ports manual).

If both A&B do not apply, than use artsdsp.
artsdsp {program} -> an OSS using program {program} will now output to arts.

Some more specific hints:
export SDL_AUDIODRIVER=artsc -> add this to /etc/profile. SDL using applications will now output to arts. (may require restart).
mplayer -ao arts -> make mplayer use arts . Add "ao=arts" to ~/.mplayer/config to make this permament.
xine -A arts -> same for xine.
timidity -OR -> timidity will output to aRts.
xmms -> install xmms_arts plugin.

Similar advice pertains, if you choose to use esd instead (typically esd plugins work better than arts plugins). Replace all "arts" above with "esd". e.g. export SDL_AUDIODRIVER=esd , using esddsp etc. . You'd also have to install esd (sometimes called esound), and configure arts to output to esd via the kde control panel.
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby r0bert » Sun Mar 30, 2008 5:12 pm

Hi paulfxh,
I think your sound is working fine, as you already can hear the welcome sound.
ossinfo tells you that you have 12 audio devices, so you should have
/dev/dsp
/dev/dsp0
/dev/dsp1
...
Try to configure your applications to use one of this devices, one device for one application. At least that's the way I'm using it, and it's working fine, you can even play more than one sound at the same time, as they are using different devices.
r0bert
 
Posts: 8
Joined: Sat Mar 29, 2008 8:52 am

Postby paulfxh » Sun Mar 30, 2008 8:32 pm

cesium wrote:Some more specific hints:
export SDL_AUDIODRIVER=artsc -> add this to /etc/profile. SDL using applications will now output to arts. (may require restart).
mplayer -ao arts -> make mplayer use arts . Add "ao=arts" to ~/.mplayer/config to make this permament.
xine -A arts -> same for xine.
timidity -OR -> timidity will output to aRts.
xmms -> install xmms_arts plugin.

Many thanks for your comprehensive reply.
Well, now things are looking (or, at least, sounding) a lot better. I added your recommendations to /etc/profile, rebooted and tried a few things.
1. CD player works , but still no sound
2. Last.fm works but same as before in that it complains of no available sound cards still no sound.
3. Finally, I tried Amarok and, omg, IT WORKS :D :D :D
Not only that but I can use last.fm through Amarok and it works absolutely perfectly. 8) 8) 8)
Now I have to say that I cannot be sure that the changes I made to /etc/profile were the reasons for this change in fortunes and, if they were, which one in particular. I can probably comment them out one-by-one to check this.

Nevertheless, it's frustrating that I cannot play music CDs and hear them.
r0bert advises that I
/dev/dsp
/dev/dsp0
/dev/dsp1
...
Try to configure your applications to use one of this devices

If only I knew how :oops:
I tried to do just that with last.fm (remember it works through Amarok only and not independently). If I open Last.fm>Tools>Options>Radio>Audio
Here there are two drop-down boxes. The first, Soundcard, has no options at all marked as available for choice.
The second, System, has just one option which is OSS.
Nothing is available to allow me to choose which device I want the sound to come out of.
I imagine configuring my CDRom to output to a specified sound device must be simple but I can't manage it for the moment.
Would appeciate just a little more help, please :wink:
paulfxh
 
Posts: 7
Joined: Sun Mar 30, 2008 4:50 am

Postby cesium » Sun Mar 30, 2008 9:05 pm

A. To clarify, I only recommended adding the export SDL.. line to /etc/profile, not the others.

B. Check "override device location" in kcontrol->"Sound System" and set the device to /dev/dsp10 or something (so that dumb programs which only know about /dev/dsp will have a ready device).

C. Which cd player are you using? Kscd can be set so that it will output to arts. Extra->Configure kscd->Use direct digital playback and select arts.
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am


Return to BSD

Who is online

Users browsing this forum: No registered users and 3 guests

cron