Is sound possible in Xorg on FreeBSD?

Greetings all,
I'm struggling with getting sound after installing Xorg on an 8.1-PRERELEASE/amd64 (custom kernel).
DMESG(8) output can be found here. My sig indicates my motherboard brand and model (if the DMESG(8) output isn't enough).
The manual indicates onboard sound is powered by a Realtek ALC892 chip.

Thank you for all your time and consideration.

Additional information provided on request. :)

P.S. When I first put this hardware together, I shoved a Fedora 13 Live DVD in, and booted to it. The sound worked in the KDE 4.4 desktop. So I know that the BIOS is at least set OK.
 
Unless you have a need for network sound, you should remove all traces of PulseAudio from your FreeBSD system. It's not needed.

Search the forums. There are many, many, many threads on how to get sound working. A couple search terms to use: snd_driver, sound, sndstat.

No sound drivers are part of the GENERIC kernel. You need to manually load sound drivers via kldstat() until you find the right one. Then set that in /boot/loader.conf to have it loaded automatically at boot.
 
Greetings phoenix, and thank you for your prompt reply.
I did search the forms prior to asking. Problem is - you're correct, there are many, many posts. I was unable to figure which driver was best suited for FBSD. Olny that pulseaudio "sucked". So now I'm left wondering if I should use Arts, OSS, or...

So I was hoping with the details I provided, that someone might be willing to suggest the direction best suited for my hardware.
Yes. I know the first step is to remove pulseaudio. :)

Thanks again phoenix, for taking the time to respond.
 
You could try this:

phoenix said:
# kldload snd_driver will load every sound module. Then # cat /dev/sndstat to see which one attached to the hardware. If nothing shows up, then there's probably no driver for that chipset.
 
Greetings, and thank you all for your thoughtful responses.
I continued to search the forums after my last reply to phoenix.
I eventually found the "magic" script in this thread. And of course you were correct; the output from running the script:
Code:
# ./soundloader 
kldload: can't load snd_ad1816.ko.symbols: Exec format error
kldunload: can't find file snd_ad1816.ko.symbols
kldload: can't load snd_als4000.ko.symbols: Exec format error
kldunload: can't find file snd_als4000.ko.symbols
kldload: can't load snd_atiixp.ko.symbols: Exec format error
kldunload: can't find file snd_atiixp.ko.symbols
kldload: can't load snd_cmi.ko.symbols: Exec format error
kldunload: can't find file snd_cmi.ko.symbols
kldload: can't load snd_cs4281.ko.symbols: Exec format error
kldunload: can't find file snd_cs4281.ko.symbols
kldload: can't load snd_csa.ko.symbols: Exec format error
kldunload: can't find file snd_csa.ko.symbols
kldload: can't load snd_ds1.ko.symbols: Exec format error
kldunload: can't find file snd_ds1.ko.symbols
kldload: can't load snd_emu10k1.ko.symbols: Exec format error
kldunload: can't find file snd_emu10k1.ko.symbols
kldload: can't load snd_emu10kx.ko.symbols: Exec format error
kldunload: can't find file snd_emu10kx.ko.symbols
kldload: can't load snd_envy24.ko.symbols: Exec format error
kldunload: can't find file snd_envy24.ko.symbols
kldload: can't load snd_envy24ht.ko.symbols: Exec format error
kldunload: can't find file snd_envy24ht.ko.symbols
kldload: can't load snd_es137x.ko.symbols: Exec format error
kldunload: can't find file snd_es137x.ko.symbols
kldload: can't load snd_ess.ko.symbols: Exec format error
kldunload: can't find file snd_ess.ko.symbols
kldload: can't load snd_fm801.ko.symbols: Exec format error
kldunload: can't find file snd_fm801.ko.symbols
A driver was found : 'snd_hda.ko'
Add the driver to /boot/loader.conf'

So now all I need to do is get rid of pulseaudio. But one question remains:

Which is best for a KDE-4.4 install?

Any takers?

Thank you all again for your thoughtful and informative responses - greatly appreciated!
 
