Ubuntu

pulseaudio does not recognize internal speakers [P180HMx, Realtek ALC892, Speaker, Internal] volume slider problem

Reported by The_Letter_J on 2013-10-08
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Undecided
David Henningsson
pulseaudio (Ubuntu)
Undecided
David Henningsson

Bug Description

steps to reproduce:
1. acquire a device with the problem, such as Clevo P180HM laptop motherboard
2. install ubuntu 12.04 (now updated to 12.04.3 currently)
3. systray > speaker-icon > sound-settings > output tab
4. no entry for "speakers built-in audio" appears

workaround:
running the shell script mentioned in this comment helps --
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/946232/comments/158

however, the workaround is not completely satisfactory, because
adjusting the (singular) volume-slider provided by pulseaudio only
causes some of the (multiple) volume-sliders known to alsamixer to react.
Specifically, turning the pulseaudio volume upwards only changes the
'master' and belatedly the 'pcm' volumes inside alsamixer. This ignores
'speaker clfe' + 'speaker front' + 'speaker surround playback volume'
plus maybe others. Effectively, this means audio playback is weak: instead
of spreading typical 2ch audiofiles across all internal speakers, only some
are used, and only at whatever volume alsamixer specifies. (Turning the
ignored volumes up in alsamixer causes a different problem: then it is no
longer possible to lower the sound to a relatively-quiet volume.)

Here is some information from one of the ubuntu pulseaudio/alsa devs:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/946232/comments/159
David Henningsso​n (<email address hidden>) wrote:
...you have unusual hardware: in addition to normal
headphones and stereo line out, you have 5.1 internal speakers. This
leads to unusual alsamixer names (e g "Speaker Front") which we do not
match for in PulseAudio. Fixing that means that we should add those
names in PulseAudio - but let's discuss that in a new bug instead.

Let me know if you would like more specifics. I have run codecgraph, alsa-info, etc.

$ cat /proc/asound/card*/codec#* | grep --before-context=4 --after-context=1 "Subsystem Id"
Codec: Realtek ALC892
Address: 0
AFG Function Id: 0x1 (unsol 1)
Vendor Id: 0x10ec0892
Subsystem Id: 0x15588000
Revision Id: 0x100302
--
Codec: ATI R6xx HDMI
Address: 0
AFG Function Id: 0x1 (unsol 0)
Vendor Id: 0x1002aa01
Subsystem Id: 0x00aa0100
Revision Id: 0x100200

$ lspci -vvnn | grep --after-context=1 "Audio device"
00:1b.0 Audio device [0403]: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller [8086:1c20] (rev 05)
 Subsystem: CLEVO/KAPOK Computer Device [1558:8000]
--
01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Barts HDMI Audio [Radeon HD 6800 Series] [1002:aa88]
 Subsystem: CLEVO/KAPOK Computer Device [1558:8000]

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: alsa-base 1.0.25+dfsg-0ubuntu1.1
ProcVersionSignature: Ubuntu 3.5.0-41.64~precise1-generic 3.5.7.21
Uname: Linux 3.5.0-41-generic x86_64
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.25.
ApportVersion: 2.0.1-0ubuntu17.4
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: j 6328 F.... pulseaudio
 /dev/snd/controlC0: j 6328 F.... pulseaudio
Card0.Amixer.info:
 Card hw:0 'PCH'/'HDA Intel PCH at 0xf7f00000 irq 52'
   Mixer name : 'Realtek ALC892'
   Components : 'HDA:10ec0892,15588000,00100302'
   Controls : 36
   Simple ctrls : 16
Card1.Amixer.info:
 Card hw:1 'Generic'/'HD-Audio Generic at 0xf7e40000 irq 54'
   Mixer name : 'ATI R6xx HDMI'
   Components : 'HDA:1002aa01,00aa0100,00100200'
   Controls : 6
   Simple ctrls : 1
Card1.Amixer.values:
 Simple mixer control 'IEC958',0
   Capabilities: pswitch pswitch-joined penum
   Playback channels: Mono
   Mono: Playback [on]
Date: Tue Oct 8 12:02:44 2013
InstallationMedia: This
MarkForUpload: True
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: alsa-driver
Symptom: audio
Symptom_Card: Built-in Audio - HDA Intel PCH
Symptom_Jack: Speaker, Internal
Symptom_Type: Volume slider, or mixer problems
Title: [P180HMx, Realtek ALC892, Speaker, Internal] volume slider problem
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 09/29/2011
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 4.6.4
dmi.board.asset.tag: Not Applicable
dmi.board.name: P180HMx
dmi.board.vendor: CLEVO
dmi.board.version: Not Applicable
dmi.chassis.asset.tag: Not Applicable
dmi.chassis.type: 10
dmi.chassis.vendor: CLEVO
dmi.chassis.version: Not Applicable
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr4.6.4:bd09/29/2011:svnCLEVO:pnP180HMx:pvrNotApplicable:rvnCLEVO:rnP180HMx:rvrNotApplicable:cvnCLEVO:ct10:cvrNotApplicable:
dmi.product.name: P180HMx
dmi.product.version: Not Applicable
dmi.sys.vendor: CLEVO

The_Letter_J (the-letter-j) wrote :
The_Letter_J (the-letter-j) wrote :

Please see attached textfile. Some of it is likely redundant with the auto-uploads collected by ubuntu-bug aka appport. I've tried to put the stuff I think is likely to be relevant at the top.

Raymond (superquad-vortex2) wrote :

post the output of alsa-info.sh

https://wiki.ubuntu.com/Audio/AlsaInfo

do you laptop have 5.1 internal speaker and support 7.1 external speaker (analog) ?

The_Letter_J (the-letter-j) wrote :

Hi Raymond, sorry about that, I thought I had posted it in the other thread. Please see attached.

The laptop has 5.1 physical speakers onboard, which I have test

and

there is some kind of unusual 7.1 output facility (I have never tried it) which involves using a large number of the output-jacks in some unholy combination :-) There are four 3.5mm jacks for hdfon/mic/spdif/LineOut on the righthand side of the laptop

and

there is some audio-processing-chipset on the MXM-physical-format videocard, used for hdmi-related audio-out (there is an hdmi-out jack on the lefthand side of the laptop). I have also never tested this.

Raymond (superquad-vortex2) wrote :

autoconfig: line_outs=1 (0x17/0x0/0x0/0x0/0x0) type:line
   speaker_outs=3 (0x14/0x16/0x15/0x0/0x0)
   hp_outs=1 (0x1b/0x0/0x0/0x0/0x0)
   mono: mono_out=0x0
   dig-out=0x1e/0x0
   inputs:
     Internal Mic=0x12
     Mic=0x18
     Line=0x1a

==> Best config: lo_type=0, wired=1, mio=0
multi_outs = 17/0/0/0 : 5/0/0/0 (type LO)
  out path: depth=3 :05:0f:17
hp_outs = 1b/0/0/0 : 25/0/0/0
  hp path: depth=3 :25:26:1b
spk_outs = 14/16/15/0 : 2/4/3/0
  spk path: depth=3 :02:0c:14
  spk path: depth=3 :04:0e:16
  spk path: depth=3 :03:0d:15

seem best config is not the above if it support external 7.1

multi_outs should contain hp , line in , mic and line out to support 7.1 by retasking mic and line in as output

 Pin Default 0x01211480: [Jack] HP Out at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0x8, Sequence = 0x0

 Pin Default 0x0181146f: [Jack] Line In at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0x6, Sequence = 0xf

 Pin Default 0x01a11c60: [Jack] Mic at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0x6, Sequence = 0x0

Pin Default 0x01011414: [Jack] Line Out at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0x1, Sequence = 0x4

does the user manual indicate the channel map for those jacks since they don't have same defassociation and accsending sequence ?

when hp and line out at same location , there is no point to mute the line out when headphone is plugged

Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Speaker Only' 'Line Out+Speaker'
  Item0: 'Line Out+Speaker'

Raymond (superquad-vortex2) wrote :

why do your test with 9 channels ?

you should test only 2 , 4 , 6 or 8 channels

speaker-test -c2 -t wav -Dhw:0,0

speaker-test -c4 -t wav -Dhw:0,0

speaker-test -c6 -t wav -Dhw:0,0

seem the driver did not create channel mode switch to retask the jack for external 7.1

speaker-test -c8 -t wav -Dhw:0,0

I guess the config is similar to targa-8ch-dig (notebook with 4 jacks)

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/?id=eb844d51cccca0ce9fad316da803f1bbe53d323b

Raymond (superquad-vortex2) wrote :

a dirty work-around may be to use hda-jack-retask to remove the line out jack and force the driver to put three speakers in multi_outs ,

when only one line out is in multi_outs, speakers were created as extra out which get the front channel

The_Letter_J (the-letter-j) wrote :

