# Realtek ACL260 & FreeBSD 9.1 issue



## Sil68 (Aug 1, 2012)

Just the other day I installed FreeBSD 9.1-BETA1 on my Sony Vaio FSN-115S (FCG-791M), equipped with a Realtek ACL260 on-board audio unit, replacing in doing so my Debian Squeeze.

All went like a charm except for the audio setup. It appears as if all the relevant bits & bobs are in place, but checking sndstat no device is showing up. 



```
uname -a
--------
FreeBSD MH-Sony-Vaio-01 9.1-BETA1 FreeBSD 9.1-BETA1 #12: Wed Jul 11 08:25:44 PDT 2012     [email]root@build9x64.pcbsd.org[/email]:/usr/obj/builds/i386/pcbsd-build90/fbsd-source/9.0/sys/GENERIC  i386

kldstat | egrep -i "(snd|sound|audio|pcm|hda)"
---------------------------------------------
54    1 0xc8f79000 2000     snd_driver.ko
55    1 0xcae29000 5000     snd_vibes.ko
56    1 0xcae2e000 4000     snd_via82c686.ko
57    1 0xcaf2e000 5000     snd_t4dwave.ko
58    3 0xca571000 2000     snd_spicds.ko
59    1 0xcaf33000 5000     snd_solo.ko
60    4 0xcaf27000 4000     snd_sbc.ko
61    1 0xcaf38000 4000     snd_sb8.ko
62    1 0xcaf3c000 4000     snd_sb16.ko
63    1 0xcaf40000 11000    snd_neomagic.ko
64    2 0xcaf51000 a000     snd_mss.ko
65    1 0xcaf5b000 a000     snd_maestro3.ko
66    1 0xcaf65000 8000     snd_maestro.ko
67    1 0xcaf6d000 4000     snd_fm801.ko
68    1 0xcaf71000 4000     snd_ess.ko
69    1 0xcaf75000 7000     snd_envy24ht.ko
70    1 0xcaf7c000 8000     snd_envy24.ko
71    1 0xcaf84000 b000     snd_ds1.ko
72    1 0xcaf8f000 5000     snd_cs4281.ko
73    1 0xcaf94000 6000     snd_atiixp.ko
74    1 0xcaf9a000 4000     snd_als4000.ko
75    1 0xcaf9e000 4000     snd_ad1816.ko

======================================================================
sysctl -a | egrep -i "(snd|sound|audio|pcm|hda)"
-----------------------------------------------
device  sound
device  snd_cmi
device  snd_csa
device  snd_emu10kx
device  snd_es137x
device  snd_hda
device  snd_ich
device  snd_uaudio
device  snd_via8233
net.smb.tcpsndbuf: 65535
hw.snd.vpc_reset: 0
hw.snd.vpc_0db: 45
hw.snd.vpc_autoreset: 1
hw.snd.latency_profile: 1
hw.snd.latency: 5
hw.snd.report_soft_matrix: 1
hw.snd.report_soft_formats: 1
hw.snd.compat_linux_mmap: 0
hw.snd.feeder_eq_exact_rate: 0
hw.snd.feeder_eq_presets: PEQ:16000,0.2500,62,0.2500:-9,9,1.0:44100,48000,88200,96000,176400,192000
hw.snd.feeder_rate_quality: 1
hw.snd.feeder_rate_round: 25
hw.snd.feeder_rate_max: 2016000
hw.snd.feeder_rate_min: 1
hw.snd.feeder_rate_polyphase_max: 183040
hw.snd.feeder_rate_presets: 100:8:0.85 100:36:0.92 100:164:0.97
hw.snd.vpc_mixer_bypass: 1
hw.snd.verbose: 2
hw.snd.maxautovchans: 16
hw.snd.default_unit: -1
hw.snd.version: 2009061500/i386
hw.snd.default_auto: -1
hw.usb.uaudio.default_channels: 0
hw.usb.uaudio.default_bits: 32
hw.usb.uaudio.default_rate: 0
hw.usb.uaudio.debug: 0
dev.hdac.0.%desc: Intel 82801F HDA Controller
dev.hdac.0.%driver: hdac
dev.hdac.0.%location: slot=27 function=0 handle=\_SB_.PCI0.AZAL
dev.hdac.0.%pnpinfo: vendor=0x8086 device=0x2668 subvendor=0x104d subdevice=0x81bb class=0x040300
dev.hdac.0.%parent: pci0
dev.hdac.0.pindump: 0
dev.hdac.0.polling: 0
dev.hdacc.0.%desc: Realtek ALC260 HDA CODEC
dev.hdacc.0.%driver: hdacc
dev.hdacc.0.%location: cad=0
dev.hdacc.0.%pnpinfo: vendor=0x10ec device=0x0260 revision=0x03 stepping=0x00
dev.hdacc.0.%parent: hdac0
dev.hdacc.1.%desc: Conexant (0x2bfa) HDA CODEC
dev.hdacc.1.%driver: hdacc
dev.hdacc.1.%location: cad=1
dev.hdacc.1.%pnpinfo: vendor=0x14f1 device=0x2bfa revision=0x00 stepping=0x00
dev.hdacc.1.%parent: hdac0
dev.hdaa.0.%desc: Realtek ALC260 Audio Function Group
dev.hdaa.0.%driver: hdaa
dev.hdaa.0.%location: nid=1
dev.hdaa.0.%pnpinfo: type=0x01 subsystem=0x02600000
dev.hdaa.0.%parent: hdacc0
dev.hdaa.0.nid15_config: 0x01014000 as=0 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.0.nid15_original: 0x01014000 as=0 seq=0 device=Line-out conn=Jack ctype=1/8 loc=Rear color=Green misc=0
dev.hdaa.0.nid16_config: 0x02214000 as=0 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Front color=Green misc=0
dev.hdaa.0.nid16_original: 0x02214000 as=0 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Front color=Green misc=0
dev.hdaa.0.nid17_config: 0x50171000 as=0 seq=0 device=Speaker conn=None ctype=Analog loc=Internal color=Black misc=0
dev.hdaa.0.nid17_original: 0x50171000 as=0 seq=0 device=Speaker conn=None ctype=Analog loc=Internal color=Black misc=0
dev.hdaa.0.nid18_config: 0x01a19000 as=0 seq=0 device=Mic conn=Jack ctype=1/8 loc=Rear color=Pink misc=0
dev.hdaa.0.nid18_original: 0x01a19000 as=0 seq=0 device=Mic conn=Jack ctype=1/8 loc=Rear color=Pink misc=0
dev.hdaa.0.nid19_config: 0x02a19000 as=0 seq=0 device=Mic conn=Jack ctype=1/8 loc=Front color=Pink misc=0
dev.hdaa.0.nid19_original: 0x02a19000 as=0 seq=0 device=Mic conn=Jack ctype=1/8 loc=Front color=Pink misc=0
dev.hdaa.0.nid20_config: 0x01813000 as=0 seq=0 device=Line-in conn=Jack ctype=1/8 loc=Rear color=Blue misc=0
dev.hdaa.0.nid20_original: 0x01813000 as=0 seq=0 device=Line-in conn=Jack ctype=1/8 loc=Rear color=Blue misc=0
dev.hdaa.0.nid21_config: 0x99931000 as=0 seq=0 device=AUX conn=Fixed ctype=ATAPI loc=Onboard color=Black misc=0
dev.hdaa.0.nid21_original: 0x99931000 as=0 seq=0 device=AUX conn=Fixed ctype=ATAPI loc=Onboard color=Black misc=0
dev.hdaa.0.nid22_config: 0x99331000 as=0 seq=0 device=CD conn=Fixed ctype=ATAPI loc=Onboard color=Black misc=0
dev.hdaa.0.nid22_original: 0x99331000 as=0 seq=0 device=CD conn=Fixed ctype=ATAPI loc=Onboard color=Black misc=0
dev.hdaa.0.nid23_config: 0x90f71000 as=0 seq=0 device=Other conn=Fixed ctype=Analog loc=Internal color=Black misc=0
dev.hdaa.0.nid23_original: 0x90f71000 as=0 seq=0 device=Other conn=Fixed ctype=Analog loc=Internal color=Black misc=0
dev.hdaa.0.nid24_config: 0x01446000 as=0 seq=0 device=SPDIF-out conn=Jack ctype=RCA loc=Rear color=Orange misc=0
dev.hdaa.0.nid24_original: 0x01446000 as=0 seq=0 device=SPDIF-out conn=Jack ctype=RCA loc=Rear color=Orange misc=0
dev.hdaa.0.nid25_config: 0x01c41000 as=0 seq=0 device=SPDIF-in conn=Jack ctype=RCA loc=Rear color=Black misc=0
dev.hdaa.0.nid25_original: 0x01c41000 as=0 seq=0 device=SPDIF-in conn=Jack ctype=RCA loc=Rear color=Black misc=0
dev.hdaa.0.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.0.gpi_state: 
dev.hdaa.0.gpio_state: 0=disabled 1=disabled 2=disabled 3=disabled
dev.hdaa.0.gpio_config: 0=keep 1=keep 2=keep 3=keep
dev.hdaa.0.gpo_state: 
dev.hdaa.0.gpo_config: 
dev.hdaa.0.reconfig: 0

======================================================================
sysctl -w hw.snd.verbose=2
--------------------------
hw.snd.verbose: 2 -> 2

cat /dev/sndstat
----------------
FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
Installed devices:

pciconf -lv | grep -i audio
---------------------------
    device     = '82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller'

dmesg | grep -i audio
---------------------
hdaa0: <Realtek ALC260 Audio Function Group> at nid 1 on hdacc0
```