new kernel with driver but no sound

Greetings,
I built/installed a new kernel with the sound/sound driver declaration(s). The sound device shows up in dmesg(8). But I still have no sound. The output regarding the sound is a bit overwhelming. Would anyone dare to take a look, and suggest my best choices from here? output is here.

Thank you for all your time and consideration.

P.S. I've been riding BSD since the early '80's, and over those years I've literally build hundreds of kernels. But until now, they have all been servers. The only multimedia device on any of my server boards, was a PC beeper. The most I ever bothered with in the kernel, was
[CMD=""]option speaker[/CMD]

:p
 
To see which driver is installed do [cmd=]cat /dev/sndstat[/cmd]
Looking at your output it's probably snd_hda. Just add this to /boot/loader.conf:
Code:
snd_hda_load="YES"

No need to recompile your kernel. Also make sure you read the snd_hda(4) man page. You probably need to define which output does what.
 
Greetings SirDice, and thank you for your reply.
Been there done that. In fact, I made a kernel with the following
new declarations:
Code:
# ADDING SOUND
device		sound
# Intel High Definition Audio bridge device driver
device		snd_hda

I posted output from dmesg(8) here

In case it's not crystal clear - I'm pretty dumbfounded.
I can see it's available, given the message output during boot.
I
Code:
# cd /usr/ports/multimedia/kdemultimedia4
# make deinstall
# make config

# cd ../pulseaudio
# make deinstall

# cd ../kdemultimedia4
# make install clean

# rehash

# cd /root
# halt
...

after reboot

startx

Same fsck'n bullschmidt!
OSS mixer shows 3 PCM devices - yet there is only 1 in /dev
(pcm0) && none of them work.

There are 3 dsp's in /dev
dsp0.0, dsp1.0, and dsp.2.0

There are also 3 mixers in /dev
mixer0, mixer1, and mixer2

If I crank up the volume on line-in, I can hear hissing - like
when if sound came through, you know it would blow your ear drums out.

But apparently the sound drivers w/FreeBSD/KDE,... I dunno.

Code:
# cat /dev/sndstat 
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <HDA Realtek ALC892 PCM #0 Analog> (play/rec) default
pcm1: <HDA Realtek ALC892 PCM #1 Analog> (play/rec)
pcm2: <HDA Realtek ALC892 PCM #2 Digital> (play)

Thank you for all your time and consideration.

P.S. Please pardon me if this sounds really stupid - it's been a l-o-n-g day. Anyway, do I still need to
Code:
snd_hda.ko_load="YES"
in /boot/loader.conf
now that I have it defined in my new kernel.

Thanks again...
 
PhenomII said:
P.S. Please pardon me if this sounds really stupid - it's been a l-o-n-g day. Anyway, do I still need to
[CMD=""]snd_hda.ko_load="YES"[/CMD]
in /boot/loader.conf
now that I have it defined in my new kernel.
It should be snd_hda_load="YES" and no, you don't need to add it to loader.conf if it's already build into the kernel. Loader.conf is used to load additional modules, those not build into the kernel i.e.

As for no sound, read the man page. I don't have HDA audio so I can't help with that. There are however several threads here related to snd_hda and how to define which port on the card does what.
 
SirDice said:
It should be snd_hda_load="YES" and no, you don't need to add it to loader.conf if it's already build into the kernel. Loader.conf is used to load additional modules, those not build into the kernel i.e.
Thank you again SirDice.
That has always been my understanding. I had had to work for 2 days straight w/o sleep, so my mind wasn't functioning very well, I'm afraid.

SirDice said:
As for no sound, read the man page. I don't have HDA audio so I can't help with that. There are however several threads here related to snd_hda and how to define which port on the card does what.
Will do. I did read the man page for the driver. But I'll look it over again, now that I'm better rested. :)

Thanks again, for your thoughtful reply.
 
adamk said:
What, exactly, have you tried to play sound with?
Thank you for your reply adamk.
Thus far, I've only worked out of the KDE-4.4.4 env. Which currnetly anounces that PCM #0 is not functioning. The listing of devices that KDE acknowledges can be seen here:

