# snd_hda and 8.2-RC*



## Enter4 (Feb 1, 2011)

Hi 

I have recently installed new version of FreeBSD 8.2-RC2. On the new version i'm having trouble with sound. 
When I load hda_snd.ko driver I get an error msg

```
hdac0: <ATI SB600 High Definition Audio Controller> irq 16 at device 20.2 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: hdac_get_capabilities: Invalid corb size (2)
device_attach: hdac0 attach returned 6
```

and /dev/sndstat

```
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
```

Does anybody have any ideas how to fix this?

Thank you in advance
Urban Å½an


----------



## rhyous (Feb 11, 2011)

Other than to submit a Problem Report (PR)?
http://www.freebsd.org/send-pr.html


----------



## xibo (Feb 11, 2011)

This won't fix it, but if you have another audio interface card installed in addition to your graphics card's one (e.g. an on-the-mainboard one) you can work around this by setting your system to use that one instead, i.e. setting hw.snd.default_unit to the handle number of your additional audio adapter (detected e.g. by running "*sysctl dev.pcm*" and looking for it's name in dev.pcm.handle_number.%desc) and reconnecting your audio output devices to the other audio interface card.


----------



## mav@ (Feb 11, 2011)

Try please this patch:

```
--- hdac.c.prev 2011-02-06 19:14:00.000000000 +0200
+++ hdac.c      2011-02-11 10:47:30.000000000 +0200
@@ -1608,6 +1608,10 @@ hdac_get_capabilities(struct hdac_softc 
        sc->support_64bit = HDA_FLAG_MATCH(gcap, HDAC_GCAP_64OK);
 
        corbsize = HDAC_READ_1(&sc->mem, HDAC_CORBSIZE);
+       if ((corbsize & HDAC_CORBSIZE_CORBSZCAP_MASK) == 0) {
+               corbsize |= (HDAC_CORBSIZE_CORBSZCAP_2 <<
+                   HDAC_CORBSIZE_CORBSIZE(corbsize));
+       }
        if ((corbsize & HDAC_CORBSIZE_CORBSZCAP_256) ==
            HDAC_CORBSIZE_CORBSZCAP_256)
                sc->corb_size = 256;
```


----------



## Enter4 (Feb 12, 2011)

Hi,

I have no luck today 

```
patch < hdac_mav.patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- hdac.c.prev 2011-02-06 19:14:00.000000000 +0200
|+++ hdac.c      2011-02-11 10:47:30.000000000 +0200
--------------------------
Patching file hdac.c using Plan A...
Hunk #1 failed at 1608.
1 out of 1 hunks failed--saving rejects to hdac.c.rej
done
```

and hdac.c.rej says

```
***************
*** 1608,1613 ****
         sc->support_64bit = HDA_FLAG_MATCH(gcap, HDAC_GCAP_64OK);
                                                                                    
         corbsize = HDAC_READ_1(&sc->mem, HDAC_CORBSIZE);                           
         if ((corbsize & HDAC_CORBSIZE_CORBSZCAP_256) ==                            
             HDAC_CORBSIZE_CORBSZCAP_256)                                           
                 sc->corb_size = 256;                                               
--- 1608,1617 ----                                                                  
         sc->support_64bit = HDA_FLAG_MATCH(gcap, HDAC_GCAP_64OK);
  
         corbsize = HDAC_READ_1(&sc->mem, HDAC_CORBSIZE);
+        if ((corbsize & HDAC_CORBSIZE_CORBSZCAP_MASK) == 0) {
+                corbsize |= (HDAC_CORBSIZE_CORBSZCAP_2 <<
+                    HDAC_CORBSIZE_CORBSIZE(corbsize));
+        }
         if ((corbsize & HDAC_CORBSIZE_CORBSZCAP_256) ==
             HDAC_CORBSIZE_CORBSZCAP_256)
                 sc->corb_size = 256;
```

In my opinion the problem is not in the code, but in hardware, because I have changed RAM from slot 1 to slot 2 and sound started to work again. :/


----------



## lissyara (Jun 19, 2011)

I have this problem with CURRENT, before (1-2 months ago) all was OK. 


```
hdac0: <ATI SB600 High Definition Audio Controller> mem 0xb7fb0000-0xb7fb3fff irq 16 at device 20.2 on pci0
hdac0: hdac_get_capabilities: Invalid corb size (0)
device_attach: hdac0 attach returned 6
```


```
FreeBSD HP.lissyara.su 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r223260M: Sat Jun 18 20:30:25 MSD 2011  
   root@HP.lissyara.su:/usr/obj/usr/src/sys/GENERIC  amd64
```


```
hdac0@pci0:0:20:2:      class=0x040300 card=0x30c2103c chip=0x43831002 rev=0x00 hdr=0x00
    vendor     = 'ATI Technologies Inc. / Advanced Micro Devices, Inc.'
    device     = 'IXP SB600 High Definition Audio Controller'
    class      = multimedia
    subclass   = HDA
    bar   [10] = type Memory, range 64, base 0xb7fb0000, size 16384, enabled
    cap 01[50] = powerspec 2  supports D0 D3  current D0
```

mav@'s patch does not help.


----------



## bluetick (Jun 22, 2011)

Place this into /boot/loader.conf

```
sound_load="YES"
snd_hda_load="YES"
hw.snd.default_unit="1"
```
 
HTH


----------