I was using 9 channels, in the posted test-run, because I was getting weird errors and out-of-orderings (so I'd been trying random numbering to see what I could get to work). Here is what happens when I run with 8ch instead of 9ch right now:

j@j-P180HMx:/usr/share/sounds/speech-dispatcher$ speaker-test -c 8 -l 1 -Ddefault
speaker-test 1.0.25
Playback device is default
Stream parameters are 48000Hz, S16_LE, 8 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 24 to 262144
Period size range from 8 to 87382
Using max buffer size 262144
Periods = 4
was set period_size = 65536
was set buffer_size = 262144
 0 - Front Left [loud]
 4 - Center [loud]
 1 - Front Right [loud]
 7 - Side Right [quiet_but_audible]
 3 - Rear Right [quiet_but_audible]
 2 - Rear Left [quiet_but_audible]
 6 - Side Left [quiet_but_audible]
 5 - LFE [silent]
Time per period = 25.117010

So, similar to what happens when I test 9ch, but with the numbering a bit odd. Is it supposed to be out-of-order like that?

Here is what happens when I run the commands you specified -- note that specifying another device-name *can* work.

$ speaker-test -c2 -t wav -Dhw:0,0
speaker-test 1.0.25
Playback device is hw:0,0
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 16384
Period size range from 32 to 8192
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
 0 - Front Left [works]
 1 - Front Right [works]
Time per period = 2.731724
^C

$ speaker-test -c4 -t wav -Dhw:0,0
speaker-test 1.0.25
Playback device is hw:0,0
Stream parameters are 48000Hz, S16_LE, 4 channels
WAV file(s)
Channels count (4) not available for playbacks: Invalid argument
Setting of hwparams failed: Invalid argument

j@j-P180HMx:~$ speaker-test -c6 -t wav -Dhw:0,0
speaker-test 1.0.25
Playback device is hw:0,0
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Channels count (6) not available for playbacks: Invalid argument
Setting of hwparams failed: Invalid argument

j@j-P180HMx:~$ speaker-test -c8 -t wav -Dhw:0,0
speaker-test 1.0.25
Playback device is hw:0,0
Stream parameters are 48000Hz, S16_LE, 8 channels
WAV file(s)
Channels count (8) not available for playbacks: Invalid argument
Setting of hwparams failed: Invalid argument

The_Letter_J (the-letter-j) wrote :

Re: maybe like the targa-8ch? I am not sure on that, it seems to have 2 speakers plus subwoofer on some laptops (e.g. MSI 660R laptop), and uses ALC882 chipset. However, I *did* notice in the patch you mentioned that there have been quirks for Clevo ALC882 units in the past -- maybe those can help?

My model has the ALC892 codec-chipset. Here is the service manual with schematics, made available by one of the Clevo reseller folks in the USA, which may have the details you need. My unit was from Malibal, another retailer, but is substantially identical.

http://forum.notebookreview.com/sager-clevo-reviews-owners-lounges/611401-official-sager-np8180-clevo-p180hm-owners-lounge-53.html#post8239603

PDF is about 5mb. On page eleven of the pdf-file (aka printed page ix roman numerals) you will see the table of contents. HTH.

Raymond (superquad-vortex2) wrote :

seem retask line out is not sufficicent, must also use hint to disable

multi_io = false

autoconfig: line_outs=3 (0x14/0x16/0x15/0x0/0x0) type:speaker
   speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
   hp_outs=1 (0x1b/0x0/0x0/0x0/0x0)
   mono: mono_out=0x0
   dig-out=0x1e/0x0
   inputs:
     Internal Mic=0x12
     Mic=0x18
     Line=0x1a

==> Best config: lo_type=1, wired=1, mio=1
multi_outs = 14/16/15/0 : 2/4/3/0 (type SP)
  out path: depth=3 :02:0c:14
  out path: depth=3 :04:0e:16
  out path: depth=3 :03:0d:15
hp_outs = 1b/0/0/0 : 5/0/0/0
  hp path: depth=3 :05:0f:1b

Raymond (superquad-vortex2) wrote :

since your internal speaker can only connected to single DAC

the driver need to assign DAC to 5.1/7.1 output before assign DAC to the headphone

-static const struct snd_kcontrol_new alc883_targa_mixer[] = {
- HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
- HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
- HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
- HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT),

Raymond (superquad-vortex2) wrote :

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/Documentation/sound/alsa/HD-Audio-Models.txt?id=1a97b7f22774b454531f013638b181803fba470f

- targa-8ch-dig Targa/MSI with 8-channel (MSI GX620)

refer to MSI GX620 user manual

Mic In: Used for an external microphone.
Connect the Center and Subwoofer speakers
here.

Line In: Used for an external audio device.
Connect the Rear speakers here.

Headphone out/SPDIF out : Used for speakers
or headphones. The SPDIF connector is also
provided for digital audio transmission to external
speakers through an optical fiber cable.
Connect the Front speakers here.

Line Out: A connector for speakers.
Connect the Surround speakers here.

David Henningsson (diwic) wrote :

> So, similar to what happens when I test 9ch, but with the numbering a bit odd. Is it supposed to be out-of-order like that?

I think this is by design, it's meant to "walk around the room in a circle" or something.

Anyway, I've made a patch for PulseAudio that I'd like you to test. In short, edit /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf, then restart your computer and test if there's any difference, both in stereo and surround profiles.

Here are the sections that should be added to analog-output-speaker.conf:

[Jack Speaker Front Phantom]
required-any = any
state.plugged = unknown
state.unplugged = unknown

[Element Speaker Front]
switch = mute
volume = merge
override-map.1 = all-front
override-map.2 = front-left,front-right
required-any = any

[Element Speaker Surround]
switch = mute
volume = merge
override-map.1 = all-rear
override-map.2 = rear-left,rear-right
required-any = any

[Element Speaker Side]
switch = mute
volume = merge
override-map.1 = all-side
override-map.2 = side-left,side-right

[Element Speaker CLFE]
switch = mute
volume = merge
override-map.1 = all-center
override-map.2 = all-center,lfe

David Henningsson (diwic) wrote :

Btw, before I forget about it: These names are missing characters in the end. It has probably been fixed in later kernels.

  name 'Speaker Surround Playback Volum'
  name 'Speaker Surround Playback Switc'

...it can cause these alsamixer controls not to be picked up by PulseAudio. Maybe it causes them not to show up in alsamixer either, but not sure about that.

However, having skimmed through your report, I'm a little worried about that you can't seem to get sound out of anything but the front speakers, is this correct? Your report only indicates which ones are silent and which ones aren't, not where each one comes out.

With all alsamixer controls at good values, this command should give you sound out of the speakers, one by one:

speaker-test -v -D plughw:PCH -t wav -c 6

Raymond (superquad-vortex2) wrote :

speaker-test -c4 -t wav -Dhw:0,0
speaker-test 1.0.25
Playback device is hw:0,0
Stream parameters are 48000Hz, S16_LE, 4 channels
WAV file(s)
Channels count (4) not available for playbacks: Invalid argument
Setting of hwparams failed: Invalid argument

it is because max_channels is still 2 when speakers are not in multi_outs

you need the driver to put those four jack at same location into multi_outs to set max_channels to 8

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/hda_generic.c?id=a07a949be6eb1c9aab06adaadce72dbd27b7d9cb

Raymond (superquad-vortex2) wrote :

if you have configured and compiled alsa driver with debug=verbose

the driver actually try to put mic and line in into multi_out but it did not select it as best config

==> lo_type=0, wired=0, mio=1, badness=0x8020
multi_outs = 17/0/0/0 : 5/2/3/0 (type LO)
  out path: depth=3 :05:0f:17
multi_ios(2) = 1a/18 : 2/3
  mio path: depth=3 :02:0c:1a
  mio path: depth=3 :03:0d:18
hp_outs = 1b/0/0/0 : 4/0/0/0
  hp path: depth=3 :04:0e:1b
spk_outs = 14/16/15/0 : 0/0/3/0
  spk path: depth=3 :03:0d:15

Raymond (superquad-vortex2) wrote :

clevo web site only have p180hm user manual

http://www.clevo.com.tw/en/e-services/download.asp

2-12Audio Features

Setup for 5.1 or 7.1 Surround Sound

To setup your system for 5.1 or 7.1 surround sound you will need to connect the audio cables to the Headphone-Out, Line-In, Microphone-In jack and S/PDIF-Out jacks (note: the S/PDIF jack is used for 7.1 surround sound only).

5.Plug the front speaker cables into the Headphone-Out Jack.

•Line-In Jack = Rear Speaker Out
•Microphone-In Jack = Center/Subwoofer Speaker Out
•S/PDIF-Out Jack = Side Speaker Out (for 7.1 Surround Sound Only

The_Letter_J (the-letter-j) wrote :
Download full text (7.9 KiB)

After composing a long and thoughful comment, with incredible pearls of wisdom, including a short and easy-to-implement plan for sustainable peace in the middle east within the year, I clicked the button to attach a screenshot, and got an error HTTP 414 Request-URI Too Large, The requested URL's length exceeds the capacity limit for this server. Apache/2.2.14 (Ubuntu) Server at api.launchpad.net Port 443. When I clicked the back-button, the page reloaded, and -- although firefox *tries* to retain textarea content for me -- launchpad managed to delete it. I was so angry, that I have now completely forgotten the inspired details of my peace plan! Please fix this thing, so that next time inspiration strikes me, your software will not be responsible for endless turmoil and bloodshed and bitterness. Workaround: always remember to click attach-button *first* and then and only then compose long thoughtful comment, which works fine. While I'm complaining: why is there no button to include multiple attachments in a single submission? Makes me have to piddle around zipping up my screenshots (or pasting multiple screenshots into a bigger PNG that is hand-edited...) or submit each upload as a separate comment. I also want a pony. https://en.wikipedia.org/wiki/WP:PONY

Since I composed some of my commentary in an external text-editor, here you go. I'm still working my way through your questions; these are just some quick answers to the low-hanging fruit. Gratitude for your help.

"David: worried about that you can't seem to get sound out of anything but the front speakers, is this correct?"
No... not really. I can get sound out of 'Center' as well, in some tests. I also get considerably-quieter-but-still-audible sound out of 'side&rear_left&right' named channels... but note that only five+plus+subwoofer physical speakers exist... not sure how to interpret that mismatch. It is difficult for me to pinpoint the physical location of 'side&rear_left&right' audio, but it is not coming from frontLeft or frontRight, that much is clear. ('Center' also seems distinct.) That said, I'm pretty sure I never get any audio at all from the subwoofer, in tests I have run so far. I removed the -v argswitch from your test; not supported on my box.

$ speaker-test --help
speaker-test 1.0.25
Usage: speaker-test [OPTION]...
-h,--help help
-D,--device playback device
-r,--rate stream rate in Hz
-c,--channels count of channels in stream
-f,--frequency sine wave frequency in Hz
-F,--format sample format
-b,--buffer ring buffer size in us
-p,--period period size in us
-P,--nperiods number of periods
-t,--test pink=use pink noise, sine=use sine wave, wav=WAV file
-l,--nloops specify number of loops to test, 0 = infinite
-s,--speaker single speaker test. Values 1=Left, 2=right, etc
-w,--wavfile Use the given WAV file as a test sound
-W,--wavdir Specify the directory containing WAV files
Recognized sample formats are: S8 S16_LE S16_BE FLOAT_LE S32_LE S32_BE

$ speaker-test -D plughw:PCH -t wav -c 6
speaker-test 1.0.25
Playback device is plughw:PCH
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer si...

Read more...

The_Letter_J (the-letter-j) wrote :

The service manual (link I posted earlier has PDF for download) has this.
pg14 says: External 7.1CH Audio Output Supported by Headphone, Microphone, Line-In and [spdif]Surround-Out Jacks
pg15 says: HDA compliant, S/PDIF digital output, five speakers, one subwoofer, built-in mic, THX TruStudio Pro
pg17 shows four jacks as circle#2/3/4/5 -- currently I do not have anything plugged into these jacks
pg17 shows frontLeft/frontRight as circle#1 -- these are 2W speakers (and work well)
pg16 shows rearLeft/rearRight as circle#3 -- these are 1.5W speakers (and seem too quiet... when they are exercised at all by testing so far)
pg19 shows subwoofer as circle#1 -- this is the 2W subwoof (I have never got this to produce any noise, I'm reasonably certain)
Not shown explicitly in the manual... but known to alsamixer and produces good volume... is the 'Center' speaker, also 2W. Methinks this one is under the touchpad/palmrest area, which is close enough to the frontLeft/frontRight speakers that it might be hard for me to tell it was working, as opposed to, say, pulseaudio driving frontLeft at 50% and frontRight at 50% to 'simulate' a center-channel-speaker.

Reseller page over here gives wattages -- http://xoticpcforums.com/showthread.php?12026-Sager-NP8180-%28Clevo-P180HM%29-Owners-Lounge
Audio specs: THX TruStudio Pro 5.1 HD audio with two 1.5W, three 2W speakers, and one 2W sub-woofer

"Raymond: To setup your system for [external] 5.1 or 7.1 surround sound you will need to connect the audio cables to the Headphone-Out, Line-In, Microphone-In jack and S/PDIF-Out jacks (note: the S/PDIF jack is used for 7.1 surround sound only)."

I believe that is correct for *external* speakers, but I have not used the laptop that way, yet. In all my tests so far, I have only been using the 5.1 onboard speakers, not external speakers. Well, correction: I have plugged some simple one-jack headphones into the hdfon jack, to see if that did the right thing; it seemed fine. (Some other alc892 systems have trouble muting and/or re-enabling the internal speakers when you plug and unplug headphones using the hdfon-jack.) Finally, note that there is a third audio-system potentially involved here, which is hdmi-out -- the videocard has a separate audio-chipset for that purpose, which I have not tested.

The_Letter_J (the-letter-j) wrote :

"Raymond: your Clevo P180HMX are similar to Clevo P170HM"

Yes, they are very similar systems: same ODM, same HM67 chipset, same cpu choices, same gpu choices (albeit 1 slot only), same bios vendor and flash-size, similar ports/sdxc/keyb/tpad/wcam/lan/wlan/bt. 4 so-dimms vs 3, 17.3" LCD (w/ optional 3D) vs 18.4", 2+1 raid0/1 bays vs 3+1 raid0/1/5, 2*usb2 vs 4*usb2, no eCard slot, 77WHr vs 89WHr, 4kg vs 6kg.

As far as the audio is concerned, cursory examination says they are very similar, both using ALC892, same number and type of onboard speakers, same number and type of onboard jacks, same style of 7.1 external output support. The only difference I noticed is that the P170HM says it has a 3-watt subwoofer, and I've heard mine has a 2-watt subwoofer.

The post you mentioned from Nov'11 suggested that the work on supporting the P170HM was unfinished; does anybody know what the current status is for supporting the P170HM audio stack? Maybe we can piggyback off that.

The_Letter_J (the-letter-j) wrote :

David, I'm applying your patch now, and preparing to reboot (lots of stuff open at the moment... will take a bit to get it all closed out and saved and such). Two questions:

1. both in stereo and surround profiles

I don't understand what this means. Where do I specify my audio-profile?

2. In future tests, would pulseaudio -k suffice, rather than a full reboot?

The_Letter_J (the-letter-j) wrote :

Looking at the P170HM in a little more detail, there are some difference in the audio subsystems. My p180hm uses TPA2008 amplifier for the subwoofer-slash-center output (and from the block diagram on pg56 of the pdf below it looks like there is only one physical speaker ... so maybe I'm confused and my laptop has no physically distinct 'center' speaker for 5.1 but really only has 4.1 onboard? and maybe when I hear sound from the 'Center' channel what is making noise is the subwoofer?) For the other speakers, there is a TPA6017 amp for the leftRear/rightRear speakers, and another TPA6017 amp for the leftFront/rightFront speakers, plus connections for the internal mic and the external quad-jack. Schematic for the alc892 is on pg84.

By contrast, the p170hm block diagram on pg60 of the other pdf below shows a similar wiring-layout, again with the ALC892 at the center, but this time with three TI TPA2008d2 amps for frontLeft/frontRight + surroundLeft/surroundRight + center/subwoofer, and distinct connections for the internal mic and the external quad-jack. Schematic for the alc892 is on pg90.

http://repo.palkeo.com/clevo-mirror/P18xHM/P18xHM_ESM.zip -- this is my 18" laptop
http://repo.palkeo.com/clevo-mirror/P170HM/P17xHM_ESM.zip -- this is the similar 17" laptop

Raymond (superquad-vortex2) wrote :

are you using latest alsa driver since you cannot playback 4 or 6 channles ?

using hda-emu , max channels is already 6 but channel still 0 for audio output 0x3 and 0x4
headphone , line out and all speakers get the front only

> PCM 0 p 48000 6 16
Open PCM ALC892 Analog for play
Available PCM parameters:
  channels: 2/6
  formats: S16_LE S32_LE
  rates: 44100 48000 96000 192000
Prepare PCM, rate=48000, channels=6, format=16 bits
PCM format_val = 0x15
hda_codec_cleanup_stream: NID=0x6
hda_codec_setup_stream: NID=0x5, stream=0x1, channel=0, format=0x15
send: NID=0x5, VERB=0xf06(get_channel_streamid), PARM=0x0
receive: 0x0
send: NID=0x5, VERB=0x706(set_channel_streamid), PARM=0x10
send: NID=0x5, VERB=0xa00(get_stream_format), PARM=0x0
receive: 0x0
send: NID=0x5, VERB=0x200(set_stream_format), PARM=0x15
hda_codec_setup_stream: NID=0x25, stream=0x1, channel=0, format=0x15
send: NID=0x25, VERB=0xf06(get_channel_streamid), PARM=0x0
receive: 0x0
send: NID=0x25, VERB=0x706(set_channel_streamid), PARM=0x10
send: NID=0x25, VERB=0xa00(get_stream_format), PARM=0x0
receive: 0x0
send: NID=0x25, VERB=0x200(set_stream_format), PARM=0x15
hda_codec_setup_stream: NID=0x2, stream=0x1, channel=0, format=0x15
send: NID=0x2, VERB=0xf06(get_channel_streamid), PARM=0x0
receive: 0x0
send: NID=0x2, VERB=0x706(set_channel_streamid), PARM=0x10
send: NID=0x2, VERB=0xa00(get_stream_format), PARM=0x0
receive: 0x0
send: NID=0x2, VERB=0x200(set_stream_format), PARM=0x15
hda_codec_setup_stream: NID=0x4, stream=0x1, channel=0, format=0x15
send: NID=0x4, VERB=0xf06(get_channel_streamid), PARM=0x0
receive: 0x0
send: NID=0x4, VERB=0x706(set_channel_streamid), PARM=0x10
send: NID=0x4, VERB=0xa00(get_stream_format), PARM=0x0
receive: 0x0
send: NID=0x4, VERB=0x200(set_stream_format), PARM=0x15
hda_codec_setup_stream: NID=0x3, stream=0x1, channel=0, format=0x15
send: NID=0x3, VERB=0xf06(get_channel_streamid), PARM=0x0
receive: 0x0
send: NID=0x3, VERB=0x706(set_channel_streamid), PARM=0x10
send: NID=0x3, VERB=0xa00(get_stream_format), PARM=0x0
receive: 0x0
send: NID=0x3, VERB=0x200(set_stream_format), PARM=0x15
PCM Clean up
hda_codec_cleanup_stream: NID=0x5
hda_codec_cleanup_stream: NID=0x25
hda_codec_cleanup_stream: NID=0x2
hda_codec_cleanup_stream: NID=0x4
hda_codec_cleanup_stream: NID=0x3
Close PCM

Raymond (superquad-vortex2) wrote :

to achieve

Plug the front speaker cables into the Headphone-Out Jack.

assign HP pin as first pin in multi_outs and get 0x2 as dac which share with speaker 0x14

assign two mio pins and share dac 0x03 and 0x04 with speaker 0x15 and 0x16

assign line out pin for side channel

either

http://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda?id=f811c3cf8fae63ecc8a937ba7376490e2565f8f1

- spec->gen.add_out_jack_modes = 1;
+ spec->gen.add_jack_modes = 1;

create the headphone Jack mode to switch HP pin as HP or line out

or

use a switch to change HP to use 0x25 for headphone playback volume and use 0x02 front volume for extvernal speaker

multi_outs = 1b/0/0/17 : 2/3/4/5
   out_path: depth=3 :02:0c:1b
   out path: depth=3 :05:0f:17
 multi_ios(2) = 1a/18 : 2/3
   mio path: depth=3 :03:0d:1a
   mio path: depth=3 :04:0e:18

 hp_outs = 1b/0/0/0 : 25/0/0/0
   hp path: depth=3 :25:26:1b

spk_outs = 14/16/15/0 : 2/4/3/0
   spk path: depth=3 :02:0c:14
   spk path: depth=3 :04:0e:16
   spk path: depth=3 :03:0d:15

David Henningsson (diwic) wrote :

Going through the comments, I hope I don't miss anything:

 > I removed the -v argswitch from your test; not supported on my box.

Sorry, confused speaker-test with aplay. Aplay has a -v switch that can give some debug information.

> 1. both in stereo and surround profiles
> I don't understand what this means. Where do I specify my audio-profile?

There should be a way to select profile - in Gnome sound settings it's a combobox called "Mode:", in pavucontrol it's on the configuration tab. However, now looking at your original PulseList.txt, the surround profile does not even show up, so we need to look at that first. Without that surround profile, anything that goes through pulseaudio will be stereo only.

> 2. In future tests, would pulseaudio -k suffice, rather than a full reboot?

Yes. Just make sure pulseaudio actually does restart.

In the case where we have both line out and more than stereo speakers,
the speaker DACs will end up in extra_out_nid.
In fact, AFAIU, speakers are the only ones that can end up in extra_out_nid,
and if we have several of those, they should be surround outputs
rather than copy front.

BugLink: https://bugs.launchpad.net/bugs/1236965
Signed-off-by: David Henningsson <email address hidden>
---
 sound/pci/hda/hda_codec.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

Notes:
 * Thanks to Raymond Yau for the pointer
 * Not tested (yet), except in hda-emu
 * Not sure if this should be sent to stable or not, given that it is a change of behaviour
 * Alsainfo available here:
   https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1236965/+attachment/3867946/+files/alsaInfoWhenAudioPlaybackFailing.txt

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 5b6c4e3..68801ba 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -5395,11 +5395,6 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
    snd_hda_codec_setup_stream(codec,
          mout->hp_out_nid[i],
          stream_tag, 0, format);
- for (i = 0; i < ARRAY_SIZE(mout->extra_out_nid); i++)
- if (!mout->no_share_stream && mout->extra_out_nid[i])
- snd_hda_codec_setup_stream(codec,
- mout->extra_out_nid[i],
- stream_tag, 0, format);

  /* surrounds */
  for (i = 1; i < mout->num_dacs; i++) {
@@ -5410,6 +5405,20 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
    snd_hda_codec_setup_stream(codec, nids[i], stream_tag,
          0, format);
  }
+
+ /* extra surrounds */
+ for (i = 0; i < ARRAY_SIZE(mout->extra_out_nid); i++) {
+ int ch = 0;
+ if (!mout->extra_out_nid[i])
+ break;
+ if (chs >= (i + 1) * 2)
+ ch = i * 2;
+ else if (!mout->no_share_stream)
+ break;
+ snd_hda_codec_setup_stream(codec, mout->extra_out_nid[i],
+ stream_tag, ch, format);
+ }
+
  return 0;
 }
 EXPORT_SYMBOL_HDA(snd_hda_multi_out_analog_prepare);
--
1.7.9.5

David Henningsson (diwic) wrote :

Hi,

So there might be more than one bug here. As Raymond pointed out, the surround speakers get front channel output rather than surround channels.
The patch I just posted fixes that, and to make it easier for you to test, I've also made a DKMS package. Please install it and reboot (or restart the entire alsa driver, but that might be tricky given intermodule dependencies).

This dkms package is based on the latest upstream code, so it should also fix the broken names ('Playback Volum' instead of 'Playback Volume').

Raymond (superquad-vortex2) wrote :

but subwoofer of some laptops are already using this feature to get the front channel when playing stereo

you need a switch to enable this surround for those laptop with 5.1 internal speakers and external 5.1/7.1 Line out

for (i = 0; i < ARRAY_SIZE(mout->extra_out_nid); i++)
- if (!mout->no_share_stream && mout->extra_out_nid[i]) {
- if (!mout->no_share_stream && mout->extra_out_nid[i]) {
+ if (mout->internal_51_speaker) {
+ snd_hda_codec_setup_stream(codec,
+ mout->extra_out_nid[i],
+ stream_tag, i * 2, format);
+ }
+ else {
+
  snd_hda_codec_setup_stream(codec,
  mout->extra_out_nid[i],
  stream_tag, 0, format);
+}
+}

Takashi Iwai (tiwai) wrote :

At Thu, 10 Oct 2013 09:01:25 +0200,
David Henningsson wrote:
>
> In the case where we have both line out and more than stereo speakers,
> the speaker DACs will end up in extra_out_nid.
> In fact, AFAIU, speakers are the only ones that can end up in extra_out_nid,
> and if we have several of those, they should be surround outputs
> rather than copy front.
>
> BugLink: https://bugs.launchpad.net/bugs/1236965
> Signed-off-by: David Henningsson <email address hidden>
> ---
> sound/pci/hda/hda_codec.c | 19 ++++++++++++++-----
> 1 file changed, 14 insertions(+), 5 deletions(-)
>
> Notes:
> * Thanks to Raymond Yau for the pointer
> * Not tested (yet), except in hda-emu
> * Not sure if this should be sent to stable or not, given that it is a change of behaviour
> * Alsainfo available here:
> https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1236965/+attachment/3867946/+files/alsaInfoWhenAudioPlaybackFailing.txt

Thanks, I applied this to for-next branch, as this is the behavior
fix. The copy of front channels are intentional in the current code,
so the patch isn't a "fix" but rather an enhancement, IMO.

Takashi

>
> diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
> index 5b6c4e3..68801ba 100644
> --- a/sound/pci/hda/hda_codec.c
> +++ b/sound/pci/hda/hda_codec.c
> @@ -5395,11 +5395,6 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
> snd_hda_codec_setup_stream(codec,
> mout->hp_out_nid[i],
> stream_tag, 0, format);
> - for (i = 0; i < ARRAY_SIZE(mout->extra_out_nid); i++)
> - if (!mout->no_share_stream && mout->extra_out_nid[i])
> - snd_hda_codec_setup_stream(codec,
> - mout->extra_out_nid[i],
> - stream_tag, 0, format);
>
> /* surrounds */
> for (i = 1; i < mout->num_dacs; i++) {
> @@ -5410,6 +5405,20 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
> snd_hda_codec_setup_stream(codec, nids[i], stream_tag,
> 0, format);
> }
> +
> + /* extra surrounds */
> + for (i = 0; i < ARRAY_SIZE(mout->extra_out_nid); i++) {
> + int ch = 0;
> + if (!mout->extra_out_nid[i])
> + break;
> + if (chs >= (i + 1) * 2)
> + ch = i * 2;
> + else if (!mout->no_share_stream)
> + break;
> + snd_hda_codec_setup_stream(codec, mout->extra_out_nid[i],
> + stream_tag, ch, format);
> + }
> +
> return 0;
> }
> EXPORT_SYMBOL_HDA(snd_hda_multi_out_analog_prepare);
> --
> 1.7.9.5
>

On 10/10/2013 09:16 AM, Raymond wrote:
> but subwoofer of some laptops are already using this feature to get the
> front channel when playing stereo

When playing stereo, "chs >= (i * 2) + 1" will be false and therefore it
will copy the front channel instead.

--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

Raymond (superquad-vortex2) wrote :

>when playing stereo, "chs >= (i * 2) + 1" will be false and therefore it
 will copy the front channel instead

the side effect of this copy front when you have 7.1 speaker with desktop

the stereo sound is copied to all speakers

speaker-test -c2 -t wav -D hw:0

as pulseaudio did not mute the rear, center/lfe and side even when you select stereo profile

The_Letter_J (the-letter-j) wrote :

Okay, I have applied this dotconf patch and rebooted -- https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1236965/comments/13

I notice no changes when I run $ speaker-test -D default -t wav -c 6
This test is utilizing only the onboard speakers, I have not plugged *anything* into any of the 3.5mm jacks.
I hear frontLeft/frontRight/Center loudly, rearLeft/rearRight quietly-but-audibly, and LFE-aka-subwoof-methinks not at all.

When I look in sound-settings, speakers-built-in entry is gone again (formerly fixed by comment#32 in other bug-thread)
After messing around in sound-settings looking for the surround-mode-button, got stuck in spdif-only-mode (which does not use internal speakers at all and thus causes speaker-test to be silent on all six channels).

$ ls ~/.pulse/client.conf
ls: cannot access /home/j/.pulse/client.conf: No such file or directory
$ echo autospawn = no >> ~/.pulse/client.conf
$ ps aux | grep -i pulseaudio | grep -v grep
j 2750 0.3 0.0 418188 6064 ? S<l 12:45 0:00 /usr/bin/pulseaudio --start --log-target=syslog
j 2754 0.0 0.0 95956 2980 ? S 12:45 0:00 /usr/lib/pulseaudio/pulse/gconf-helper
$ killall pulseaudio

$ ps aux | grep -i pulseaudio | grep -v grep
(no output)
$ espeak "Hi"
(works)
$ speaker-test -D default -t wav -c 6
(works kinda... only frontLeft/frontRight make any noise)

$ pulseaudio --start
$ ps aux | grep -i pulseaudio | grep -v grep
j 2860 3.2 0.0 418188 5684 ? S<l 12:52 0:00 pulseaudio --start
j 2864 0.0 0.0 95956 2984 ? S 12:52 0:00 /usr/lib/pulseaudio/pulse/gconf-helper
$ espeak "Hi"
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
$ speaker-test -D default -t wav -c 6
(all silent)

will try rebooting, and then start working my way through the recent comments. Should I apply david's dotdeb first, or should I try the latest alsa driver raymond suggests first? And, should I unapply the patch from comment#13, tested here?

The_Letter_J (the-letter-j) wrote :
Download full text (3.9 KiB)

Okay, upon reboot, I hear TheUbuntuDrumsOfSouthAfrica(tm) at the login screen,
but when i get to the desktop, the sound-indicator-icon has three dashes coming
out of the speaker, and when I open sound-settings I no longer see *any* entries
under the output tab (I would expect to see spdif + with luck speakersBuitIn),
nor any entries under the input tab either (I would expect to see internal_mic).

$ ps aux | grep -i pulseaudio | grep -v grep
(no output -- so my editing of ~/.pulse/client.conf apparently kept it from starting)

$ alsamixer
(looks fine)

$ speaker-test -D default -t wav -c 6 -l 1
speaker-test 1.0.25
Playback device is default
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 2048 to 8192
Period size range from 1024 to 1024
Using max buffer size 8192
Periods = 4
was set period_size = 1024
was set buffer_size = 8192
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 8.495962
(works for frontLeft/frontRight only, others silent)

j@j-P180HMx:~$ espeak "Hi"
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
(complains ... but speakers output the word 'hi' anyways)

$ pulseaudio --start
$ ps aux | grep -i pulseaudio | grep -v grep
j 2749 2.4 0.0 418188 5684 ? S<l 13:12 0:00 pulseaudio --start
j 2753 0.0 0.0 95956 2980 ? S 13:12 0:00 /usr/lib/pulseaudio/pulse/gconf-helper
$ speaker-test -D default -t wav -c 6 -l 1
(fail -- completely silent)
$ espeak "Hi"
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABI...

Read more...

The_Letter_J (the-letter-j) wrote :

Rrr. Methinks that using ubuntu-software-update overwrote my manually-applied dotconf patches.
I have re-applied the workaround from bug#946232 comment#32, and the patch from bug#1236965 comment#13.

j@j-P180HMx:~$ ls -l /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf
-rw-r--r-- 1 root root 3261 Sep 26 04:06 /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf
j@j-P180HMx:~$ ls -l /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf
-rw-r--r-- 1 root root 3231 Sep 26 04:06 /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf
j@j-P180HMx:~$ cp /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf ~/tmpUspapaos2.bak
j@j-P180HMx:~$ grep -v "required-any = any" /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf > ~/tmpUspapaos2.conf
j@j-P180HMx:~$ sudo cp ~/tmpUspapaos2.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf
j@j-P180HMx:~$ grep "required-any = any" /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf
j@j-P180HMx:~$ cp /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf ~/tmpUspapaiim2.bak
j@j-P180HMx:~$ grep -v "required-any = any" /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf > ~/tmpUspapaiim2.conf
j@j-P180HMx:~$ sudo cp ~/tmpUspapaiim2.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf
j@j-P180HMx:~$ grep "required-any = any" /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf
j@j-P180HMx:~$ ps aux | grep pulse | grep -v grep
j 2749 0.1 0.0 418188 6136 ? S<l 13:12 0:00 pulseaudio --start
j 2753 0.0 0.0 95956 2980 ? S 13:12 0:00 /usr/lib/pulseaudio/pulse/gconf-helper
j@j-P180HMx:~$ pulseaudio -k
j@j-P180HMx:~$ ps aux | grep pulse | grep -v grep
j@j-P180HMx:~$ pulseaudio --start
j@j-P180HMx:~$ ps aux | grep pulse | grep -v grep
j 2836 3.6 0.0 418172 5644 ? S<l 13:22 0:00 pulseaudio --start
j 2840 0.0 0.0 95956 2980 ? S 13:22 0:00 /usr/lib/pulseaudio/pulse/gconf-helper
j@j-P180HMx:~$ pulseaudio -k
j@j-P180HMx:~$ ps aux | grep pulse | grep -v grep
j@j-P180HMx:~$ sudo nano /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf
(apply patch#13)
j@j-P180HMx:~$ pulseaudio --start
j@j-P180HMx:~$ speaker-test -D default -t wav -c 6 -l 1
(frontLeft/Center/FrontRight loud, rearLeft/RearRight quieter, LFE dead silent)
j@j-P180HMx:~$ ls -l /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf
-rw-r--r-- 1 root root 3943 Oct 10 13:25 /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf
j@j-P180HMx:~$ ls -l /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf
-rw-r--r-- 1 root root 3060 Oct 10 13:22 /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf

So, we are back to where we are supposed to be. Built-in-spkrs *do* show in sound-settings again.
Sorry about the noise. Is there a way to pin these dotconfs so that ubuntu-auto-update will leave them be?

The_Letter_J (the-letter-j) wrote :

@Raymond in #24: "are you using latest alsa driver since you cannot playback 4 or 6 channles ?"

First of all, no, I'm using the stock 3.5.x series kernel that comes with Ubuntu 12.04.2
There are some instructions over here, from 2010, involving synaptic and Crackle-of-the-Day alsa drivers.
https://wiki.ubuntu.com/Audio/InstallingLinuxAlsaDriverModules
Should I try installing, using these instructions? Are there more recently-updated instructions?

Second of all, in *some* tests I can play back more than 2 channels, but in others I cannot; it depends on the args passed to speaker-test as to whether I hear more than two channels (and on whether pulseaudio is running/patched).
Note that I am only and always doing tests with the 5.1 built-in onboard internal speakers at the moment.
I have not tried doing any tests, at any point, with 7.1 external-speakers-connected-via-3.5mm-jacks.

@Raymond in #24: "using hda-emu , max channels is already 6"
"but channel still 0 for audio output 0x3 and 0x4"
"headphone , line out and all speakers get the front only"

So, you are running some tests on your end with https://github.com/tiwai/hda-emu ?
And passing in the alsa-info.txt that I generated. Since applying the dotconf patches,
I'm not sure the output will be the same anymore. Just in case, I'll run it again, see attached.
Do you want me to try running hda-emu on this end?

The_Letter_J (the-letter-j) wrote :

@Raymond in #25 , can you explain what you want me to do here a little more? I do not really understand your request.

@David in #26, "Where do I specify my audio-profile?" There should be a way to select profile - in Gnome sound settings it's a combobox called Mode:

I do not see this combobox of which you speak. Are you talking about the righthand pane of the output-tab, when I have clicked on speakers-built-in? It still believes there are only two channels.

@David in #26, in pavucontrol it's on the config tab.

Here there are two dropdowns, one for the 'built-in audio' which is the realtek alc892, with the default settings Analog Stereo Duplex, the others options being Analog Stereo Output, Digital Stereo (IEC 598) Output Plus Analog Stereo Input, Digital Stereo (IEC 598) Output, Analog Stereo Input, Off. (in other words no mention of internal 5.1 onboard speakers that I can tell).

The other dropdown, for the hdmi-oriented soundcard-chip on the discrete gpu, defaults to Digital Stereo (HDMI) Output, with the only other option being Off.

@Raymond in #27, sorry, I am not sure I know what you want me to do. Can you spell it out a bit more please?
In particular, do you suggest that I follow the 2010 instructions for installing the local alsa crackle-of-dawn driver... or does the dotdeb which david provided contain the changes you were wanting me to make?

@David in #29, have installed the dotdeb. This also required that I first $ sudo apt-get install dkms -- see attached build-log.
Will reboot, and then let you know what happens in the next comment. Stay tuned for the next exciting episode.

The_Letter_J (the-letter-j) wrote :
Download full text (9.8 KiB)

Upon booting with dkms+dotdeb#29 installed, had triple-dash by spkr-icon in systray (still have autospawn=no).
Ran espeak, worked (same errors as usual).
Ran speaker-test, found new and interesting problems.
$ speaker-test -D default -t wav -c 6 -l 1

speaker-test 1.0.25

Playback device is default
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 2048 to 8192
Period size range from 1024 to 1024
Using max buffer size 8192
Periods = 4
was set period_size = 1024
was set buffer_size = 8192
 0 - Front Left
 4 - Center
Write error: -32,Broken pipe
Write error: -32,Broken pipe
 1 - Front Right
Write error: -32,Broken pipe
Write error: -32,Broken pipe
 3 - Rear Right
Write error: -32,Broken pipe
Write error: -32,Broken pipe
 2 - Rear Left
Write error: -32,Broken pipe
Write error: -32,Broken pipe
 5 - LFE
Write error: -32,Broken pipe
Time per period = 26.014328

FrontLeft and FrontRight functioned... there was also some audible pop-pop sounds during the test, and FrontRight was not a clean playback-attempt (it paused-slash-glitched in the middle of the words). See also, errors above. Alsa-info.txt attached

Next, started up pulseaudio, which caused the systray-spkr-icon to have rparens again.

j@j-P180HMx:~$ ps aux | grep -i pulseaudio | grep -v grep
j@j-P180HMx:~$ pulseaudio --start
j@j-P180HMx:~$ ps aux | grep -i pulseaudio | grep -v grep
j 3032 7.5 0.0 418176 5664 ? S<l 14:41 0:00 pulseaudio --start
j 3036 0.0 0.0 95956 2980 ? S 14:41 0:00 /usr/lib/pulseaudio/pulse/gconf-helper

espeak still works (albeit still with the usual errors)
$ speaker-test -D default -t wav -c 6 -l 1

speaker-test 1.0.25

Playback device is default
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 32 to 349525
Period size range from 10 to 116509
Using max buffer size 349524
Periods = 4
was set period_size = 87381
was set buffer_size = 349524
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 10.817687
(this test worked much better -- no broken-pipe-write-errors for starters, plus all sounds were clear and non-glitchy)
(still silent for LFE, and still quiter-than-maybe-is-proper for rearLeft and rearRight, however).

Opening up sound-settings from the systray, we see new and interesting content in the lefthand and righthand panels.
the output tab now offers:
 digital output (spdif) built-in audio [been around a long time but relatively useless with nothing plugged in]
 analog output built-in audio [newly visible now that dotdeb#29 is installed]
 speaker built-in audio [visible due to workaround#32 from other thread... but righthand panel now improved]

the righthand panel for spdif shows:
balance, greyed-out fade, greyed-out subwoofer, test sound btn (when clicked offers only frontLeft/frontRight subtests)

the righthand panel for the new analog-output entry shows:
balance, fade (non-grey), subwoofer (non-grey), mode dropdown (default Analog Surround...

The_Letter_J (the-letter-j) wrote :

this is before I ran pulseaudio --start , roughly the same timeframe that I was getting write-errors from speaker-test

The_Letter_J (the-letter-j) wrote :

this is when pulseaudio was running, and 5.1 was configured properly, and everything was working reasonably well

The_Letter_J (the-letter-j) wrote :

@Raymond #33 , when I execute that test, I hear sound out of the appropriate speakers ("front left" comes out of FrontLeft). This is with the dotdeb installed, and profile set to 5.1 surround

$ speaker-test -c2 -t wav -D hw:0
speaker-test 1.0.25
Playback device is hw:0
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 16384
Period size range from 32 to 8192
Using max buffer size 16384
Periods = 4
was set period_size = 4096
was set buffer_size = 16384
 0 - Front Left
 1 - Front Right
Time per period = 2.731614

p.s. this test, I'm pretty sure is not exercising my subwoofer... it says 'rear center' and seems to come from the same physical speaker as the 'front center' output comes from. Is there some lower-level command I can use to generate a pure tone from the subwoofer, so I can compare and contrast the location?

$ speaker-test -c6 -t wav -D hw:0 -s 6
speaker-test 1.0.25
Playback device is hw:0
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 22 to 5461
Period size range from 11 to 2730
Using max buffer size 5460
Periods = 4
was set period_size = 1365
was set buffer_size = 5460
  - LFE

Raymond (superquad-vortex2) wrote :

whether patch at comment 13 really need depend on the naming of the volume control

for a notebook with internal 5.1 speakers need a 8 or 10 channels hda codec, it is rather strange that it cannot provide external 5.1/7.1 with three/four jacks

so far those 10 channels hda codecs still does not have 6 or 7 volume controls for internal 5.1 and external 5.1/7.1

The_Letter_J (the-letter-j) wrote :

Raymond: "for a notebook with internal 5.1 speakers ... it is rather strange that it cannot provide external 5.1/7.1 with three/four jacks"

The user manual says it *can* do both

1) internal 5.1 using the onboard speakers, or alternatively
2) external 7.1 output using the four 3.5mm jacks.

But in fact I have not *tested* whether it can do #2 properly, i.e. external 7.1 output, because until dotdeb#29 was installed, I could never get all the #1 internal onboard speakers to work.

Are you seeing stuff in the alsa-info that make you think 7.1 is not working? (I have not tested that config remember.)

Raymond (superquad-vortex2) wrote :

you have to follow up with Takashi Iwai if you want support of external 5.1/7.1

badness 0x8020 = two BAD_NO_DAC + 0x20

==> lo_type=0, wired=0, mio=1, badness=0x8020
 multi_outs = 17/0/0/0 : 5/2/3/0 (type LO)
   out path: depth=3 :05:0f:17
 multi_ios(2) = 1a/18 : 2/3
   mio path: depth=3 :02:0c:1a
   mio path: depth=3 :03:0d:18
 hp_outs = 1b/0/0/0 : 4/0/0/0
   hp path: depth=3 :04:0e:1b
 spk_outs = 14/16/15/0 : 0/0/3/0
   spk path: depth=3 :03:0d:15

/* badness definition */
enum {
 /* No primary DAC is found for the main output */
 BAD_NO_PRIMARY_DAC = 0x10000,
 /* No DAC is found for the extra output */
 BAD_NO_DAC = 0x4000,
 /* No possible multi-ios */
 BAD_MULTI_IO = 0x120,
 /* No individual DAC for extra output */
 BAD_NO_EXTRA_DAC = 0x102,
 /* No individual DAC for extra surrounds */
 BAD_NO_EXTRA_SURR_DAC = 0x101,
 /* Primary DAC shared with main surrounds */
 BAD_SHARED_SURROUND = 0x100,
 /* No independent HP possible */
 BAD_NO_INDEP_HP = 0x10,
 /* Primary DAC shared with main CLFE */
 BAD_SHARED_CLFE = 0x10,
 /* Primary DAC shared with extra surrounds */
 BAD_SHARED_EXTRA_SURROUND = 0x10,
 /* Volume widget is shared */
 BAD_SHARED_VOL = 0x10,
};

The_Letter_J (the-letter-j) wrote :

Here is the current state. This is a big improvement over what I started out with, where sound-settings would not show anything but spdif (and since that was not plugged into anything no sound could be heard...)

The_Letter_J (the-letter-j) wrote :

"you have to follow up with Takashi Iwai if you want support of external 5.1/7.1"

Okay -- but help me understand what you think I should do next. See my questions in
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1236965/comments/38

You have give me links to several patchfiles, and suggested I compile my own alsa driver.
Is that still what I should try now? Is there a howto which explains the steps to take?

I can see in comment#45 you are showing me an enum from some C code... but where should I put it?

Thanks for your patience. I'm trying to catch up with where you are telling me to go. :-)

Raymond (superquad-vortex2) wrote :

the name of this volume control is confusing since only line out is connected to this audio output

Node 0x05 [Audio Output] wcaps 0x41d: Stereo Amp-Out
  Control: name="PCM Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Device: name="ALC892 Analog", type="Audio", device=0
  Amp-Out caps: ofs=0x40, nsteps=0x40, stepsize=0x03, mute=0
  Amp-Out vals: [0x2d 0x2d]
  Converter: stream=8, channel=0
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Power states: D0 D1 D2 D3 EPSS
  Power: setting=D0, actual=D0

The_Letter_J (the-letter-j) wrote :

here is my old codecgraph.png , from when no patches were installed

The_Letter_J (the-letter-j) wrote :

here is the current one, with dotdeb#29 installed.

it looks like 0x05 leads eventually to [Jack] Line out at external rear stereo

Am I reading it correctly? Do you not think it should look like that?

Raymond (superquad-vortex2) wrote :

This should be "Front Playback Switch" in current implementation or "Side Playback Switch" when 7.1 is supported

Node 0x17 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Control: name="PCM Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Line Out Jack", index=0, device=0
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals: [0x00 0x00]
  Pincap 0x00000036: IN OUT Detect Trigger
  Pin Default 0x01011414: [Jack] Line Out at Ext Rear
    Conn = 1/8, Color = Black
    DefAssociation = 0x1, Sequence = 0x4
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=02, enabled=1
  Power states: D0 D1 D2 D3 EPSS
  Power: setting=D0, actual=D0
  Connection: 1
     0x0f

Raymond (superquad-vortex2) wrote :

the current implementation is based on the jack retasking standard of 5.1 support with 3 audio jack (line out, mic and line in ) at rear panel of desktop

http://www.intel.com/support/motherboards/desktop/sb/CS-034198.htm

it is not easy to assign your line out jack as side channel without changing the logic in function fill_multi_ios() in hda_generic.c

it still not support of 7.1 for those 5 jacks at rear panel (e.g. Intel dh67bl alc892 without grey jack)

still no channel mode switch from 6 to 8

https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/878345

Raymond (superquad-vortex2) wrote :

if only external 5.1 is needed, you may use hda-jack-retask or early patching to make two internal speakers not connected and reboot

this is similar to the standard 3stack model of desktop

David Henningsson (diwic) wrote :

I'm wading through the comments here, let me know if I'm missing something...

Anyway, if PulseAudio is not running, don't expect this to work:

 1) the sound preferences dialog
 2) pavucontrol (naturally)
 3) A little unsure about speaker-test with "-D default". -D default means to go through pulseaudio normally, but if pulseaudio's not running, it should automatically reroute itself. To be specific you can use either "-D pulse" (always goes through pulseaudio, will complain if it's not running) or "-D plughw:PCH" (where PCH is the card name) to always bypass pulseaudio.

> https://wiki.ubuntu.com/Audio/InstallingLinuxAlsaDriverModules
> Should I try installing, using these instructions? Are there more recently-updated instructions?

Sorry, the support has been discontinued of this method. I've now updated the wiki page(s) to reflect this.

The DKMS package I gave you is the better way to upgrade your ALSA drivers. The patch I sent was applied upstreamed yesterday, so automatic DKMS builds will pick this up from today too.

> Sorry about the noise. Is there a way to pin these dotconfs so that ubuntu-auto-update will leave them be?

Not really. I've brought it up for some quick discussion upstream a while ago but I don't think it went anywhere.

Anyway, with my suggested patch to the pulseaudio conf files (that adds "Speaker Front" etc sections), you should no longer need any workaround from bug 946232. Sorry if this was not clear.

> 2) external 7.1 output using the four 3.5mm jacks. But in fact I have not *tested* whether it can do #2 properly, i.e. external
> 7.1 output, because until dotdeb#29 was installed, I could never get all the #1 internal onboard speakers to work. Are you
> seeing stuff in the alsa-info that make you think 7.1 is not working? (I have not tested that config remember.)