attachment.php


I have only attempted to produce sound within: System Settings > Multimedia > Highlighting one of the Devices, and pressing "test".
I have setup the mixer so the volumes of all the output/input ports are at a level high enough to ensure audible output.

The really frustrating part of all this, is that if I raise the volume past 60% on the mic input, I can hear "hissing". So I know FreeBSD has enabled it. But KDE is apparently "clueless". But then again, as this my first attempt with multimedia devices on FreeBSD, I'm a bit "clueless" too :p

Thank you again for your thoughtful response.
 

Attachments

  • sound-dev-shot_1.jpeg
    sound-dev-shot_1.jpeg
    15.8 KB · Views: 1,228
DutchDaemon said:

Thank you for your reply DutchDaemon. That is a great link, to an even better script - no offense, but if you look closer at my posting of the output produced by a script I named "soundloader",
you'll notice that it is the script referenced in the link you provided:
PhenomII said:
Greetings, and thank you all for your thoughtful responses.
I continued to search the forums after my last reply to phoenix.
I eventually found the "magic" script in this thread. And of course you were correct; the output from running the script:

Good call though. You are "spot on". That script DID give me the knowlege I needed to load a suitable driver for my hardware.

So now who's not reading. ;) - sorry, I couldn't resist. :)

Thank you for the thoughtful reply DutchDaemon.
 
Beastie said:
% cat /dev/random > /dev/dsp will tell you right away if the sound card driver is working or not.
Do this before anything else (pseudocode):
For each port on the back of your soundcard do:
plug in the sound card;
% cat /dev/random > /dev/dsp0.0
% cat /dev/random > /dev/dsp1.0
% cat /dev/random > /dev/dsp2.0
done

This should find which port is working with which device node, which will be necessary before you try and get KDE working with sound, or at least help you so that you can get mp3s or flacs playing in the background.
PhenomII said:
So now who's not reading. - sorry, I couldn't resist.
If you want help, try not to be snarky. It erases any goodwill built up by thanking people, and makes the thanks look like they aren't meant. And especially to DutchDaemon, who is unpaid and from what I can gather has provided thousands of hours of volunteer effort to FreeBSD by his presence on the forums. (The thanks btw is probably better done by using the forum "thanks" function, as it will bump up their thanks score.)

I would not have replied but I'm also curious about getting more sound functionality with my setup than being able to cat mp3 files to sox etc.
 
Greetings carlton, and thank you for your response.
carlton_draught said:
Beastie said:
% cat /dev/random > /dev/dsp will tell you right away if the sound card driver is working or not.
FWIW I don't have a:
/dev/dsp

I do have:
/dev/dsp0.0
/dev/dsp0.1
/dev/dsp1.0
/dev/dsp2.0

Is this an issue?
carlton_draught said:
Do this before anything else (pseudocode):
For each port on the back of your soundcard do:
plug in the sound card;
% cat /dev/random > /dev/dsp0.0
% cat /dev/random > /dev/dsp1.0
% cat /dev/random > /dev/dsp2.0
done

This should find which port is working with which device node, which will be necessary before you try and get KDE working with sound, or at least help you so that you can get mp3s or flacs playing in the background.

If you want help, try not to be snarky. It erases any goodwill built up by thanking people, and makes the thanks look like they aren't meant. And especially to DutchDaemon, who is unpaid and from what I can gather has provided thousands of hours of volunteer effort to FreeBSD by his presence on the forums. (The thanks btw is probably better done by using the forum "thanks" function, as it will bump up their thanks score.)
I should first preface this by stating that I think that's good advice, and couldn't agree more.
That said, in retrospect, I should have provided a bit of history. So that those, like yourself, would have a better understanding what would posess me to make such a statement.
So I'll do so now. For the record, DutchDaemon (rightfully) gave me the "buisness" for a comment in my sig which read:
@sysop why can't I edit my posts?
To which he appended to my sig; "please read the documentation regarding the forums" - paraphrased.
In fact I had read them in their entirity. But for the life of me, I was unable to find the part related "post editing".
Eventually, I found it, and thanked DuchDaemon for his patience, and his indulgence.
So, as you now probably realize, my "snarky" comment was a bit of what one might call, an "inside joke". But it was clearly an oversight on my part, as I could/should not have expected anyone else to understand that. I hope my intention(s) are clearer now. :)
carlton_draught said:
I would not have replied but I'm also curious about getting more sound functionality with my setup than being able to cat mp3 files to sox etc.

