# Sound on Asus A6RP AP051 laptop



## lubnet (Apr 22, 2013)

Hi all,

I have an Asus A6RP AP051 laptop on which I have FreeBSD 9.1 RELEASE now. I tried to make the sound card work since last year. I have tried many configuration tunables - finally I managed the sound card to make some noise.

Sound Card: IXP SB4x0 High Definition Audio Controller.

My headphones are connected to the PC:

`# cat /dev/urandom > /dev/dsp`

Day zero: no noise. Finally now, after adding 
	
	



```
hint.hdac.0.cad0.nid21.config="as=1 seq=15"
```
 to /boot/device.hints I can hear some noise.

`# mpg123 -a /dev/dsp1.0 Foobar-GreatestHits.mp3`

Now I am able to hear a noise instead of the Greatest Hits.


```
# uname -a
FreeBSD foo@bar.com 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243826: Tue Dec  4 06:55:39 UTC 2012     root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
```


```
# cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
Installed devices:
pcm0: <Realtek ALC660 (Rear Analog)> (play/rec) default
pcm1: <Realtek ALC660 (Onboard Analog Line-out)> (play)
```


```
# mixer
mixer vol      is currently set to  75:75
Mixer pcm      is currently set to  75:75
Mixer speaker  is currently set to 100:100
Mixer line     is currently set to 100:100
Mixer mic      is currently set to   0:0
Mixer mix      is currently set to  81:81
Mixer rec      is currently set to 100:100
Mixer igain    is currently set to   0:0
Recording source: mic
```


```
# grep "snd"  /boot/loader.conf
hw.snd.default_unit=0
```


```
# sysctl hw.snd
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: 0
hw.snd.maxautovchans: 16
hw.snd.default_unit: 0
hw.snd.version: 2009061500/i386
hw.snd.default_auto: 0
```


```
# sysctl dev.pcm
ev.pcm.0.%desc: Realtek ALC660 (Rear Analog)
dev.pcm.0.%driver: pcm
dev.pcm.0.%location: nid=14,12,13
dev.pcm.0.%parent: hdaa0
dev.pcm.0.play.vchans: 2
dev.pcm.0.play.vchanmode: fixed
dev.pcm.0.play.vchanrate: 48000
dev.pcm.0.play.vchanformat: s16le:2.0
dev.pcm.0.play.32bit: 24
dev.pcm.0.rec.vchans: 1
dev.pcm.0.rec.vchanmode: fixed
dev.pcm.0.rec.vchanrate: 48000
dev.pcm.0.rec.vchanformat: s16le:2.0
dev.pcm.0.rec.32bit: 0
dev.pcm.0.rec.autosrc: 2
dev.pcm.0.buffersize: 65536
dev.pcm.0.bitperfect: 0
dev.pcm.1.%desc: Realtek ALC660 (Onboard Analog Line-out)
dev.pcm.1.%driver: pcm
dev.pcm.1.%location: nid=11
dev.pcm.1.%parent: hdaa0
dev.pcm.1.play.vchans: 1
dev.pcm.1.play.vchanmode: fixed
dev.pcm.1.play.vchanrate: 48000
dev.pcm.1.play.vchanformat: s16le:2.0
dev.pcm.1.play.32bit: 24
dev.pcm.1.buffersize: 65536
dev.pcm.1.bitperfect: 0
```