Raymond seems very much into analyzing why the driver doesn't currently support external 7.1, and he's posting his thoughts about why. I'm more into trying to get your 5.1 internal speakers up and running because that's the problem you ask about.

So, given that your system has
 * DKMS package with latest driver installed (the one I gave you) and
 * PulseAudio patch for "Speaker Front"

...both installed, where do we stand? Everything working as it should, except the subwoofer?

The_Letter_J (the-letter-j) wrote :
Download full text (3.4 KiB)

1. Do we *know* that external 7.1 does not currently work, with dotdeb#29 installed? I have not tested it. Is there a vu-meter app that will show me when external 7.1 jacks are being correctly exercised, without needing to plug in all the physical 3.5mm wires that actual 7.1 external testing would typically necessitate?

2. dotdeb#29 and dotconf#13 are both installed, and seem to be working -- I am a little worried that my next ubuntu update will wipe them out, however (the dotconf change seems especially likely to suffer this fate).

3. I'm not 100% positive the subwoofer is failing to woof... all the speakers are within a few inches of each other. But yes, I currently believe that 'LFE' which is now verbalized as 'rear center' is incorrectly outputting through the physical '(front) Center' speaker, instead of the desired physical subwoof. Do you have some sample 5.1 audio-files which exercise each speaker in turn? Or is that no different than speaker-test with six channels specified....