Thank you again carlton, for taking the time to respond.
 
carlton_draught said:
Do this before anything else (pseudocode):
For each port on the back of your soundcard do:
plug in the sound card;
[cmd=""]% cat /dev/random > /dev/dsp0.0[/cmd]
[cmd=""]% cat /dev/random > /dev/dsp1.0[/cmd]
[cmd=""]% cat /dev/random > /dev/dsp2.0[/cmd]
done

Code:
# cat /dev/random > /dev/dsp0.0
/dev/dsp0.0: Device busy.
Performing the same on:
/dev/dsp0.1
/dev/dsp1.0
/dev/dsp2.0
causes the command not to return (^C required to end the command)

The only sound related devices I now have are:
/dev/dsp0.0
/dev/dsp0.1
/dev/dsp1.0
/dev/dsp2.0

/dev/mixer0
/dev/mixer1
/dev/mixer2

/dev/psm0

Code:
# cat /dev/random > /dev/psm0 
/dev/psm0: Device busy.

I do hear "hissing" when I crank up the "mic" volume. But I don't hear anything
performing the # cat /dev/random > /dev/<sound-device-here>.

Any thoughts?

Thank you for all your time and consideration.
 
DutchDaemon said:
As an aside: please use the correct posting tags. The [cmd] tag is for posting commands, the [code] tag is for posting system output, configuration files, etc. -> http://forums.freebsd.org/showthread.php?t=8816
Greetings DutchDaemon,
I tried that originally. But no matter which browser I use, using the
Code:
 tags, causes scrolling within the [CODE] section (a crollbar on the bottom, and one on the right). This makes it impossible to read the last (bottom) line within the [CODE] sections of peoples posts. I'm forced to open an editor and
CTRL+A in the [CODE] setion, and paste it into the open editor to read the entire [CODE] listing. I hope it's not too big of a deal to substitute [CMD], as it [i]really[/i] helps make the content easier to read.

Thank you for all your time and consideration.
 
PhenomII said:
I hope it's not too big of a deal to substitute , as it [i]really[/i] helps make the content easier to read.[/quote]
That should have read

I hope it's not too big of a deal [u][b]I[/b][/u] substitute [CMD]

Thanks again.
 
PhenomII said:
[cmd=""]# cat /dev/random > /dev/dsp0.0
/dev/dsp0.0: Device busy.[/cmd]
Performing the same on:
/dev/dsp0.1
/dev/dsp1.0
/dev/dsp2.0
causes the command not to return (^C required to end the command)

I do hear "hissing" when I crank up the "mic" volume. But I don't hear anything
performing the # cat /dev/random > /dev/<sound-device-here>.
Well, the idea behind sending output from /dev/random to your dsp (as you did) was that when you hit on the correct combination of dspx.y, combined with audio port at the back, you will get the sound of static (from memory, it's similar to the white noise from a CRT TV not tuned to any station. It won't be a hiss and it will be unmistakeable.

The command is not returning because /dev/random is an infinite stream of random bits. Try catting it to your terminal some time, you will see what I mean. As long as it is sending, your dsp (digital signal processor?) device will try and play it.

So, if you have tested your audio lead/speakers correctly (e.g. against another OS) and your speakers will output a working volume, and you have your driver loaded, then the next step is to see which device node and port combination work. I would probably try and do this straight from the terminal without X11 loaded. If you have tested every port and device combo, my guess is that the problem is with the busy device and you will have to figure out why it's busy. Good luck.
 
Back
Top