----------



## Sil68 (Aug 1, 2012)

I'm now one step further, sndstat is reporting an installed device! 

I've achieved this by adding the following lines to /boot/loader.conf:


```
hint.hdac.0.cad0.nid15.config="as=1 seq=0"
hint.hdac.0.cad0.nid16.config="as=1 seq=15"
hint.hdac.0.cad0.nid18.config="as=2 seq=0"
hint.hdac.0.cad0.nid20.config="as=2 seq=1"
```

Next thing to tackle, the audio ouput is pretty glitchy, heavily overlaid with with noise (OSS is being used).


----------



## Sil68 (Aug 1, 2012)

One another thing *sysctl hw.snd.default_unit* is reporting 
	
	



```
hw.snd.default_unit: 0
```


----------



## mav@ (Aug 2, 2012)

Your report would be much more informative if you included _verbose_ boot bessages in there.


----------



## Sil68 (Aug 3, 2012)

I managed to tackle this one by adding some hints.


```
hint.hdac.0.cad0.nid15.config="as=1 seq=0"
hint.hdac.0.cad0.nid16.config="as=1 seq=15"
hint.hdac.0.cad0.nid18.config="as=2 seq=0"
hint.hdac.0.cad0.nid20.config="as=2 seq=1"
```

Sound is now quite peachy, except when performing a "soft" reboot audio is getting glitchy and heavily overlaid by white noise.

Only executing a "hard" reboot--shutdown, power off, wait, fire up again--is delivering the audio as expected; it appears as if following this route, the hardware is put into the 'proper' state, whereas of 'soft' reboot fails to accomplish this.

Interesting observation that is, as with other OSes (eg. Linux, Windows) this never ever has happened.


----------