4. Should I 'unapply' the comment#32 workaround, or no need to mess with that?

5. I need to delete ~/.pulse/pulse.conf so that pulseaudio will be automatically active when the machine boots.

6. I am willing to compile an alsa driver, or whatever, if that will help Raymond test his theories. I'm not sure how to make a custom dkms dotdeb package of my own, however. See also point one above -- maybe it is already working, we just don't know it yet.

7. Raymond mentioned the bug where plugging in the hdfons fails to auto-mute the internal speakers; that was marked as fixed in 12.04, and indeed it works for me with dotdeb#29 installed (and also worked before).

8. Raymond thinks that 'PCM' for out-node 0x05 is a dumb name... and I tend to agree. Back before workaround#32, however, when the machine first booted it was defaulting to using that node as the default audio-sink, and then sound-settings was getting me stuck with node 0x06 aka spdif which is not plugged into anything as the 'selected' new default audio-sink. Following the dark lines in codecgraph's SVG output, node 0x05 pcm_out is connected via mixer#0x0f over to pin#0x17 which is labelled "jack line out at ext rear stereo, in out detect trigger". Is that a problem?

0x02_out = speaker front , mix 0x0c, pin 0x14 fixed speaker at int atapi hp eapd , recursive via mix 0x0b/0x22/0x23
0x03_out = speaker clfe , mix 0x0d , ping 0x15 fixed spkr at int atapi , recursive via mix 0x0b/0x22/0x23
0x04_out = speaker surround, mix 0x0e , pin 0x16 fixed spkr at int atapi , recursive via mix 0x0b/0x22/0x23
0x05_out = pcm , mix 0x0f , pin 0x17 jack line out at ext rear , recursive via mix 0x0b/0x22/0x23
pin 0x1A line in at ext rear , connects 'recursively' to the main four outputs via mix 0x0B
pin 0x18 mic at ext rear , connects 'recursively' to the main four outputs via mix 0x0B