```
# dmesg | grep 'pcm[0-9]'
pcm0: <Realtek ALC660 (Rear Analog)> at nid 14 and 12,13 on hdaa0
pcm0: +--------------------------------------+
pcm0: | DUMPING PCM Playback/Record Channels |
pcm0: +--------------------------------------+
pcm0: 
pcm0: Playback:
pcm0: 
pcm0:      Stream cap: 0x00000001
pcm0:                  PCM
pcm0:         PCM cap: 0x000e0140
pcm0:                  16 20 24 bits, 48 96 KHz
pcm0:             DAC: 6
pcm0: 
pcm0: Record:
pcm0: 
pcm0:      Stream cap: 0x00000001
pcm0:                  PCM
pcm0:         PCM cap: 0x00020140
pcm0:                  16 bits, 48 96 KHz
pcm0:             DAC: 8
pcm0: 
pcm0: +-------------------------------+
pcm0: | DUMPING Playback/Record Paths |
pcm0: +-------------------------------+
pcm0: 
pcm0: Playback:
pcm0: 
pcm0:     nid=14 [pin: Headphones (Green Jack)]
pcm0:       |
pcm0:       + <- nid=25 [audio mixer] [src: pcm, mix]
pcm0:              |
pcm0:              + <- nid=6 [audio output] [src: pcm]
pcm0:              + <- nid=21 [audio mixer] [src: mix]
pcm0: 
pcm0: Record:
pcm0: 
pcm0:     nid=8 [audio input]
pcm0:       |
pcm0:       + <- nid=13 [pin: Mic (Pink Jack)] [src: mic]
pcm0:       + <- nid=12 [pin: Line-in (Blue Jack)] [src: line]
pcm0:       + <- nid=21 [audio mixer] [src: mix]
pcm0: 
pcm0: Input Mix:
pcm0: 
pcm0:     nid=21 [audio mixer]
pcm0:       |
pcm0:       + <- nid=20 [audio mixer] [src: mic]
pcm0:              |
pcm0:              + <- nid=13 [pin: Mic (Pink Jack)] [src: mic]
pcm0:       + <- nid=28 [audio mixer] [src: line]
pcm0:              |
pcm0:              + <- nid=12 [pin: Line-in (Blue Jack)] [src: line]
pcm0: 
pcm0: +-------------------------+
pcm0: | DUMPING Volume Controls |
pcm0: +-------------------------+
pcm0: 
pcm0: Master Volume (OSS: vol): 0/0dB
pcm0:    |
pcm0:    +- ctl  4 (nid   6 out):    mute
pcm0:    +- ctl 19 (nid  25 in   0): mute
pcm0:    +- ctl 20 (nid  25 in   1): mute
pcm0: 
pcm0: PCM Volume (OSS: pcm): 0/0dB
pcm0:    |
pcm0:    +- ctl  4 (nid   6 out):    mute
pcm0:    +- ctl 19 (nid  25 in   0): mute
pcm0: 
pcm0: Microphone Volume (OSS: mic): -6/33dB
pcm0:    |
pcm0:    +- ctl  6 (nid   8 in   0): -6/33dB (14 steps) + mute
pcm0:    +- ctl  7 (nid  20 in   0): mute
pcm0:    +- ctl 11 (nid  21 in   1): -36/33dB (24 steps) + mute
pcm0: 
pcm0: Line-in Volume (OSS: line): -36/33dB
pcm0:    |
pcm0:    +- ctl 12 (nid  21 in   2): -36/33dB (24 steps) + mute
pcm0:    +- ctl 29 (nid  28 in   0): mute
pcm0: 
pcm0: Speaker/Beep Volume (OSS: speaker): -45/0dB
pcm0:    |
pcm0:    +- ctl 31 (nid  35 out):    -45/0dB (16 steps) + mute
pcm0: 
pcm0: Recording Level (OSS: rec): -6/33dB
pcm0:    |
pcm0:    +- ctl  6 (nid   8 in   0): -6/33dB (14 steps) + mute
pcm0: 
pcm0: Input Mix Level (OSS: mix): -36/0dB
pcm0:    |
pcm0:    +- ctl  9 (nid  21 out):    -36/0dB (13 steps) + mute
pcm0:    +- ctl 20 (nid  25 in   1): mute
pcm0: 
pcm0: Input Monitoring Level (OSS: igain): 0/0dB
pcm0:    |
pcm0:    +- ctl 20 (nid  25 in   1): mute
pcm0: 
pcm0: Mixer "vol":
pcm0: Mixer "pcm":
pcm0: Mixer "speaker":
pcm0: Mixer "line":
pcm0: Mixer "mic":
pcm0: Mixer "mix":
pcm0: Mixer "rec":
pcm0: Mixer "igain":
pcm0: Soft PCM mixer ENABLED
pcm0: clone manager: deadline=750ms flags=0x8000001e
pcm0: sndbuf_setmap 36e40000, 10000; 0xd7b39000 -> 36e40000
pcm0: sndbuf_setmap 36e80000, 10000; 0xd7b79000 -> 36e80000
pcm0: Automatically set rec source to: mic
pcm1: <Realtek ALC660 (Onboard Analog Line-out)> at nid 11 on hdaa0
pcm1: +--------------------------------------+
pcm1: | DUMPING PCM Playback/Record Channels |
pcm1: +--------------------------------------+
pcm1: 
pcm1: Playback:
pcm1: 
pcm1:      Stream cap: 0x00000001
pcm1:                  PCM
pcm1:         PCM cap: 0x000e0140
pcm1:                  16 20 24 bits, 48 96 KHz
pcm1:             DAC: 3
pcm1: 
pcm1: +-------------------------------+
pcm1: | DUMPING Playback/Record Paths |
pcm1: +-------------------------------+
pcm1: 
pcm1: Playback:
pcm1: 
pcm1:     nid=11 [pin: Line-out (Fixed)]
pcm1:       |
pcm1:       + <- nid=22 [audio mixer] [src: pcm, mix]
pcm1:              |
pcm1:              + <- nid=3 [audio output] [src: pcm]
pcm1:              + <- nid=21 [audio mixer] [src: mix]
pcm1: 
pcm1: +-------------------------+
pcm1: | DUMPING Volume Controls |
pcm1: +-------------------------+
pcm1: 
pcm1: Master Volume (OSS: vol): 0/0dB
pcm1:    |
pcm1:    +- ctl  1 (nid   3 out):    mute
pcm1:    +- ctl 13 (nid  22 in   0): mute
pcm1:    +- ctl 14 (nid  22 in   1): mute
pcm1: 
pcm1: PCM Volume (OSS: pcm): 0/0dB
pcm1:    |
pcm1:    +- ctl  1 (nid   3 out):    mute
pcm1:    +- ctl 13 (nid  22 in   0): mute
pcm1: 
pcm1: Input Mix Level (OSS: mix)
pcm1:    |
pcm1:    +- ctl 14 (nid  22 in   1): mute
pcm1: 
pcm1: Input Monitoring Level (OSS: igain): 0/0dB
pcm1:    |
pcm1:    +- ctl 14 (nid  22 in   1): mute
pcm1: 
pcm1: Mixer "vol":
pcm1: Mixer "pcm":
pcm1: Mixer "igain":
pcm1: Soft PCM mixer ENABLED
pcm1: clone manager: deadline=750ms flags=0x8000001e
pcm1: sndbuf_setmap 36ec0000, 10000; 0xd7bb9000 -> 36ec0000
firmware: 'bwi_v3_pcm4' version 0: 1320 bytes loaded at 0xc81be7f4
firmware: 'bwi_v3_pcm5' version 0: 1320 bytes loaded at 0xc81bed1c
```