0x06_digital_out = spdif iec958 , no mix shown , pin 0x1e jack spdif out at ext rear digital
0x10_digital_out = noName_notEnabled , no mix shown , pin 0x11 N/A spkr at ext rear digital
0x25_out = headphones , mix 0x26 , pin 0x1B jack hp out at ext rear hp eapd
0x09_in = capture , mix 0x22, pin 0x12 fixe...

Read more...

David Henningsson (diwic) wrote :

1. Given what both Raymond and I see in hda-emu, I believe 7.1 (through four external jacks) does not work. Any vu-meter would probably skip enough layers to make the test not reliable.

3. I believe the speaker test in "Sound Settings" outputs a rumble rather than "Rear Center", if that helps.

4. Do as you wish. I should upstream my "Speaker Front" stuff to PulseAudio anyhow.

8. I agree - PCM is a bad name. It should be something like "Line Out Front" instead. Maybe I should try changing that too, but that will bring in a new name for which we don't have support in PulseAudio, so that would need an additional patch for PulseAudio too.

The_Letter_J (the-letter-j) wrote :

On page 85 of p180hm_svc_manual.pdf , there is a diagram that shows how the subwoofer and center-speaker are wired up.
ALC892 pin 43&44 aka 'port G' is hooked into the PI5A3158, and from there into the TPA2008 amp...
http://www.pericom.com/products/signal-switch-ic-multiplexers/?part=PI5A3158
Dual single-pole dual-throw mux/de-mux switch.... The wire controlling the PI5A3158 is called 'DOLBY_SEL'

The control-signal is emitted by the IT8519 chip, on pg90 of the pdf, which is the keyb/smbus/lpc/gpio/uart/rtc/adc/dac/etc chip.

There is a similar PI5A3158 chip used to wire up the surround-out-left and surround-out-right speakers, aka rearLeft/rearRight.
And the control wire has the same label... so maybe we are already properly controlling DOLBY_SEL for rearLeft/rearRight, since those seem to work fine, and we therefore just need to apply the same sort of control when trying to activate frontCenter/subwoofer?

Raymond (superquad-vortex2) wrote :

it is possible to test the external 7,1 support with speaker-test -c 8 -t wav -Dhw:0,0

Just use hda-jack-retask to change

hp to line out with defAssoc 1 seq 0 ,
line in to line out with defAssoc 1 seq 1
mic to line out with defAssoc 1 seq 2
line out with defAssoc 1 seq 3

0x15 speaker to [N/A]
0x16 speaker to [N/A]

David Henningsson (diwic) wrote :

Judging from the service manual, it seems unlikely that if you output something to the LFE channel, it would actually end up in the front center speaker instead. So my guess is that it is actually the subwoofer you hear when you test it.

Raymond (superquad-vortex2) wrote :

try channel check

http://www.dolby.com/us/en/consumer/technology/home-theater/dolby-digital-plus-download.html