The sound card is working under Windows (built-in speakers, headset, Line-out). I would like to achieve sound card working at least through my headphones on FreeBSD. Please, help.


----------



## zspider (Apr 25, 2013)

Well, I do know that the ALC660 works with FreeBSD 9.1 on my Dell laptop, without any special configuration. So it may just be a matter of finding the right tweaks, but in the meantime try using the 9.0 snd_hda.ko.

I had the same problem with my newest acquisition a few months ago. Also an ASUS. So one morning I put in a 9.0 DVD, loaded the module and found my headphone jack worked. It mysteriously fixed itself sometime in the last couple of updates.


----------



## lubnet (Apr 27, 2013)

Thank you zspider. Yes, I tried FreeBSD 9.0 stable and its `snd_hda.ko`. Without success and with the same symptoms.

```
grep hda /var/log/messages.0
Apr 25 20:52:50 kernel: hdac0: <ATI SB450 HDA Controller> mem 0xfebf8000-0xfebfbfff irq 16 at device 20.2 on pci0
Apr 25 20:52:50 kernel: hdacc0: <Realtek ALC660 HDA CODEC> at cad 0 on hdac0
Apr 25 20:52:50 kernel: hdaa0: <Realtek ALC660 Audio Function Group> at nid 1 on hdacc0
Apr 25 20:52:50 kernel: pcm0: <Realtek ALC660 (Rear Analog)> at nid 14 and 12,13 on hdaa0
Apr 25 20:52:50 kernel: pcm1: <Realtek ALC660 (Onboard Analog Line-out)> at nid 11 on hdaa0
Apr 25 20:52:50 kernel: hdacc1: <Motorola (0x3055) HDA CODEC> at cad 1 on hdac0
Apr 25 20:52:50 kernel: unknown: <Motorola (0x3055) HDA CODEC Modem Function Group> at nid 1 on hdacc1 (no driver attached)
```
There is no driver for Motorola Modem. FreeBSD doesn't support it and I cannot turn the modem off at BIOS.

Can be this a reason? And in general, is there any way to make a sound card work due to this reason?


----------



## kpa (Apr 27, 2013)

I don't think that's the reason at all. The Motorola codec may be unsupported but the sound should work with the Realtek codec. Besides it looks like the Motorola codec is not a real audio codec but for modem functions.


----------



## zspider (May 5, 2013)

lubnet said:
			
		

> Thank you zspider. Yes, I tried FreeBSD 9.0 stable and its `snd_hda.ko`. Without success and with the same symptoms.
> 
> ```
> grep hda /var/log/messages.0
> ...



It may be something you can't fix yourself, you may have to gently nag to get it fixed. I never got an answer from anyone who could actually figure out my problem, but after some light and polite pestering, it mysteriously fixed itself in an update shortly after.


----------



## pzakup (Feb 8, 2014)

For my board (ASUS G1S):
`cat /dev/sndstat`

```
Installed devices:
pcm0: <Realtek ALC660-VD (Onboard Digital)> (play) [highlight]default
pcm1: <Realtek ALC660-VD (Onboard Analog Speaker)> (play)
```

To turn on built-in speakers:
`sysctl hw.snd.default_unit=1`


----------