mplayer -channel 8 -ao alsa:device=hw=0

Early Patching
~~~~~~~~~~~~~~
When CONFIG_SND_HDA_PATCH_LOADER=y is set, you can pass a "patch" as a
firmware file for modifying the HD-audio setup before initializing the
codec. This can work basically like the reconfiguration via sysfs in
the above, but it does it before the first codec configuration.

A patch file is a plain text file which looks like below:

------------------------------------------------------------------------
  [codec]
  0x12345678 0xabcd1234 2

0x10ec0892 0x15588000 0

  [model]
  auto

  [pincfg]
  0x15 0x411111f0
  0x16 0x411111f0
  0x1b 0x01011410
  0x18 0x01011411
  0x1a 0x01011412
  0x17 0x01011413

  [hint]
add_jack_modes = true

------------------------------------------------------------------------

The hd-audio driver reads the file via request_firmware(). Thus,
a patch file has to be located on the appropriate firmware path,
typically, /lib/firmware. For example, when you pass the option
`patch=hda-init.fw`, the file /lib/firmware/hda-init.fw must be
present.

The patch module option is specific to each card instance, and you
need to give one file name for each instance, separated by commas.
For example, if you have two cards, one for an on-board analog and one
for an HDMI video board, you may pass patch option like below:
------------------------------------------------------------------------
    options snd-hda-intel patch=on-board-patch,hdmi-patch

Raymond (superquad-vortex2) wrote :

http://www.mplayerhq.hu/DOCS/HTML/en/advaudio-surround.html

mplayer -channels 8 -ao alsa:device=hw=0

Raymond (superquad-vortex2) wrote :

can you post the output of

pactl list or pulseaudio verbose log

Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Speaker Only' 'Line Out+Speaker'
  Item0: 'Line Out+Speaker'

since you have Headphone, Line Out and Speaker , should there be three ports instead of two ?

 ports:
  analog-output-speaker: Speakers (priority 10000, available: unknown)
   properties:

  analog-output-headphones: Headphones (priority 9000, available: no)
   properties:

Changed in alsa-driver (Ubuntu):
status: New → Incomplete
David Henningsson (diwic) wrote :

> since you have Headphone, Line Out and Speaker , should there be three ports instead of two ?

It's a known issue. I've added a Line Out profile upstream, it's not yet in Ubuntu. http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa/mixer/paths/analog-output-lineout.conf?id=ecf3ab2b5788c85c237eeb6429bd1d525b9ac0cc

Raymond (superquad-vortex2) wrote :

but there is no way for pulseaudio know when the user change the headphone into Line Out using "Headphone Jack Mode" switch

once you completed

1) 6 channels internal speaker
2) 6 channels external and stereo speaker
3) 8 channels external and stereo speaker

you can discuss with Tiwai how to combine these three condition

Raymond (superquad-vortex2) wrote :

to combine 1) and 2) mean that you have to reduce the badness 0c8020 to zero

as the two mio paths can be share dac with two speaker paths

Raymond (superquad-vortex2) wrote :

to combine 2) and 3) is similar to a desktop with three audio jack at rear panel and use the front panel headphone as side channel

http://www.gigabyte.us/products/product-page.aspx?pid=3806#sp

2/4/5.1/7.1-channel
* To enable 7.1-channel audio, you have to use an HD front panel audio module and enable the multi-channel audio feature through the audio driver.

These kcontrol names have started to show up lately, especially in
combination with surround internal speakers.

BugLink: https://bugs.launchpad.net/bugs/1236965
Signed-off-by: David Henningsson <email address hidden>
---
 .../alsa/mixer/paths/analog-output-speaker.conf | 31 ++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/src/modules/alsa/mixer/paths/analog-output-speaker.conf b/src/modules/alsa/mixer/paths/analog-output-speaker.conf
index ccd438f..d79fad1 100644
--- a/src/modules/alsa/mixer/paths/analog-output-speaker.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-speaker.conf
@@ -38,6 +38,11 @@ required-any = any
 state.plugged = unknown
 state.unplugged = unknown

+[Jack Speaker Front Phantom]
+required-any = any
+state.plugged = unknown
+state.unplugged = unknown
+
 [Element Hardware Master]
 switch = mute
 volume = merge
@@ -88,6 +93,13 @@ override-map.1 = all-front
 override-map.2 = front-left,front-right
 required-any = any

+[Element Speaker Front]
+switch = mute
+volume = merge
+override-map.1 = all-front
+override-map.2 = front-left,front-right
+required-any = any
+
 [Element Rear]
 switch = mute
 volume = merge
@@ -107,12 +119,25 @@ override-map.1 = all-rear
 override-map.2 = rear-left,rear-right
 required-any = any

+[Element Speaker Surround]
+switch = mute
+volume = merge
+override-map.1 = all-rear
+override-map.2 = rear-left,rear-right
+required-any = any
+
 [Element Side]
 switch = mute
 volume = merge
 override-map.1 = all-side
 override-map.2 = side-left,side-right

+[Element Speaker Side]
+switch = mute
+volume = merge
+override-map.1 = all-side
+override-map.2 = side-left,side-right
+
 [Element Center]
 switch = mute
 volume = merge
@@ -152,4 +177,10 @@ volume = merge
 override-map.1 = all-center
 override-map.2 = all-center,lfe

+[Element Speaker CLFE]
+switch = mute
+volume = merge
+override-map.1 = all-center
+override-map.2 = all-center,lfe
+
 .include analog-output.conf.common
--
1.7.9.5

affects: alsa-driver (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu):
status: Incomplete → Fix Committed
assignee: nobody → David Henningsson (diwic)
Changed in pulseaudio (Ubuntu):
status: New → In Progress
assignee: nobody → David Henningsson (diwic)

On Mon, 2013-10-14 at 16:16 +0200, David Henningsson wrote:
> These kcontrol names have started to show up lately, especially in
> combination with surround internal speakers.
>
> BugLink: https://bugs.launchpad.net/bugs/1236965
> Signed-off-by: David Henningsson <email address hidden>
> ---
> .../alsa/mixer/paths/analog-output-speaker.conf | 31 ++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/src/modules/alsa/mixer/paths/analog-output-speaker.conf b/src/modules/alsa/mixer/paths/analog-output-speaker.conf
> index ccd438f..d79fad1 100644
> --- a/src/modules/alsa/mixer/paths/analog-output-speaker.conf
> +++ b/src/modules/alsa/mixer/paths/analog-output-speaker.conf
> @@ -38,6 +38,11 @@ required-any = any
> state.plugged = unknown
> state.unplugged = unknown
>
> +[Jack Speaker Front Phantom]
> +required-any = any
> +state.plugged = unknown
> +state.unplugged = unknown
> +
> [Element Hardware Master]
> switch = mute
> volume = merge
> @@ -88,6 +93,13 @@ override-map.1 = all-front
> override-map.2 = front-left,front-right
> required-any = any
>
> +[Element Speaker Front]
> +switch = mute
> +volume = merge
> +override-map.1 = all-front
> +override-map.2 = front-left,front-right
> +required-any = any
> +
> [Element Rear]
> switch = mute
> volume = merge
> @@ -107,12 +119,25 @@ override-map.1 = all-rear
> override-map.2 = rear-left,rear-right
> required-any = any
>
> +[Element Speaker Surround]
> +switch = mute
> +volume = merge
> +override-map.1 = all-rear
> +override-map.2 = rear-left,rear-right
> +required-any = any
> +
> [Element Side]
> switch = mute
> volume = merge
> override-map.1 = all-side
> override-map.2 = side-left,side-right
>
> +[Element Speaker Side]
> +switch = mute
> +volume = merge
> +override-map.1 = all-side
> +override-map.2 = side-left,side-right
> +
> [Element Center]
> switch = mute
> volume = merge
> @@ -152,4 +177,10 @@ volume = merge
> override-map.1 = all-center
> override-map.2 = all-center,lfe
>
> +[Element Speaker CLFE]
> +switch = mute
> +volume = merge
> +override-map.1 = all-center
> +override-map.2 = all-center,lfe
> +
> .include analog-output.conf.common

Should these elements be muted in other paths?

--
Tanu

Raymond (superquad-vortex2) wrote :

The reason why Line Out get "PCM Playback Volume" and "PCM Playback Switch", line out is put in multi_out but multi_ios is still zero because of badness 0x8020

 /* for a single channel output, we don't have to name the channel */
 if (cfg->line_outs == 1 && !spec->multi_ios)
  return "PCM";

Raymond (superquad-vortex2) wrote :

    if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
        err = try_assign_dacs(codec, cfg->speaker_outs,
                      cfg->speaker_pins,
                      spec->multiout.extra_out_nid,
                      spec->speaker_paths,
                      spec->extra_out_badness);
        if (err < 0)
            return err;
+ if (cfg->speaker_outs != 3)
        badness += err;
    }

external 5.1 (channel mode switch) seem can be enabled in hda-emu by ignoring extra out badness when there are three internal speakers

"Speaker Surround Playback Volume" and "Speaker CLFE" changed to "Surround Playback Volume", "Center Playback Volume" and "LFE Playack Volume"
"PCM playback Volume" and "PCM playback Switch" change to "Front Playback volume" and "Front Playback Switch"

what's missing is the external 7.1 ( using headphone jack)

autoconfig: line_outs=1 (0x17/0x0/0x0/0x0/0x0) type:line
   speaker_outs=3 (0x14/0x16/0x15/0x0/0x0)
   hp_outs=1 (0x1b/0x0/0x0/0x0/0x0)
   mono: mono_out=0x0
   dig-out=0x1e/0x0
   inputs:
     Internal Mic=0x12
     Mic=0x18
     Line=0x1a

==> Best config: lo_type=0, wired=0, mio=1
multi_outs = 17/0/0/0 : 5/2/3/0 (type LO)
  out path: depth=3 :05:0f:17
multi_ios(2) = 1a/18 : 2/3
  mio path: depth=3 :02:0c:1a
  mio path: depth=3 :03:0d:18
hp_outs = 1b/0/0/0 : 4/0/0/0
  hp path: depth=3 :04:0e:1b
spk_outs = 14/16/15/0 : 0/0/3/0
  spk path: depth=3 :03:0d:15

CTRL: add: Channel Mode:0
CTRL: add: Front Playback Volume:0
CTRL: add: Front Playback Switch:0
CTRL: add: Surround Playback Volume:0
CTRL: add: Surround Playback Switch:0
CTRL: add: Center Playback Volume:0
CTRL: add: LFE Playback Volume:0
CTRL: add: Center Playback Switch:0
CTRL: add: LFE Playback Switch:0
CTRL: add: Headphone Playback Volume:0
CTRL: add: Headphone Playback Switch:0
CTRL: add: Speaker CLFE Playback Switch:0

CTRL: add: Line Out Jack:0
JACK created Line Out, type 4
JACK report Line Out, status 0
CTRL: add: Headphone Jack:0
JACK created Headphone, type 1
JACK report Headphone, status 0
CTRL: add: Speaker Front Phantom Jack:0
CTL Notify: Speaker Front Phantom Jack:0, mask=1
CTRL: add: Speaker Surround Phantom Jack:0
CTL Notify: Speaker Surround Phantom Jack:0, mask=1
CTRL: add: Speaker CLFE Phantom Jack:0
CTL Notify: Speaker CLFE Phantom Jack:0, mask=1

David Henningsson (diwic) wrote :

On 10/14/2013 04:38 PM, Tanu Kaskinen wrote:
> On Mon, 2013-10-14 at 16:16 +0200, David Henningsson wrote:
>> +[Element Speaker CLFE]
>> +switch = mute
>> +volume = merge
>> +override-map.1 = all-center
>> +override-map.2 = all-center,lfe
>> +
>> .include analog-output.conf.common
>
> Should these elements be muted in other paths?

Good point. I've just added that and sent out a v2.

--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

Changed in pulseaudio (Ubuntu):
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers