Re: [pulseaudio-discuss] Microphone not being detected after reboot

2016-04-20 Thread Raymond Yau
>
> So every time I reboot, pulse doesn't 'see' my mic anymore. I reboot and
pavucontrol shows this: https://i.imgur.com/ivFBCII.png As you can see, no
mic under input devices, the whole device is missing that would normally
show a drop-down menu to select front, rear or line-in. Then I simply pull
my mic out of the microphone jack and plug it back it and voila:
https://i.imgur.com/bCcI7h2.png My mic is there and it works. This happens
every time I reboot. This is my alsa-info.sh output after having rebooted,
with no microphone visible in pavucontrol: http://lpaste.net/159686
> And this is alsa-info after having taken out the mic and plugging it back
in, it works now:
> http://lpaste.net/159687

This is because your front audio panel does not support jack detection,
your uefi set misc bit of pin default.

The jack state of your front HP and front Mic are unknown, pulseaudio only
know line in is not available.

Front Mic and rear Mic are available
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] alsa sink latency - how to account for startup delay

2016-04-15 Thread Raymond Yau
>>
>>
>> >
>> >> do loopback module assume sink is not running when it start source
capture?
>> >>
>> > Sink and source are started independently. Source data is discarded
until the sink-input has
>> > called pop() the first time.
>>
>> But you cannot skip more than 9ms source data since you need 1ms( or
25ms fragment time when not using timer schedule mode) to capture
>>
>> If you are using usb as source and hda as sink, hda fifo trigger dma
transfer whenever the fifo fill level is less than fifo threshold, you need
to fill 256 bytes at first write to avoid fifo underrun
>>
>>
> Yes, if the source takes too long to start up, there will be an an
underrun.
> But as I said, I fill the memblockq with silence to the full requested
> end-to-end latency before starting source or sink. This is usually
sufficient
> to avoid underruns at startup.
> Additionally the new loopback code contains an underrun protection,
> if the configured end-to-end latency is too small. After 3 underruns it
> will increase the target latency by 5 ms until no underruns occur.
>
>

Your method require source and sink suppport same rate and format, how
about usb webcam mic support only 16000Hz and hda sink which do not support
16000Hz?

How about those fixed latency sound cards which does not support latency
adjust (e.g. granularity is period time 25ms)  pcm pointer only increase by
period size when interrupt occur


ar 30 21:46:01 pico1 pulseaudio[11846]: [alsa-sink-USB Audio] alsa-sink.c:
Starting playback.

Mar 30 21:46:01 pico1 pulseaudio[11846]: [pulseaudio]
module-suspend-on-idle.c: Sink
alsa_output.usb-0d8c_C-Media_USB_Headphone_Set-00.analog-stereo becomes
idle, timeout in 5 seconds.

Mar 30 21:46:01 pico1 pulseaudio[11846]: [alsa-sink-USB Audio] ratelimit.c:
322 events suppressed

Mar 30 21:46:01 pico1 pulseaudio[11846]: [alsa-sink-USB Audio] alsa-sink.c:
Cutting sleep time for the initial iterations by half.

Mar 30 21:46:01 pico1 pulseaudio[11846]: [alsa-sink-USB Audio] alsa-sink.c:
Cutting sleep time for the initial iterations by half.

why 322 events suppressed ?


0 21:46:01 pico1 pulseaudio[11846]: [pulseaudio] module-loopback.c: Minimum
possible latency: 2,50

Mar 30 21:46:01 pico1 pulseaudio[11846]: [alsa-sink-USB Audio] alsa-sink.c:
Cutting sleep time for the initial iterations by half.

Mar 30 21:46:01 pico1 pulseaudio[11846]: [alsa-sink-USB Audio] alsa-sink.c:
Cutting sleep time for the initial iterations by half.

will module loopback stop when user specify latency less than minimum
possible ?


How do you know there is no underrun when stop threshold is set to boundary?

How do you recover underrun when source capture less data than sink
playback?  Do loopback inject some data?

The lowest latency is hardware dependent, will the loopback module
recalcuate  after user switch sink or source  ?

Neither alsa avail nor delay increase like a straight line, the main
problem is you don't know the process time for your to skip and copy data
from input to output,

how can the latency be accurate?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] alsa sink latency - how to account for startup delay

2016-04-13 Thread Raymond Yau
>
>> do loopback module assume sink is not running when it start source
capture?
>>
> Sink and source are started independently. Source data is discarded until
the sink-input has
> called pop() the first time.

But you cannot skip more than 9ms source data since you need 1ms( or  25ms
fragment time when not using timer schedule mode)  to capture

If you are using usb as source and hda as sink, hda fifo trigger dma
transfer whenever the fifo fill level is less than fifo threshold, you need
to fill 256 bytes at first write to avoid fifo underrun
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Splitting a 7.1 device into virtual 5.1 + 2.0 devices?

2016-04-10 Thread Raymond Yau
>
> Sorry for the late reply, had a busy week.
>
> > The easy way is to use hdajackretask your grey line out as internal
> > speaker, there will be headphone, 5.1 line out jacks and stereo speaker
> I tried that (removing the remap config), but for some reason the only
thing pavucontrol now sees is a single audio device that is able to
playback at most 5.1 channels. I can't re-route sound to anything else in
pavucontrol and the stereo speaker output is silent. I tried both internal
speaker and internal speaker (back)

https://lists.freedesktop.org/archives/pulseaudio-discuss/2016-April/025971.html

Try enable independent headphone and disable pulseaudio mute if you want
two sinks, you can configure the grey jack as second headphone jack
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] alsa sink latency - how to account for startup delay

2016-04-08 Thread Raymond Yau
t to you privately because the part about
>>> module-loopback
>>> is still missing.
>>> Anyway, even if you think it is wrong I am still measuring the correct
>>> end-to-end latency with my code, so something I am doing must be
>>> right ...
>>
>> >From what I can tell, that's a coincidence.
>
>
> No, it definitely isn't. If you accept the precondition, that samples
> not simply vanish from the latency reports, it's physics.
> I would tend to agree that I have overlooked something, if the "extra
> delay" would be the same every time and if I could not write down
> the math for it.
> But it isn't completely constant (just in the same range) and I can
> write down the math and it matches my measurements. So I am
> fairly sure that I am right. Did you have a look at my document?
>
>
>>
>>>> I don't know how well this model reflects the reality of how the usb
>>>> audio driver works, but this model seems like a plausible explanation
>>>> for why the driver reports delays equalling the amount of written data
>>>> in the beginning, and why the real latency is higher than the reported
>>>> latency at later times.
>>>>
>>>> I hope this also clarifies why I don't buy your argument that the time
>>>> stamp difference is somehow related to the unreported latency.
>>>
>>>   No, in fact it doesn't.
>>>
>>>>> Trying to fix up that delay on every iteration does not make any sense
>>>>> at all, it is there from the start and it is constant.
>>>>
>>>>   Commenting on "it is constant": The playback latency is the sum of
data
>>>> in various buffers. The DAC consumes one sample at a time from the very
>>>> last buffer, but I presume that all other places move data in bigger
>>>> chunks than one sample. The unreported delay can only be constant if
>>>> data moves to the invisible part of the buffering in one sample chunks.
>>>> Otherwise the latency goes down every time the DAC reads a sample, and
>>>> then when the buffer is refilled at the other end, the latency jumps up
>>>> by the refill amount.
>>>
>>>   I only said the "extra latency" is constant, not the latency as such.
>>> See your own example above that your argument is wrong. Even
>>> if the audio is moved in chunks through your invisible buffer part,
>>> that part still has the same length all the time. When one "d" is
>>> moved forward another one will replace it.
>>
>> No, the invisible part is not constant, even though my presentation
>> didn't show the variance. The DAC consumes data from the invisible
>> buffer one sample at a time, and each time it does that, the extra
>> latency decreases by one sample. Data moves from the visible part of
>> the buffer to the invisible part in bigger chunks. I didn't specify the
>> chunk size, but if we assume 1 ms chunks, the extra latency grows by 1
>> ms every time a chunk is transferred from the visible part to the
>> invisible part.
>
>
> Then take any part of the buffer but the last or the first bit. All the
> chunks are always full, so it's constant. The moving bit is dealt with
> elsewhere, (in the smoother) but there is a lot of buffer that is always
> full.
> And when you take USB, the driver sees only chunks. The sample
> by sample consuming of the DAC is never seen by the driver, it gets
> the notification from USB that a chunk has been played.
> I'm not sure how it is with HDA, but probably similar.
>
>>
>>>>> This is not a negative delay reported by alsa, but my "extra latency"
>>>>> is getting negative, which means playback must have started
>>>>> before snd_pcm_start().
>>>>> According to Raymond Yau playback seems in fact to be started
>>>>> before snd_pcm_start() for HDA devices, at least if I read his last
>>>>> mail on that topic right. Then the negative delays would even make
>>>>> sense, since data is written to the buffer before snd_pcm_start().
>>>>
>>>>   I had a look at the code to verify the claim that we configure alsa
to
>>>> start playback already before we call snd_pcm_start(). If we really do
>>>> that intentionally, then it doesn't make sense to call snd_pcm_start()
>>>> explicitly.
>>>>
>>>> This is what we do:
>>>> snd_pcm_sw_params_set_start_threshold(pcm, swparams,
(snd_pcm_uframes_t) -1)
>>>>
>>>> Note the casting of -1 to

Re: [pulseaudio-discuss] alsa sink latency - how to account for startup delay

2016-04-07 Thread Raymond Yau
>> The capture device may already started by other application (e.g. mic
peak of pavucontrol), there is some audio already captured by driver but
not read by server
>>
>> At low latency, usb pointer incremented by number of frames in urb
packet but hda intel increment by frames in dma brust
>>
>> Do the result different when you use hda-intel as source and usb audio
for playback?
>>
>
> It depends on what delay you mean. The delay I am talking about
> above stays the same, but as already said the individual sinks and
> sources have additional small delays of their own. So moving the
> source from HDA to USB increases the overall latency by about 1ms.
>

If the granularity of two sound cards are differenct? Hda  32 frames but
usb use 44.1 frames ?? Do you have enough frames to start usb audio when
using hda as source after receive 32 frames

>
>> It is unlikey module loopback can achieve lowest latency when you cannot
control start,  capture and playback of alsa sink and source
>>
>> It should have latency higher than snd-aloop,  alsaloop or latency.c
>>
>
> The low limit of module-loopback seems to be around 5ms end-to-end latency
> for HDA -> HDA. At this point tons of "memblock.c: Pool full" messages
appear
> in the log and going below 5ms will always lead to underruns.

#define TSCHED_MIN_SLEEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms */ #define
TSCHED_MIN_WAKEUP_USEC (4*PA_USEC_PER_MSEC) /* 4ms */

It is because hda use timer base scheduling which has min sleep and
watermark

Are there any difference when enable/ disable timer base scheduling for usb
audio?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] alsa sink latency - how to account for startup delay

2016-04-05 Thread Raymond Yau
>>>
>>> 5) The pulseaudio sink code takes the first 10ms of audio out of the
>>> loopback buffer,
>>> writes it to the alsa buffer and calls snd_pcm_start().
>>
>> If the sink takes something from the loopback buffer, this means that
>> the first pop() call has been made. Assuming no time has passed since
>> the previous step, the USB bus is still full, and so is the ring
>> buffer. Expected delay: 20 ms.
>
> Reported delay is exactly the amount of audio that was written to
> the buffer.

 That's the bug that I think should be fixed in alsa if possible (and if
 it's impossible, I don't see how it could be fixed in pulseaudio
 either).
>>>
>>> It can be fixed (or at least be worked around). If you take a time stamp
>>> at the moment when snd_pcm_start() is called and another when
>>> the first audio has definitely been played (delay < write_count), then
>>> the difference between the time stamps corrected by the amount
>>> of audio that has already been played, gives you exactly that
>>> missing bit of latency.
>>
>> I can't follow that line of reasoning. In the beginning the ring buffer
>> is filled to max, and once you call snd_pcm_start(), data starts to
>> move from the ring buffer to other buffers (I'll call the other buffers
>> the "not-ring-buffer"). Apparently the driver "sees" the not-ring-
>> buffer only partially, since it reports a larger latency than just the
>> ring buffer fill level, but it still doesn't report the full latency.
>> The time between snd_pcm_start() and the point where the reported delay
>> does not any more equal the written amount tells the size of the
>> visible part of the not-ring-buffer - it's the time it took for the
>> first sample to travel from the ring buffer to the invisible part of
>> the not-ring-buffer. I don't understand how the time could say anything
>> about the size of the invisible part of the not-ring-buffer. Your logic
>> "works" only if the visible and invisible parts happen to be of the
>> same size.
>>
>> You should get the same results by calculating
>>
>>adjusted delay = ring buffer fill level + 2 * (reported delay - ring
buffer fill level)
>>
>> That formula doesn't make sense, but that's how I understand your logic
>> works, with the difference that your fix is based on one measurement
>> only, so it's constant over time, while my formula recalculates the
>> adjustment every time the delay is queried, so the adjustment size
>> varies somewhat depending on the granularity at which audio moves to
>> and from the visible part of the not-ring-buffer.
>>
>> In any case, even if your logic actually makes sense and I'm just
>> misunderstanding something, I don't see why the correction should be
>> done in pulseaudio instead of the alsa driver.
>
>
> Well, now I don't understand what you mean. The logic is very simple:
> If there is a not reported delay between the time snd_pcm_start() is
> called and the time when the first sample is delivered to the DAC, then
> this delay will persist and become part of the continuous latency.
> That's all, what causes the delay is completely irrelevant.
>
> Maybe what I said above was not complete. At the point in time when
> the first audio is played, there are two delays: First the one that is
reported
> by alsa and the other is the difference between the time stamps minus
> the played audio. If these two delays don't match, then there is an
> "extra delay" that has to be taken into account.
> Trying to fix up that delay on every iteration does not make any sense
> at all, it is there from the start and it is constant.
>
> You are actually right - the problem should be fixed in the alsa driver,
> but that should not hinder pulseaudio to work around the issue for
> multiple reasons:
> 1) It is relatively easy to work around
> 2) If the problem is fixed in the alsa driver, the delay would just be
> 0 and so have no impact anymore. This means there is no need
> to change the code after the bug has been fixed in alsa.
> 3) If there is another driver out there with the same or a similar bug,
> (which I think is not unlikely) pulseaudio would do the right thing and
> fix it up.
> 4) When it is fixed in the alsa driver pulseaudio should still be able to
> deliver the right values with a not fixed driver - at least for some time
> until old versions of the alsa driver have died out.

The capture device may already started by other application (e.g. mic peak
of pavucontrol), there is some audio already captured by driver but not
read by server

At low latency, usb pointer incremented by number of frames in urb packet
but hda intel increment by frames in dma brust

Do the result different when you use hda-intel as source and usb audio for
playback?

It is unlikey module loopback can achieve lowest latency when you cannot
control start,  capture and playback of alsa sink and source

It should have latency higher than snd-aloop,  alsaloop or latency.c

How can I 

Re: [pulseaudio-discuss] Splitting ALSA card ports into

2016-04-03 Thread Raymond Yau
 > I am trying to get simultaneous output on the Line Out and Headphones
 > outputs of my Intel HD Audio (AsRock Z97 motherboard) chipset and PC
 > case. With the default pulseaudio configuration in pavucontrol I can
 > choose Analog Stereo Duplex and then select either the "Line Out" or
 > "Headphones" port under "Output Devices", but I would like to have
 > simultaneous output on both (by having a seperate sink for each).
 >
 > Here is my alsa-info.sh output, please ignore the NVidia output
 > provided by my GPU as I would like to not use it if possible:
 >
>>>
>>>
>>>
http://www.alsa-project.org/db/?f=b7e5097f7a899aa5294b147b23cbb877db3b6f3c

 > And this is what "pacmd list-sinks" says about the Built-In audio
sink:
 > http://hastebin.com/bonadehimu

 It's not possible to have independent line out and headphone output on
 your hardware. There is only one analog device on your card.

 --
>>>
>>>
>>> The easy way to output same audio to both output is disable drivers auto
>>> mute mode and change pulseaudio conf files
>>>
>>> Simple mixer control 'Auto-Mute Mode',0
>>> Capabilities: enum
>>> Items: 'Disabled' 'Enabled'
>>> Item0: 'Enabled'
>>>
>>>
>>>
http://www.intel.com/content/www/us/en/support/boards-and-kits/desktop-boards/07156.html
>>>
>>>
>>>
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/HD-Audio.txt
>>>
>>> You have to ask Tiwai to enable independent hp for your realtek codec on
>>> desktop ( e.g. no internal mic and hda controller
>>> support enough SDO)
>>>
>>> You can specify hint indep_hp=1 by early patching,  the driver
>>> automatically disable automute when you switch on independent hp switch
>>>
>>>
>>>
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/HD-Audio-Controls.txt
>>>
>>> Independent HP When this enum control is enabled, the headphone output
is
>>> routed from an individual stream (the third PCM such as hw:0,2) instead
of
>>> the primary stream
>>
>>
>> Okay, so following your advice I set up modprobe.d to specify the
>> early-patching files:
>>
>> $ cat /etc/modprobe.d/snd_hda_intel.conf
>> options snd_hda_intel patch=onboard-patch,hdmi-patch
>>
>> and specified the hint in /lib/firmware/onboard-patch:
>>
>> $ cat /lib/firmware/onboard-patch
>> [codec]
>> 0x10ec0892 0x1849d892 0
>>
>> [hint]
>> indep_hp = 1
>>
>> this seems to work fine, I can query the card hints and indep_hp shows
up:
>>
>> $ cat /sys/class/sound/hwC0D0/hints
>> indep_hp = 1
>>
>> but pulseaudio still only shows one sink. Do I need to manually load
>> another sink module?
>
>
> also, my alsa-info after now:
http://www.alsa-project.org/db/?f=f7de54b96d1cb50391d638e3bc687730daf17a2f
>
> so there now is a new "Alt-Analog" playback device:
>
> >
> APLAY
>
>  List of PLAYBACK Hardware Devices 
> card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 0: PCH [HDA Intel PCH], device 2: ALC892 Alt Analog [ALC892 Alt
Analog]
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
>
> ARECORD
>
>  List of CAPTURE Hardware Devices 
> card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 0: PCH [HDA Intel PCH], device 2: ALC892 Alt Analog [ALC892 Alt
Analog]
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
>
>
> So I tried adding a second module-alsa-card:
>
> $ pacmd load-module module-alsa-sink card_name=alsa_card.pci-_00_1b.2
> Module load failed
>
> (changed the .0 to .2 because thats the Alt Analog right?)

You also need hint

jack_detect=no

https://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/paths/analog-output-headphones.conf

Don't mute surround71 playback switches and don't turn off  volume

https://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/paths/analog-output-lineout.conf

Don't mute headphone playback switch and don't turn off volume

You need to enable 'independent hp' and set 'input source',1 to front mic
before starting  pulseaudio server

Simple mixer control 'Independent HP',0
Capabilities: enum
Items: 'Disabled' 'Enabled'
Item0: 'Enabled'

Simple mixer control 'Input Source',1
Capabilities: cenum
Items: 'Front Mic' 'Rear Mic' 'Line'
Item0: 'Front Mic'

Use application (e.g. mplayer) which allow you to specify device hw:0,2

https://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/profile-sets/default.conf

Just add a new mapping

[Mapping alt-analog-stereo]
device-strings = hw:%f,2
channel-map = left,right
paths-output = analog-output-headphones
paths-input = analog-input-front-mic
priority = 10
___
pulseaudio-discuss mailing list

Re: [pulseaudio-discuss] Splitting ALSA card ports into seperate Sinks

2016-04-02 Thread Raymond Yau
> > Hello everyone,
> > I am trying to get simultaneous output on the Line Out and Headphones
> > outputs of my Intel HD Audio (AsRock Z97 motherboard) chipset and PC
> > case. With the default pulseaudio configuration in pavucontrol I can
> > choose Analog Stereo Duplex and then select either the "Line Out" or
> > "Headphones" port under "Output Devices", but I would like to have
> > simultaneous output on both (by having a seperate sink for each).
> >
> > Here is my alsa-info.sh output, please ignore the NVidia output
> > provided by my GPU as I would like to not use it if possible:
> >
http://www.alsa-project.org/db/?f=b7e5097f7a899aa5294b147b23cbb877db3b6f3c
> > And this is what "pacmd list-sinks" says about the Built-In audio sink:
> > http://hastebin.com/bonadehimu
>
> It's not possible to have independent line out and headphone output on
> your hardware. There is only one analog device on your card.
>
> --

The easy way to output same audio to both output is disable drivers auto
mute mode and change pulseaudio conf files

Simple mixer control 'Auto-Mute Mode',0
Capabilities: enum
Items: 'Disabled' 'Enabled'
Item0: 'Enabled'

http://www.intel.com/content/www/us/en/support/boards-and-kits/desktop-boards/07156.html

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/HD-Audio.txt

You have to ask Tiwai to enable independent hp for your realtek codec on
desktop ( e.g. no internal mic and hda controller
support enough SDO)

You can specify hint indep_hp=1 by early patching,  the driver
automatically disable automute when you switch on independent hp switch

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/HD-Audio-Controls.txt

Independent HP When this enum control is enabled, the headphone output is
routed from an individual stream (the third PCM such as hw:0,2) instead of
the primary stream
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] alsa sink latency - how to account for startup delay

2016-04-02 Thread Raymond Yau
>>
> 5) The pulseaudio sink code takes the first 10ms of audio out of the
> loopback buffer,
> writes it to the alsa buffer and calls snd_pcm_start().

 If the sink takes something from the loopback buffer, this means that
 the first pop() call has been made. Assuming no time has passed since
 the previous step, the USB bus is still full, and so is the ring
 buffer. Expected delay: 20 ms.
>>>
>>> Reported delay is exactly the amount of audio that was written to
>>> the buffer.
>>
>> That's the bug that I think should be fixed in alsa if possible (and if
>> it's impossible, I don't see how it could be fixed in pulseaudio
>> either).
>
> It can be fixed (or at least be worked around). If you take a time stamp
> at the moment when snd_pcm_start() is called and another when
> the first audio has definitely been played (delay < write_count), then
> the difference between the time stamps corrected by the amount
> of audio that has already been played, gives you exactly that
> missing bit of latency.
> That was what my original question was about - what should I do with
> this extra latency? Currently I am just adding it as an offset to the
> "normal" latency. This however means, that if you configure let's say
> 10ms, you will get in fact around 22ms. (You would get 22ms anyway,
> but the reports would show 10ms with the old code.)
> For HDA the reported delay is even slightly negative, probably because
> the card already starts during the preparation step. Negative delays
> are truncated by my code, no real audio should have been played
> before snd_pcm_start().
>

This is because pulseaudio use -1 as start threshold instead of buffer
size/boundary, write may start just after first write,  some plugin (e.g.
multi plugin) return EBADFD when pulseaudio call snd_pcm_start because pcm
has already started

do loopback module assume sink is not running when it start source capture?

you are using scope to measure the latency, how about the input and output
delay from HDA link and the hda codec pins

Some hda codecs (e.g. idt codecs) which have high pass filter, low pass
filter, EQ have delays defined in hda audio specification

Input Delay is a 4-bit value representing the number of samples between
when the sample is received as an analog signal at the pin and when the
digital representation is transmitted on the High Definition Audio Link.
This may be a “typical” value. If this is 0, the widgets along the critical
path should be queried, and each individual widget must report its
individual delay.

Output Delay is a four bit value representing the number of samples between
when the sample is received from the Link and when it appears as an analog
signal at the pin.

“typical” value. If this is 0, the widgets along the critical path should
be queried, and each individual widget must report its individual delay.
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Splitting a 7.1 device into virtual 5.1 + 2.0 devices?

2016-04-01 Thread Raymond Yau
> >
> > I'm using an ALC899 codec with 6x3.5mm jacks and so far, I've been
> > using sink-remap [1], which worked fine, 5.1 sound being remixed to
> > 2.0 as expected.
> >
> > However, there are two problems with this:
> > - even though I select the Stereo sink as output in pavucontrol, the
> > sound is also playing via my Surround sink
> > - the two sinks have their volumes linked.
>
> So the setup is exactly as instructed in the Arch wiki? Two things seem
> to be wrong in the instructions (I don't know how that could be - did
> the author not test what he or she wrote to the wiki?): the "remix"
> option should be "no" in both cases. Otherwise anything played to the
> stereo sink will be upmixed to all channels of the 7.1 sink.
>
> The second thing is that if the stereo and 5.1 sinks are not supposed
> to use overlapping channels, then the channel maps are wrong, because
> both sinks use the front-left and front-right channels of the master
> sink. The stereo sink should have "side-left,side-right" in the
> "master_channel_map" parameter.
>
> > Apparently, I could set my card to 5.1 and the grey socket would be
> > automatically treated as a 2.0 device, however the behavior is
> > completely the same as my earlier setup, including the caveats
> > described above
> >
> > I would like to split them in separate devices as follows:
> >
> > - two sinks visible, Stereo (for the 2.0 amplifier) and Surround (for
> > my 5.1 headset with a built-in amplifier), physical 7.1 device hidden
> > in pavucontol/KDE's plasma-pa widget
>
> Hiding the 7.1 sink is not currently possible.
>
> > - for the Stereo sink, I want the LFE to be mixed into the stereo
> > channels when downmixing, but left untouched for stereo content (just
> > like it did with PA6.0). Same for rear and center channels.
>
> This does not require any changes to anything. As long as remixing is
> enabled in daemon.conf (like it is by default), playback streams with
> LFE will be downmixed to have LFE in the left and right channels, and
> if the playback stream doesn't have an LFE channel, then there's
> nothing to do (leaving LFE "untouched for stereo content" doesn't make
> sense to me, because there's nothing to leave untouched).

The easy way is to use hdajackretask your grey line out as internal
speaker, there will be headphone, 5.1 line out jacks and stereo speaker
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] alsa sink latency - how to account for startup delay

2016-03-31 Thread Raymond Yau
>>
>>> > I don't want to shorten the latency. I only want the latency reported
correctly. To me it still
>>> > looks like the real latency of the driver is not what it reports,
because the time that the
>>> > audio spends in the URB's is not taken into account. What I am seeing
is, that the real
>>> > latency is around 10ms longer than expected.
>>>
>>> The total number of URBs for the endpoint is not allowed to exceed
MAX_URBS (which the patch increases from 8 to 12).
>>>
>>> Do this match with your measurement
>>>
>>>
>> How much audio does one URB hold? The time I measure is between 8 and 9
ms and does not
>> depend much on the configured sink latency as far as I can tell. (I
tried latencies between
>> around 10ms and 2s). I did however not check the dependency in detail,
most observations
>> are with sink latencies in the range of 10 - 20ms.
>>
> OK, I did a few more measurements and the numbers I have given above are
not correct.
> The actual difference in overall latency is 12ms.
> When I run module-loopback with 40ms configured latency, I will see about
42ms with my
> code that accounts for the delay and 54ms with the old code.
> So if an URB holds 1ms of audio, this could match.
>
> I think the remaining 2ms are hardware delays, they are slightly
different for different
> combinations of source/sink and by setting small latency offsets (HDA
source: 0ms
> HDA sink: 2.8ms, USB source: 1.0ms and USB sink: 1.8ms) I am at 40ms
+/-0.5ms
> for all combinations.

Do module-loopback have higher latency than hda loopback mixing since most
hda codecs have analog mixer which support loopback mixing (e.g. mic
playback switch) ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] alsa sink latency - how to account for startup delay

2016-03-29 Thread Raymond Yau
>>
>> The USB driver will submit N silence URBs on startup in the prepare and
you will have to wait for those URBs to retire before the samples are
queued. There is very little 'USB processing'. If you want to reduce this
delay you have to use smaller periods, it'll decrease the size of the URBs.
I guess it could be possible to change the URB size after the start but
that's not implemented atm.
>>

For loopback, the source capture the same amount of data while you wait for
the retitement of those urbs

> I don't want to shorten the latency. I only want the latency reported
correctly. To me it still
> looks like the real latency of the driver is not what it reports, because
the time that the
> audio spends in the URB's is not taken into account. What I am seeing is,
that the real
> latency is around 10ms longer than expected.

The total number of URBs for the endpoint is not allowed to exceed MAX_URBS
(which the patch increases from 8 to 12).

Do this match with your measurement
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] alsa sink latency - how to account for startup delay

2016-03-27 Thread Raymond Yau
>
> when a sink is started, there is some delay before the first sample is
really played.
> This delay is a constant part of the sink latency that will be always
present, so the
> minimum sink latency cannot go below that start delay.
> Would it be acceptable to adjust the latency range for the device after
each unsuspend
> to reflect that?
> USB devices (those I have access to) for example have a startup delay in
the range of
> 10ms, but have a latency range that starts at 0.5ms which does not make a
lot of sense
> in my opinion.
> The startup delay is not constant, so the minimum possible latency would
vary.
>
> On the source side the startup delay is not relevant since it does not
delay the signal.
>

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/usb?id=976b6c064a957445eb0573b270f2d0282630e9b9

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

As pulseaudio alsa i/0 thrread based on avail to update alsa buffer, those
submitted urbs cannot be rewinded, it is just similar to FIFO of hda
controller
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 1/2] alsa-mixer: Fix reference to too high channel numbers

2016-03-08 Thread Raymond Yau
2016-03-09 4:52 GMT+08:00 Tanu Kaskinen <ta...@iki.fi>:

> On Wed, 2016-03-09 at 00:28 +0800, Raymond Yau wrote:
> > > > Alsa mixer api just combine volume control and mute switch with same
> name
> > > > to an element,
> > > >
> > > > Is it possible that  these two control have different number of
> channels
> > > > for some sound card ?
> > > I don't know if it's possible, but the PulseAudio code works in any
> > > case, because the switch handling code doesn't depend on how many
> > > channels the corresponding volume element has.
> > >
> > Do you mean that side speakers still have sound when selecting 5.1
> profile
> > when user have 7.1 speakers since alsa snd hda intel driver use copy
> front?
>
> I don't know what "copy front" means. I sure hope that it doesn't mean
> that the driver copies audio from the front speakers to the side
> speakers when pulseaudio uses the "surround51" device.
>

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/hda_codec.c?id=4b3acaf5b56f53ef259a6ddf8e17dcb529631d9b


hda-codec - Feed front signals to all surrounds

>
>
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 1/2] alsa-mixer: Fix reference to too high channel numbers

2016-03-08 Thread Raymond Yau
> > :
> > > > The volume_use is set to ignore, but we continue the volume parsing
> > > > code, potentially referencing somewhere outside the array (which has
> > > > max two channels).
> >
> > Alsa mixer api just combine volume control and mute switch with same
name
> > to an element,
> >
> > Is it possible that  these two control have different number of channels
> > for some sound card ?
>
> I don't know if it's possible, but the PulseAudio code works in any
> case, because the switch handling code doesn't depend on how many
> channels the corresponding volume element has.
>
> --

Do you mean that side speakers still have sound when selecting 5.1 profile
when user have 7.1 speakers since alsa snd hda intel driver use copy front?

https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1553783

mrt 06 20:17:03 username-EasyNote-TJ77 pulseaudio[2191]:
[alsa-source-ALC272X Analog] alsa-mixer.c: Assertion
'pa_cvolume_compatible_with_channel_map(v, cm)' failed at
modules/alsa/alsa-mixer.c:1222, function pa_alsa_path_set_volume().
Aborting.
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 0/2] multichannel element_probe

2016-03-01 Thread Raymond Yau
2016-03-01 18:41 GMT+08:00 David Henningsson <
david.hennings...@canonical.com>:

> Looking at errors.ubuntu.com, a new crasher has climbed the charts a bit
> (at least
> compared to other ones), starting with PA 7.0. The assertion failure
> occurs when
> trying to set ALSA source volume. (
> https://bugs.launchpad.net/bugs/1551610 )
>
> While investigating that one, the only thing remotely related, seemed to
> be my change
> w r t multi-channel volumes. Found a bug in that code; the first patch is
> a quick bug fix,
> but I'm not at all sure it fixes the actual bug. Nevertheless the plan is
> to deploy it on
> Ubuntu and see if the crash numbers go down or not.
>
> But then I was annoyed by the giant element_probe function being
> unreadable,
> so I refactored it as well. I hope you like the change.
>


https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1545942

This look like bug in virtualbox 5.x emulated ac97  codec change from
stac9200 to emulated ad1980 in Dell dimension 8400 which support multi
channel
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 0/1] alsa: Make profiles' availability dynamic

2016-02-18 Thread Raymond Yau
2016-2-18 下午5:38於 "Bob Ham" 寫道:
>
> Make ALSA profiles stick around and update their availability if the
> HDMI ELD changes.  This alters the presence of card profiles quite
> dramatically.  Specifically, the existing autogeneration of profiles
> generates a large set of input/output mapping combinations and all of
> these combinations are reported by the API, marked as unavailable. To
> give an idea of the consequences, here is what pavucontrol looks like
> with this patch:
>
>   https://people.collabora.com/~rah/pavucontrol-unavailable-profiles.png
>
> Similarly, here is the output of "pactl list cards":
>
>   https://people.collabora.com/~rah/pactl-list-cards-output.txt
>

AFAIK,

1) mono is not supported by hda-intel
2) those desktop with three jacks at rear panel need retasking input jacks
to output jacks by changing control channel mode from 2ch to 6ch, you may
need to add hook for alsa devices to change the channel mode in alsa
HDA-Intel.conf
3) even HDMI codec support 8 channels, it still require your hdmi monitor
support multi channels
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] hard channel mapping issue

2016-02-09 Thread Raymond Yau
>
> I'm a bit stuck. On my system (chip AD1888 in a VIA 8237R) everything
> seems to be detected fine, but I only get front-right and front-left
> instead of 5.1. I configured "daemon.conf" to use a correct default
> mapping and later also "default.pa" to create a new sink with right
> mapping. However, even though all gui tools, and even 'pacmd list', show
> it all right, 'pactl stat' shows wrong device mappings in use:
>
> Server Name: pulseaudio
> Server Version: 4.0
> Default Sample Specification: s16le 6ch 44100Hz
> Default Channel Map: front-left,front-left-of-center,front-center,
>  front-right,front-right-of-center,rear-center
> Default Sink: alsa_output.pci-_00_14.2.analog-surround-51
> Default Source: alsa_output.pci-_00_14.2.analog-surround-51.monitor
>
> When I use an own defined sink, this sticks to the HDMI-source and
> stereo, no matter what device I specify, i.e.:
>
> load-module module-alsa-sink sink_name=my_surround device=hw:1,0 \
> channels=6 \
> channel_map=front-left,front-right,rear-left,rear-right,front-center,lfe
>
> How can I get in sync the default and the chosen default setting?

How about

 speaker-test -c 6 -t wav -D surround51:CARD=VIA8237


 List of PLAYBACK Hardware Devices 
card 0: V8237 [VIA 8237], device 0: VIA 8237 [VIA 8237]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3

seem have four DXS subdevices

http://git.alsa-project.org/?p=alsa-tools.git;a=blob;f=hwmixvolume/README;hb=HEAD

you have to post output of alsa-info.sh and pulseaudio verbose log

http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/VIA8237.conf;hb=HEAD

https://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/samples/VIA%208237--Analog%20Devices%20AD1888

seem "Master Surround Playback Volume" is not supported by pulseaudio

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/pci/ac97/ac97_patch.c
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] switch-on-port-available: Switch from HDMI to analog; but not the other way around

2016-01-31 Thread Raymond Yau
> > If you have headphones plugged in and plug in HDMI; you want sound
> > to stay on headphones.
> > If you have HDMI plugged in and you plug in headphones; you want sound
> > to switch to headphones.
> >
> > Hence we need to take priority into account as well when determining
> > whether to switch to a new profile or not.
>
> I think the same logic should apply to input ports too. Otherwise looks
> good to me.
>

https://bugs.freedesktop.org/show_bug.cgi?id=93903

But the bug report is about headphone switch to optical digital out and not
switch back, usually hdmi and analog codecs attached to different hda
controller (alsa card)

what happen when the three input jacks of desktop are not plugged ?

Some hda codecs (via) still have stereo mix as input source but the other
codecs don't
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Setting gain when plugging headphone on (non-simple) ALSA controls

2016-01-21 Thread Raymond Yau
>
> I have a problem of hearing white-noise on my headphones when I plug them
in my laptop. I know the work around:
>
> $ amixer -c 0 cset 'numid=10' 1
> numid=10,iface=MIXER,name='Headphone Mic Boost Volume'
>   ; type=INTEGER,access=rw---R--,values=2,min=0,max=3,step=0
>   : values=1,1
>   | dBscale-min=0.00dB,step=10.00dB,mute=0
>
> OR
>
> $ amixer -c0 sset 'Headphone Mic Boost' 1
> Simple mixer control 'Headphone Mic Boost',0
>   Capabilities: volume
>   Playback channels: Front Left - Front Right
>   Capture channels: Front Left - Front Right
>   Limits: 0 - 3
>   Front Left: 1 [33%] [10.00dB]
>   Front Right: 1 [33%] [10.00dB]
>
> Done, no more white noise. It's all well, but the settings are not
remembered; every time pulseaudio restarts (when I login to my Desktop,
basically):
>
> $ amixer -c 0 cget 'numid=10'
> numid=10,iface=MIXER,name='Headphone Mic Boost Volume'
>   ; type=INTEGER,access=rw---R--,values=2,min=0,max=3,step=0
>   : values=0,0
>   | dBscale-min=0.00dB,step=10.00dB,mute=0
>
> Notice the 0,0? And the white noise is back.
>
> So my end goal is to find my way into hacking pulseaudio so that this is
taken care of without having to do it myself via command line everytime I
use my headphones.
>
> That's where my understanding of things starts to break down. Basically,
I think it's not possible to control this property in pulseaudio at the
moment, so I may need to write/update a module (frankly I'm not actually
sure of that - but I'm not afraid of coding C). I started reading the
coding page on the pulseaudio modules of freedesktop.org, but that did not
really inspire me to find a solution to my issue. So I would like to know
if one of you could guide me a bit.

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

You need to mute loopback mixing path,  the noise seem to be feedback of
the combo jack
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Since pulseaudio 5 speaker output is on headphones channel, and plugging/unplugging headphones resets settings

2016-01-03 Thread Raymond Yau
>
> Hello to all on the list,
> I submitted this bug report on the Debian BTS:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808170
> regarding pulseaudio >= 5.x and I was instructed to ask
> the same question here.
>
> The bug report contains all the logs with pulseaudio 4.x
> (the last version that works correctly in my system) and
> pulseaudio 7.x (the version currently in Debian Testing,
> that does not work).
>
> I tried months ago with pulseaudio 5.x and then I pinned
> apt to pulseaudio 4.x. After a dist-upgrade I tried pulseaudio
> 7.x hoping for something better, but I experienced the same
> problem.
>
> For the description of the problem and the verbose log files
> you can click on the DBTS link for the #808170 bug.

#define SND_CTL_TLV_DB_GAIN_MUTE-999

( 4.645| 0.000) [pulseaudio] alsa-sink.c: Hardware volume ranges from
-200050.98 dB to 0.00 dB.

dB range seem to be sum of two -9.99 and -51 dB(softvol plugin)
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] alsa-mixer: sb-omni-surround-5.1.conf: remove analog-surround-21, add Linux 4.3+ support

2015-11-28 Thread Raymond Yau
>
> I've been looking at those lines. Do you think it should be done in
USB-Audio, or should it be added into separate config file specific for
this sound card?

http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/pcm/surround21.conf;hb=HEAD

The route of surround21 is hardcoded to use surround51 , this mean your
ttable are used by those usb audio support 6 channels, those usb audio
which only support 8 channels need to define their own 21 route as both
surround51 and surround71 of usb audio use route plugin
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] alsa-mixer: sb-omni-surround-5.1.conf: remove analog-surround-21, add Linux 4.3+ support

2015-11-27 Thread Raymond Yau
>
> Ok. Let's hope that in the future somebody actually fixes the driver so
that 2.1 works and we can add it back, but for now, I've pushed your patch.

type route
ttable.0.0 1
ttable.1.1 1
ttable.2.4 1
ttable.3.5 1
ttable.4.2 1
ttable.5.3 1

type route
ttable.0.FL 1 ttable.1.FR 1 ttable.2.LFE 1

You need to merge two route ttable into one ttable for usb audio 's
surround21
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] alsa-mixer: sb-omni-surround-5.1.conf: remove analog-surround-21, add Linux 4.3+ support

2015-11-26 Thread Raymond Yau
>>
>> > Do you mean 2.1 mode won't work with all usb audio since surround 5.1
of usb audio is already using route plugin
>> What do you mean by "all usb audio"? In 4.1/5.1 mode LFE and all other
outputs work properly, it is just for 2.1, which works as stereo.
>>
>> > If you don't have SPDIF output/input, you need to add your card in
USB-AUDIO.conf
>> Sound card has S/PDIF output, but not input. Not sure whether output
works properly though. I do not have speakers or any other hardware with
S/PDIF input to test it.
>>

>>>
>>> >
>>> > In 2.1 mode LFE is not actually working at all, so it is removed.
>>>
>>> Do you mean 2.1 mode won't work with all usb audio since surround 5.1
of usb audio is already using route plugin
>>>
>>> USB-Audio.pcm.surround51.0 {
>>> @args [ CARD ]
>>> @args.CARD { type string }
>>> @func refer
>>> name {
>>> @func concat
>>> strings [
>>> "cards.USB-Audio."
>>> { @func card_name card $CARD }
>>> ".pcm.surround51:CARD=" $CARD
>>> ]
>>> }
>>> default {
>>> type route
>>> ttable.0.0 1
>>> ttable.1.1 1
>>> ttable.2.4 1
>>> ttable.3.5 1
>>> ttable.4.2 1
>>> ttable.5.3 1
>>> slave {
>>> pcm {
>>> type hw
>>> card $CARD
>>> device 0
>>> }
>>> channels 6
>>> }
>>> }
>>> }
>>>

http://git.alsa-project.org/?p=alsa-lib.git;a=blob_plain;f=src/conf/pcm/surround21.conf;hb=HEAD

type route slave.pcm
{ @func refer name { @func concat strings [ "cards." { @func card_driver
card $CARD } ".pcm.surround51." $DEV ":CARD=" $CARD ] } }
ttable.0.FL 1 ttable.1.FR 1 ttable.2.LFE 1
hint { description "2.1 Surround output to Front and Subwoofer speakers"
device $DEV }

2.1 seem use 5.1 and route plugin

If you mean route plugin cannot be used twice, you need to remove surround
2.1 from USB-Audio.conf
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [BUG?] I get a profile with 2 outputs, but if I mute headphone it mutes both ports

2015-11-12 Thread Raymond Yau
>
> I was responsible for plugin the cables from the front panel to the
motherboard, I don't remember where exactly on the MOBO I plugged the front
panel audio cables but I followed my MOBO manual (Z7-DS3H). And on Windows,
this problem doesn't ocurr.

Do you mean Z77-DS3H ?

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


2/4/5.1/7.1-channel
* To configure 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.

> /sys/class/sound/hwC0D2/driver_pin_configs:
> 0x1b 0x02214120
> 0x1c 0x993301f0

seem have no CD input

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

If auto mute work in windows, this mean that bug in alsa driver since some
user report noise when jack dection is enabled on other gigabyte
motherboard,

Do sound work without noise using model=nofixup or hdajackretask to renable
jack detection of HP jack ?

The alternative is use codec id or dmi.board.name to identify the board
which need disable jack detectiondetection


>
> !!Linux Distribution
> !!--
>
> Arch Linux \r (\l) NAME="Arch Linux" ID=arch PRETTY_NAME="Arch Linux"
HOME_URL="https://www.archlinux.org/; SUPPORT_URL="
https://bbs.archlinux.org/; BUG_REPORT_URL="https://bugs.archlinux.org/;
>
>
> !!DMI Information
> !!---
>
> Manufacturer:  Gigabyte Technology Co., Ltd.
> Product Name:  To be filled by O.E.M.
> Product Version:   To be filled by O.E.M.
> Firmware Version:  F9
>
>
> !!Kernel Information
> !!--
>
> Kernel release:4.2.5-1-ARCH
> Operating System:  GNU/Linux
> Architecture:  x86_64
> Processor: unknown
> SMP Enabled:   Yes
>
>
> !!ALSA Version
> !!
>
> Driver version: k4.2.5-1-ARCH
> Library version:1.0.29
> Utilities version:  1.0.29
>
>
> !!Loaded ALSA modules
> !!---
>
> snd_hda_intel
> snd_hda_intel
>
>
> !!Sound Servers on this system
> !!
>
> Pulseaudio:
>   Installed - Yes (/usr/bin/pulseaudio)
>   Running - Yes
>
> Jack:
>   Installed - Yes (/usr/bin/jackd)
>   Running - No
>
>
> !!Soundcards recognised by ALSA
> !!-
>
>  0 [PCH]: HDA-Intel - HDA Intel PCH
>
>   HDA Intel PCH at 0xf721 irq 28
>  1 [NVidia ]: HDA-Intel - HDA NVidia
>
>   HDA NVidia at 0xf708 irq 17
>
>
> !!PCI Soundcards installed in the system
> !!--
>
> 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset
Family High Definition Audio Controller (rev 04)
> 01:00.1 Audio device: NVIDIA Corporation GK110 HDMI Audio (rev a1)
>
>
> !!Advanced information - PCI Vendor/Device/Subsystem ID's
> !!---
>
> 00:1b.0 0403: 8086:1e20 (rev 04)
> Subsystem: 1458:a002
> --
> 01:00.1 0403: 10de:0e1a (rev a1)
> Subsystem: 10de:104b
>
>
> !!Loaded sound module options
> !!---
>
> !!Module: snd_hda_intel
> align_buffer_size : -1
> bdl_pos_adj :
1,32,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
> beep_mode :
Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y
> enable :
Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y
> enable_msi : -1
> id :
(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)
> index :
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
> jackpoll_ms :
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
> model :
(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)
> patch :
(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)
> position_fix :
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
> power_save : 0
> power_save_controller : Y
> probe_mask :
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
> probe_only :
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
> single_cmd : N
> snoop : -1
>
> !!Module: snd_hda_intel
> align_buffer_size : -1
> bdl_pos_adj :
1,32,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
> beep_mode :

Re: [pulseaudio-discuss] [ANNOUNCE] PulseAudio 7.1 released

2015-11-12 Thread Raymond Yau
>
> http://pastebin.com/1fNAViKp
>
> i switched to surround 4.0 output and i can change volume but its just a
> workaround because i have 2.0 speakers
>
>

https://bugs.freedesktop.org/show_bug.cgi?id=84983

The xonar D1 in the bug report does not have have headphone jack kctl but
AV200 have headphone jack and headphone playback volume control

pulseaudio expect phantom port exist when there is headphone jack kctl
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] How to lock front audio volume to 50%?

2015-11-07 Thread Raymond Yau
>
> I'm trying to get the following to work: There's a SoundBlaster Live
> (emu10k1) soundcard in my PC and the bass is set to 90%. This causes a
> lot of audio distortion on the audio output because Pulseaudio always
> sets the front volume to 100 % (and keeps resetting it to that value).
> If I set it down to ~50 %, there are no issues.
>
> What I'd like to do now is forcing Pulseaudio to leave my front audio
> volume where I set it. I've consulted this page:
>
http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/PulseAudioStoleMyVolumes/
>
> There it says I should add the "control=" parameter to module-alsa-sink,
> so I added this to my configuration:
>
> load-module module-alsa-sink device=hw:1,0 control=PCM
>
> Now I have a second sink for the soundcard, but the sound is still
> cracking and the front volume setting doesn't have any impact on the
> sound anymore.
>
> Does anyone have a solution for this?

The tone controls treble/bass of SB Live have -12dB atten to +12dB gain ,
this mean that you need to keep those DSP volume controls to -12dB if you
set bass to maximun
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [BUG?] I get a profile with 2 outputs, but if I mute headphone it mutes both ports

2015-11-06 Thread Raymond Yau
>
>>
>>
>> I'm not sure that's relevant for dealing with the "Front" element.
>> Maybe you mean that the kernel doesn't know what paths "Front" affects?
>> In that case, the kernel could name the control "Gigabyte Front" so
>> that the userspace knows too that it's not known what the control does.
>
>
> Well, in other cases where kernel does automute automatically, you will
never get output from both line out and headphones. And that was part of
the original problem, I believe?

Do pulseaudio allow headphone and speaker share volume control ?

On Dell XPS M1210 which have three audio jacks(HP, Line Out, Line in) ,
port A and port D (HP and speaker) of stac9221 can be connected to only
node 0x2

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/patch_sigmatel.c?id=0a4278464eba4bf98c0d6304c62a1116553125d3

/*
  STAC 9221 A1 pin configs for
  102801D7 (Dell XPS M1210)
  */
-static const unsigned int dell_922x_m82_pin_configs[10] = {
- 0x02211211, 0x408103ff, 0x02a1123e, 0x90100310,
- 0x408003f1, 0x0221121f, 0x03451340, 0x40c003f2,
- 0x508003f3, 0x405003f4,
+static const struct hda_pintbl dell_922x_m82_pin_configs[] = {
+ { 0x0a, 0x02211211 },
+ { 0x0b, 0x408103ff },
+ { 0x0c, 0x02a1123e },
+ { 0x0d, 0x90100310 },
+ { 0x0e, 0x408003f1 },
+ { 0x0f, 0x0221121f },
+ { 0x10, 0x03451340 },
+ { 0x11, 0x40c003f2 },
+ { 0x15, 0x508003f3 },
+ { 0x1b, 0x405003f4 },
+ {}
  };

Node 0x0a [Pin Complex] wcaps 0x400181: Stereo
   Pincap 0x173f: IN OUT HP Detect Trigger ImpSense
 Vref caps: HIZ 50 GRD 80
   Pin Default 0x0221101f: [Jack] HP Out at Ext Front
 Conn = 1/8, Color = Black
 DefAssociation = 0x1, Sequence = 0xf
   Pin-ctls: 0x40: OUT VREF_HIZ
   Unsolicited: tag=02, enabled=1
   Connection: 1
  0x02

Node 0x0c [Pin Complex] wcaps 0x400181: Stereo
   Pincap 0x1737: IN OUT Detect Trigger ImpSense
 Vref caps: HIZ 50 GRD 80
   Pin Default 0x02811030: [Jack] Line In at Ext Front
 Conn = 1/8, Color = Black
 DefAssociation = 0x3, Sequence = 0x0
   Pin-ctls: 0x24: IN VREF_80
   Unsolicited: tag=03, enabled=1
   Connection: 1
  0x03
Node 0x0d [Pin Complex] wcaps 0x400181: Stereo
   Pincap 0x173f: IN OUT HP Detect Trigger ImpSense
 Vref caps: HIZ 50 GRD 80
   Pin Default 0x90170110: [Fixed] Speaker at Int N/A
 Conn = Analog, Color = Unknown
 DefAssociation = 0x1, Sequence = 0x0
 Misc = NO_PRESENCE
   Pin-ctls: 0x40: OUT VREF_HIZ
   Unsolicited: tag=00, enabled=0
   Connection: 1
  0x02

Node 0x0f [Pin Complex] wcaps 0x400181: Stereo
   Pincap 0x0037: IN OUT Detect Trigger ImpSense
   Pin Default 0x02011020: [Jack] Line Out at Ext Front
 Conn = 1/8, Color = Black
 DefAssociation = 0x2, Sequence = 0x0
   Pin-ctls: 0x40: OUT
   Unsolicited: tag=01, enabled=1
   Connection: 1
  0x05
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [ANNOUNCE] PulseAudio 7.1 released

2015-11-05 Thread Raymond Yau
> > http://pastebin.com/1fNAViKp
>
> PulseAudio finds only the headphone path based on the information that
> the kernel gives. The card doesn't seem to have a separate headphone
> jack itself[1], so I suppose the "Headphone" mixer element controls the
> front panel output volume, if you have such thing hooked to the card.
>
> I think the kernel should create a jack element for the back panel
> output (at least a phantom jack, if proper jack detection can't be
> implemented). That would allow PulseAudio to distinguish between the
> back and front panel outputs. As a workaround, I think removing the
> contents of /usr/share/pulseaudio/alsa-mixer/paths/analog-output-
> headphones.conf would make the volume control work again (just delete
> the contents, not the file itself).
>
> The reason why this worked before version 7.1 is that your "Master"
> volume element has more than 2 channels, which PulseAudio couldn't
> handle, so the headphone path (which includes the "Master" element) was
> disabled. PulseAudio still can't handle volume elements with more than
> 2 channels, but as of 7.1, such elements are just ignored, so they
> don't disable the whole path.
>
> [1] https://www.asus.com/Sound-Cards/Xonar_DS/specifications/
>

It seem that there is a bug in alsa mixer api which combine volume and mute
switch with different number of channels (items) but the mixer api assume
both controls have same number of channels(items)

control.1 {
iface MIXER
name 'Master Playback Volume'
value.0 121
value.1 121
value.2 121
value.3 121
value.4 121
value.5 94
value.6 121
value.7 121
comment {
access 'read write'
type INTEGER
count 8
range '67 - 127'
dbmin -6000
dbmax 0
dbvalue.0 -600
dbvalue.1 -600
dbvalue.2 -600
dbvalue.3 -600
dbvalue.4 -600
dbvalue.5 -3300
dbvalue.6 -600
dbvalue.7 -600
}
}
control.2 {
iface MIXER
name 'Master Playback Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}

Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right - Rear Left - Rear Right -
Front Center - Woofer - Side Left - Side Right
  Limits: Playback 67 - 127
  Mono:
  Front Left: Playback 121 [90%] [-6.00dB] [on]
  Front Right: Playback 121 [90%] [-6.00dB] [on]
  Rear Left: Playback 121 [90%] [-6.00dB] [on]
  Rear Right: Playback 121 [90%] [-6.00dB] [on]
  Front Center: Playback 121 [90%] [-6.00dB] [on]
  Woofer: Playback 94 [45%] [-33.00dB] [on]
  Side Left: Playback 121 [90%] [-6.00dB] [on]
  Side Right: Playback 121 [90%] [-6.00dB] [on]
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [BUG?] I get a profile with 2 outputs, but if I mute headphone it mutes both ports

2015-11-02 Thread Raymond Yau
> If you change that to

>[Element Front]
>switch = off
>volume = off

>>does that fix the problem for you?

>Indeed this fixes my problem, thanks!
>
> Thanks for this. Although I think I'm going to stick with the first
solution provided, where would this piece of configuration go?

Why do pulseaudio need to change volume=off as switch=off already mute Line
Out

only need volume=off when the path does not has any  mute switch

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/ALSA-Configuration.txt

You need to change alsa in /etc/modprobe.d/
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [BUG?] I get a profile with 2 outputs, but if I mute headphone it mutes both ports

2015-11-01 Thread Raymond Yau
> >
> > > I suspect that the "Front" volume and mute elements can be used to
> > > control the line out without affecting the headphones. The problem is
> > > that PulseAudio's alsa configuration assumes that the "Front" element
> > > affects both line out and headphones (there's a comment saying that
"on
> > > some machines Front is actually a part of the Headphone path").
> > >
> > > /usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf
> > > contains this:
> > >
> > >  [Element Front]
> > >  switch = mute
> > >  volume = zero
> > >
> > > If you change that to
> > >
> > >  [Element Front]
> > >  switch = off
> > >  volume = off
> > >
> > > does that fix the problem for you?
> > >
> >
> > Indeed this fixes my problem, thanks!
> >
> > I'm a bit confused by the comment in the .conf file though. So, despite
> > PA detecting the rear line out port exactly as it states, this "Element
> > Front" is actually part of the headphones "paths"? that is rear line out
> > is considered as part of "Element Front"?
>
> I'm not sure what you mean with your last question. The rear line out
> isn't a "part" of the "Front" mixer element, it's the other way around.
> You have two paths, headphones and line out. PulseAudio considers the
> "Front" mixer element to be part of both paths, even though on your
> machine it's only a part of the line out path.
>
> I'm not sure if we can fix this upstream. To me it would seem logical
> for the kernel to promise that "Front" only refers to line out, and if
> on some machine it also affects the headphone path, then that should be
> considered a kernel bug, and the kernel should rename the element.
> David, what do you think?
>

http://www.alsa-project.org/db/?f=d57c2c52e03841877dbb1dba005f9f1ebee43f58

Dell inspiron 660s desktop with alc662 codecs have three jacks at rear
panel which support surround 5.1 and front panel headphone

Headphone and line out share "Front Playback Volume"
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [BUG?] I get a profile with 2 outputs, but if I mute headphone it mutes both ports

2015-11-01 Thread Raymond Yau
>
> I'm not sure I understood 30% of what you said but basically, this is a
firmware problem that the kernel driver is trying to wrap its code around?

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda?id=9155f82a6a26da4a5b8d2d29f1d31836906b4712

You can specify

options snd-hda-intel model=, nofixup

to skip those pin fixup of these two patches if the jack detect of your HP
don't cause any noise

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

ALSA: hda - Disable Front HP jack detection on Gigabyte Z87X-UD3H

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda?id=8f2392142346f2754c8292a94cc62a157ed1e093

ALSA: hda - add quirk to detect CD input on Gigabyte EP45-DS3
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [BUG?] I get a profile with 2 outputs, but if I mute headphone it mutes both ports

2015-10-31 Thread Raymond Yau
>
>
> >
> > I was responsible for plugin the cables from the front panel to the
motherboard, I don't remember where exactly on the MOBO I plugged the front
panel audio cables but I followed my MOBO manual (Z77-DS3H). And on
Windows, this problem doesn't occur.
>
> The driver disable jack detection of headphone and add CD input pin since
all gigabyte motherboards have same PCI SSID 0x1458a002
>
> you have headphone phantom jack when Misc bit of pin default is set
(indicate that no pin detection circuit on HDA front audio panel)
>
>
>
>
> > /sys/class/sound/hwC0D2/init_pin_configs:
> > 0x11 0x99430130
> > 0x12 0x41f0
> > 0x14 0x01014410
> > 0x15 0x41f0
> > 0x16 0x41f0
> > 0x17 0x41f0
> > 0x18 0x01a19c50
> > 0x19 0x02a19c60
> > 0x1a 0x0181345f
> > 0x1b 0x02214c20
> > 0x1c 0x41f0
> > 0x1d 0x4004c601
> > 0x1e 0x41f0
> > 0x1f 0x41f0
> >
> > /sys/class/sound/hwC0D2/driver_pin_configs:
> > 0x1b 0x02214120
> > 0x1c 0x993301f0
> >

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

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda?id=8f2392142346f2754c8292a94cc62a157ed1e093

The driver should check the codec id for those gigabytes motherboard

>
>
> > Codec: Realtek ALC887-VD
> > Address: 2
> > AFG Function Id: 0x1 (unsol 1)
> > Vendor Id: 0x10ec0887
> > Subsystem Id: 0x1458a002
> > Revision Id: 0x100302
>
>
> > control.40 {
> > iface CARD
> > name 'Line Out Jack'
> > value true
> > comment {
> > access read
> > type BOOLEAN
> > count 1
> > }
> > }
> > control.41 {
> > iface CARD
> > name 'Front Headphone Phantom Jack'
> > value true
> > comment {
> > access read
> > type BOOLEAN
> > count 1
> > }
> > }
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [BUG?] I get a profile with 2 outputs, but if I mute headphone it mutes both ports

2015-10-31 Thread Raymond Yau
>
> After switching to my headphones, I activate the surround sink. This is
intentional as I want surround and HRTF with my headphones. Still, the
problem occurs even if this module isn't loaded.

Your alc887vd codec have enough volume controls for 5.1 and headphone

Only Headphone and Green Line Out of ALC6xx codecs share  "front playback
volume" control

the driver should already mute line out when you enable auto mute control

You should check your front hda audio panel

Post the output of alsa-info.sh when you plug and unplug HP
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [BUG?] I get a profile with 2 outputs, but if I mute headphone it mutes both ports

2015-10-31 Thread Raymond Yau
> >
> >  > Desktop
> >  > Arch Linux
> >  > PulseAudio 7.1
> >
> > Using motherboard embedded sound system.
> >
> > _Rear:_ 3 regular jacks: red, green, blue
> > -> Red jack: Mic connected
> > -> Green Jack: Main speakers (Stereo)
> >
> > _Front:_ 2 regular jacks: Mic and Headphones
> >
> > Also, monitors speakers connected through HDMI to NVIDIA GTX 780.
> >
> > _*Goal:*_ This may not be straight forward from the title but I want
> > to
> > be able to listen to my headphones *only*. Currently, this is not
> > possible unless I turn off my speakers.
> >
> > _*Initial situation: *__*
> > *_
> > Sound goes through speakers only, all good.
> >
> > _*What I do:
> >
> > *_I plug in my headphones.
> >
> > Sound goes through speakers only, all good.
> >
> > I go into PAVU, switch from "Line Out" to my headphones in front of
> > "Port" under the MOBO sink name in "Output Devices".
> >
> > _*What happens:*_
> >
> > The sound now goes through BOTH my speakers AND my headphones while I
> > expect it to be output only to my headphones.
> >
> > _*What I try:*_
> >
> > I switch back to Line Out port.
> >
> > Sound goes through speakers only, all good.
> >
> > I mute Line Out port. It mutes instantly, all good.
> >
> > I switch again to my headphones: Sound goes through *BOTH* my
> > speakers
> > *AND* my headphones**again.
> >
> > I switch back to the Line Out port: it is still muted, no sound from
> > either speakers or headphones.
> >
> > I switch to my headphones: faulty behaviour continues, sound through
> > all
> > ports, speakers and headphones alike.
> >
> > I switch back to Line Out port and unmute it: sound goes through the
> > speakers only, normal.
> >
> > I switch to the headphones: sound output through both speakers and
> > headphones.
> >
> > I mute the headphones port: no sound through either the speakers or
> > the
> > headphones. Both ports are muted.
> >
> > _*Questions:*_
> >
> > Is this expected behaviour?
> >
> > How do I have the sound go through the selected port ONLY?
> >
> > Thanks in advance for your help.
>
> I suspect that the "Front" volume and mute elements can be used to
> control the line out without affecting the headphones. The problem is
> that PulseAudio's alsa configuration assumes that the "Front" element
> affects both line out and headphones (there's a comment saying that "on
> some machines Front is actually a part of the Headphone path").
>
> /usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf
> contains this:
>
> [Element Front]
> switch = mute
> volume = zero
>
> If you change that to
>
> [Element Front]
> switch = off
> volume = off
>
> does that fix the problem for you?

Default sink name: alsa_output.pci-_00_1b.0.analog-stereo.vsurroundsink
Default source name: alsa_output.pci-_01_00.1.hdmi-stereo.monitor

Any reason for you to use vsurroumdsink?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [ANNOUNCE] PulseAudio 7.1 released

2015-10-31 Thread Raymond Yau
>
> http://pastebin.com/1fNAViKp
>
> i switched to surround 4.0 output and i can change volume but its just a
> workaround because i have 2.0 speakers
>

Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right - Rear Left - Rear Right -
Front Center - Woofer - Side Left - Side Right
  Limits: Playback 135 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB] [on]
  Front Right: Playback 255 [100%] [0.00dB] [on]
  Rear Left: Playback 255 [100%] [0.00dB] [on]
  Rear Right: Playback 255 [100%] [0.00dB] [on]
  Front Center: Playback 255 [100%] [0.00dB] [on]
  Woofer: Playback 255 [100%] [0.00dB] [on]
  Side Left: Playback 255 [100%] [0.00dB] [on]
  Side Right: Playback 255 [100%] [0.00dB] [on]

Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 61 - 127
  Mono:
  Front Left: Playback 96 [53%] [on]
  Front Right: Playback 96 [53%] [on

https://bugs.freedesktop.org/show_bug.cgi?id=84983

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/oxygen?id=435feac648cab190990aa0bf9355f77d1f082db3

do "Master Playback Switch" mute those line out jacks?

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/oxygen?id=e96f38f732d24515792296b3738842934c985539
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [BUG?] I get a profile with 2 outputs, but if I mute headphone it mutes both ports

2015-10-31 Thread Raymond Yau
>
> I was responsible for plugin the cables from the front panel to the
motherboard, I don't remember where exactly on the MOBO I plugged the front
panel audio cables but I followed my MOBO manual (Z77-DS3H). And on
Windows, this problem doesn't occur.

The driver disable jack detection of headphone and add CD input pin since
all gigabyte motherboards have same PCI SSID 0x1458a002

you have headphone phantom jack when Misc bit of pin default is set
(indicate that no pin detection circuit on HDA front audio panel)




> /sys/class/sound/hwC0D2/init_pin_configs:
> 0x11 0x99430130
> 0x12 0x41f0
> 0x14 0x01014410
> 0x15 0x41f0
> 0x16 0x41f0
> 0x17 0x41f0
> 0x18 0x01a19c50
> 0x19 0x02a19c60
> 0x1a 0x0181345f
> 0x1b 0x02214c20
> 0x1c 0x41f0
> 0x1d 0x4004c601
> 0x1e 0x41f0
> 0x1f 0x41f0
>
> /sys/class/sound/hwC0D2/driver_pin_configs:
> 0x1b 0x02214120
> 0x1c 0x993301f0
>

> Codec: Realtek ALC887-VD
> Address: 2
> AFG Function Id: 0x1 (unsol 1)
> Vendor Id: 0x10ec0887
> Subsystem Id: 0x1458a002
> Revision Id: 0x100302


> control.40 {
> iface CARD
> name 'Line Out Jack'
> value true
> comment {
> access read
> type BOOLEAN
> count 1
> }
> }
> control.41 {
> iface CARD
> name 'Front Headphone Phantom Jack'
> value true
> comment {
> access read
> type BOOLEAN
> count 1
> }
> }
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH v2 2/2] volume: Add LFE balance API

2015-10-27 Thread Raymond Yau
>
> The gnome/unity-control-center UIs have a master volume slider, and
> three sub-sliders: balance, fade, and subwoofer. Balance and fade
> use PA's set_balance and set_fade APIs accordingly, but the subwoofer
> slider sometimes does unintuitive things.
>
> In order to make that slider behave better, let's add a LFE balance
> API that these volume control UIs can use instead. With this API,
> the UI can balance between "no subwoofer" and "only subwoofer" with
> "equal balance" in the middle, which would make it more consistent
> with the behaviour of the other sliders.

For snd-hda-intel, LFE volume is slave of virtual master,

do it mean that pulseaudio ignore virtual master playback volume control ?

Since there is no way to distinguish virtual master playback volume from
those AC97 Master Playback Volume , oxygen 's multi channels master
playback volume

It seem that pulseaudio ignore those analog xxx playback volume controls
but treat the virtual master of CA0106 as left channel only

https://bugs.freedesktop.org/show_bug.cgi?id=92690
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] alsa-mixer: Ignore volume with unexpected number of channels

2015-10-19 Thread Raymond Yau
>>
>> We currently only support one and two channels for volumes, and
>> bail out otherwise. This makes Xonar users unhappy because they
>> have a volume with eight channels, and bailing out means they
>> don't have a path/port at all.
>>
>> This way they will at least have a port, which will in turn make
>> the gnome/unity UI behave better.
>>
>> BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=84983
>> BugLink: https://bugzilla.gnome.org/show_bug.cgi?id=745017
>> Signed-off-by: David Henningsson 
>> ---
>>
>> This is a resend of https://bugs.freedesktop.org/attachment.cgi?id=114250
>> There is a competing patch by Raymond in that bug, but I think his
>> patch is broken, so I'm going to push mine in a week if there are no
>> reviews.
>
>
> Well, here is my review :)
>
> While this should work, this patch means that all those users are
essentially limited to software-based volume inside of PulseAudio. Also,
the master (or whatever multichannel) slider will not be touched by
PulseAudio at all. Which means that it will stay at whatever position that
alsactl init (or alsactl restore) left it at. I.e. a limited volume range
(note: this is not a regression). Which is still better than what we have
now.
>
> Counterproposal: if that's easier to implement than full multi-channel
volume, treat all multichannel volume controls as mono internally,
duplicate the volume across all channels when setting it, and use the first
channel when getting. I.e., instead of full software volume, make "software
balance".
>
> As this counterproposal comes without a patch, and especially since the
"counterprpopsed" improvement can be done later, this should not block the
"going to push in one week" statement.
>

What is the usage of  e->merged_mask  since it is not initialised ?

for (t = 0; t < PA_CHANNEL_POSITION_MAX; t++)
if (PA_CHANNEL_POSITION_MASK(t) & e->merged_mask) {
min_dB[t] = e->min_dB;
max_dB[t] = e->max_dB;
path_volume_channels |=
PA_CHANNEL_POSITION_MASK(t);
}

It seem  the logic try to skip the first control ( virtual master )

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

For snd-ca0106 , there is also a virutal master with slaves "Analog xxx
Playback Volume" controls which are ignored by pulseaudio
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] alsa-mixer: sb-omni-surround-5.1.conf: remove analog-surround-21, add Linux 4.3+ support

2015-10-11 Thread Raymond Yau
>
> In 2.1 mode LFE is not actually working at all, so it is removed.

Do you mean 2.1 mode won't work with all usb audio since surround 5.1 of
usb audio is already using route plugin

USB-Audio.pcm.surround51.0 {
@args [ CARD ]
@args.CARD { type string }
@func refer
name {
@func concat
strings [
"cards.USB-Audio."
{ @func card_name card $CARD }
".pcm.surround51:CARD=" $CARD
]
}
default {
type route
ttable.0.0 1
ttable.1.1 1
ttable.2.4 1
ttable.3.5 1
ttable.4.2 1
ttable.5.3 1
slave {
pcm {
type hw
card $CARD
device 0
}
channels 6
}
}
}

http://git.alsa-project.org/?p=alsa-lib.git;a=blobdiff;f=src/conf/cards/USB-Audio.conf;h=ce3ae019f7f6fa91ca224074d12891217f242300;hp=8a6d9cac6ead765108e09c61914a84d290482556;hb=1af088e39b75a0a0897c7036487b143e983cd423;hpb=57b5076c30b3453ee843912c0aeb3df8dbee3f68

> With Linux 4.3-rc1+ Mic/Line are hw:%f,0,0 as it should be:
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/usb?id=5ee20bc792467d7d612157e0a9962765aa943b08
> So now we support both Linux 4.2.x- and 4.3-rc1+ setups.
> Also in Linux 4.3-rc1 S/PDIF input was detected incorrectly (there is no
such hardware input), so it is not present in config.
> ---

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

Seem all usb audio with more than two playback devices are affected since
capture device of  U7 is also device 1 before the patch

If you don't have SPDIF output/input, you need to add your card in
USB-AUDIO.conf

  # If a device does not use the first PCM device for digital data, the
device
  # number for the iec958 device can be changed here.
  USB-Audio.pcm.iec958_device {
 # "NoiseBlaster 3000" 42
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH 2/2] volume: Add LFE balance API

2015-09-18 Thread Raymond Yau
2015-9-18 下午8:48於 "David Henningsson" 寫道:
>
> The gnome/unity-control-center UIs have a master volume slider, and
> three sub-sliders: balance, fade, and subwoofer. Balance and fade
> use PA's set_balance and set_fade APIs accordingly, but the subwoofer
> slider sometimes does unintuitive things.
>
> In order to make that slider behave better, let's add a LFE balance
> API that these volume control UIs can use instead. With this API,
> the UI can balance between "no subwoofer" and "only subwoofer" with
> "equal balance" in the middle, which would make it more consistent
> with the behaviour of the other sliders.
>

Will high frequency signal damge the subwoofer ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] sound is distorted when pulseaudio system timer scheduling is used (tsched=1)

2015-08-29 Thread Raymond Yau

 I am having issue with pulseaudiosink,
 I used following command to play a wav file
 gst-launch filesrc location=wav file path ! wavparse ! pulseaudiosink

 if tsched is enabled, then play of wav file via pulseaudiosink gives me
lots of Underrun, and the sound is distorted, following is the pulseaudio
log when --log-level=3

 I: [pulseaudio] protocol-native.c: Got credentials: uid=0 gid=0 success=1
 I: [pulseaudio] sink-input.c: Trying to change sample rate
 I: [pulseaudio] alsa-sink.c: Updating rate for device hw:0, new rate is
48000
 I: [pulseaudio] source.c: Changed sampling rate successfully
 I: [pulseaudio] sink.c: Changed sampling rate successfully
 I: [pulseaudio] sink-input.c: Rate changed to 48000 Hz
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Trying resume...
 I: [alsa-sink-HiFi wm8962-0] alsa-util.c: cannot disable ALSA period
wakeups
 I: [alsa-sink-HiFi wm8962-0] alsa-util.c: ALSA period wakeups were not
disabled
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Time scheduling watermark is
18.38ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Resumed successfully...
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Starting playback.
 I: [pulseaudio] sink-input.c: Created input 0 pulsesink probe on
alsa_output.platform-sound.analog-s
 tereo with sample spec s16le 2ch 48000Hz and channel map
front-left,front-right
 I: [pulseaudio] sink-input.c: media.name = pulsesink probe
 I: [pulseaudio] sink-input.c: application.name = gst-launch-0.10
 I: [pulseaudio] sink-input.c: native-protocol.peer = UNIX socket
client
 I: [pulseaudio] sink-input.c: native-protocol.version = 29
 I: [pulseaudio] sink-input.c: application.process.id = 985
 I: [pulseaudio] sink-input.c: application.process.user = root
 I: [pulseaudio] sink-input.c: application.process.host = mx6q
 I: [pulseaudio] sink-input.c: application.process.binary =
gst-launch-0.10
 I: [pulseaudio] sink-input.c: application.language = C
 I: [pulseaudio] sink-input.c: application.process.machine_id =
0aa7a9566c734f608cbd36f187de8645
 I: [pulseaudio] sink-input.c: module-stream-restore.id =
sink-input-by-application-name:gst-launc
 h-0.10
 I: [pulseaudio] protocol-native.c: Requested tlength=250.00 ms,
minreq=20.00 ms
 I: [pulseaudio] protocol-native.c: Final latency 250.00 ms = 105.00 ms +
2*20.00 ms + 105.00 ms
 I: [pulseaudio] sink-input.c: Freeing input 0 pulsesink probe
 I: [pulseaudio] sink-input.c: Created input 1 Playback Stream on
alsa_output.platform-sound.analog-s
 tereo with sample spec s16le 2ch 48000Hz and channel map
front-left,front-right
 I: [pulseaudio] sink-input.c: media.name = Playback Stream
 I: [pulseaudio] sink-input.c: application.name = gst-launch-0.10
 I: [pulseaudio] sink-input.c: native-protocol.peer = UNIX socket
client
 I: [pulseaudio] sink-input.c: native-protocol.version = 29
 I: [pulseaudio] sink-input.c: application.process.id = 985
 I: [pulseaudio] sink-input.c: application.process.user = root
 I: [pulseaudio] sink-input.c: application.process.host = mx6q
 I: [pulseaudio] sink-input.c: application.process.binary =
gst-launch-0.10
 I: [pulseaudio] sink-input.c: application.language = C
 I: [pulseaudio] sink-input.c: application.process.machine_id =
0aa7a9566c734f608cbd36f187de8645
 I: [pulseaudio] sink-input.c: module-stream-restore.id =
sink-input-by-application-name:gst-launc
 h-0.10
 I: [pulseaudio] protocol-native.c: Requested tlength=200.00 ms,
minreq=10.00 ms
 I: [pulseaudio] protocol-native.c: Final latency 200.00 ms = 90.00 ms +
2*10.00 ms + 90.00 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing wakeup watermark to
28.38 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing wakeup watermark to
38.38 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing wakeup watermark to
48.38 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing wakeup watermark to
58.38 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing wakeup watermark to
68.38 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing wakeup watermark to
78.38 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing wakeup watermark to
80.00 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing minimal latency to
1.00 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing minimal latency to
2.00 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing minimal latency to
4.00 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing minimal latency to
8.00 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing minimal latency to
16.00 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing minimal latency to
26.00 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing minimal latency to
36.00 ms
 I: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Increasing minimal latency to
46.00 ms
 E: [alsa-sink-HiFi wm8962-0] alsa-sink.c: ALSA woke us up to write new
data to the device, but there w
 as actually nothing to write!
 E: [alsa-sink-HiFi wm8962-0] alsa-sink.c: Most 

Re: [pulseaudio-discuss] No sound Lubuntu 14.02

2015-08-07 Thread Raymond Yau

 
  I tried a lot already. No success to get the sound working on my old
maxdata laptop.
  This is what I got:
 
  sl@max:~$ lspci -nnk | grep -iA2 audio
  00:1b.0 Audio device [0403]: Intel Corporation 82801FB/FBM/FR/FW/FRW
(ICH6 Family) High Definition Audio Controller [8086:2668] (rev 04)
  Subsystem: QUANTA Computer Inc Device [152d:0748]
  Kernel driver in use: snd_hda_intel
 
  sl@max:~$ aplay -l
   Liste der Hardware-Geräte (PLAYBACK) 
  Karte 0: Intel [HDA Intel], Gerät 6: Si3054 Modem [Si3054 Modem]
Sub-Geräte: 1/1
Sub-Gerät #0: subdevice #0
 
  sl@max:~$ aplay /usr/share/sounds/alsa/Front_Center.wav
  Wiedergabe: WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16
bit Little Endian, Rate: 48000 Hz, mono
 
  Please let me know if/what further information I should provide to
give you a better understanding in what is wrong.
 

 https://lists.fedoraproject.org/pipermail/test/2014-November/123662.html

 If bios did not setup pin default of alc880 codec, you need to find out
the pin of hp and mic jacks by hdajacksensetest , speaker and internal mic
need to find out by trial and err with hdajackretask

 ___
 pulseaudio-discuss mailing list
 pulseaudio-discuss@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

 This is the output of hda-jack-sense-test. What do you recommend?

 root@max:~# hda-jack-sense-test
 Pin 0x14 (Unknown Line Out): present = No
 Pin 0x15 (Unknown Line Out): present = No
 Pin 0x16 (Unknown Line Out): present = No
 Pin 0x17 (Unknown Line Out): present = No
 Pin 0x18 (Unknown Line Out): present = No
 Pin 0x19 (Unknown Line Out): present = No
 Pin 0x1a (Unknown Line Out): present = No
 Pin 0x1b (Unknown Line Out): present = No
 Pin 0x1c (Unknown Line Out): present = No
 Pin 0x1d (Unknown Line Out): present = No
 Pin 0x1e (Unknown Line Out): present = No
 Pin 0x1f (Unknown Line Out): present = No


Post the output of alsa-info.sh

You have to use

hdajacksensetest -a

Did you plug and unplug headphone or mic jack during test ?

Since pin default of all pin complex are zero which is Line Out

Any redundant pins must set to [N/A]

alc880 only have models for desktop

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/HD-Audio-Models.txt

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/pci/hda?qt=grepq=alc880
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] No sound Lubuntu 14.02

2015-08-06 Thread Raymond Yau

 I tried a lot already. No success to get the sound working on my old
maxdata laptop.
 This is what I got:

 sl@max:~$ lspci -nnk | grep -iA2 audio
 00:1b.0 Audio device [0403]: Intel Corporation 82801FB/FBM/FR/FW/FRW
(ICH6 Family) High Definition Audio Controller [8086:2668] (rev 04)
 Subsystem: QUANTA Computer Inc Device [152d:0748]
 Kernel driver in use: snd_hda_intel

 sl@max:~$ aplay -l
  Liste der Hardware-Geräte (PLAYBACK) 
 Karte 0: Intel [HDA Intel], Gerät 6: Si3054 Modem [Si3054 Modem]
   Sub-Geräte: 1/1
   Sub-Gerät #0: subdevice #0

 sl@max:~$ aplay /usr/share/sounds/alsa/Front_Center.wav
 Wiedergabe: WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16
bit Little Endian, Rate: 48000 Hz, mono

 Please let me know if/what further information I should provide to give
you a better understanding in what is wrong.


https://lists.fedoraproject.org/pipermail/test/2014-November/123662.html

If bios did not setup pin default of alc880 codec, you need to find out the
pin of hp and mic jacks by hdajacksensetest , speaker and internal mic need
to find out by trial and err with hdajackretask
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Strange hardware: XFX nForce 780i SLI MCP

2015-08-01 Thread Raymond Yau

 Yesterday I got an interesting email related to dcaenc support.

 The person has an XFX nForce 780i SLI MCP board:
http://www.nvidia.com/object/product_nforce_780i_sli_us.html ,
http://www.evga.com/support/manuals/files/132-CK-NF78.pdf

 As you see on page 18 of the manual, this board has no HDMI output, but
there is an optical SPDIF. Strangely enough, this SPDIF is his
hdmi:CARD=NVidia,DEV=0 device.

 Given the recent discussions related to dynamically creating PCM devices
for HDMI, I think you will be interested in this alsa-info output.

 Is there anything here that would need special treatment by ALSA or
PulseAudio? Or, is this just a misnumbered/misnamed codec?


This can also be regarded as bug of hda_auto_parser.c which does not
determine type of digital pin correctly

Those internal spdif connector which can connect to an optional spdif
headser or spdif input header of the graphic card for hdmi audio output

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

But the pincap of these kind of digital pin usually does not support DETECT
nor HDMI
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] When select 2.1 profile in pulseaudio, how do pulseaudio select notebook 's internal subwoofer or 5.1 external speaker ?

2015-07-11 Thread Raymond Yau
 
  Are you sure that it is alsa driver bug since pulseaudio seem not using
  line out jack to mute internal speakers ?

 No, I'm not. I set all my jacks to line out and it works now.


Do pulseaudio 2.1 profile select the internal subwoofer or your 5.1
external speaker ?

diff --git a/sound/pci/hda/hda_auto_parser.c
b/sound/pci/hda/hda_auto_parser.c
index 03b7399..c9e45e7 100644
@@ -952,6 +960,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
 const struct snd_pci_quirk *q;
 int id = HDA_FIXUP_ID_NOT_SET;
 const char *name = NULL;
+int i;

 if (codec-fixup_id != HDA_FIXUP_ID_NOT_SET)
 return;
@@ -966,6 +975,9 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
 return;
 }

+if (!snd_hda_get_int_hint(codec, alt_config, i))
+codec-alt_config = i;
+
 if (codec-modelname  models) {
 while (models-name) {
 if (!strcmp(codec-modelname, models-name)) {
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 12837ab..38841db 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -283,6 +283,8 @@ struct hda_codec {

 /* additional init verbs */
 struct snd_array verbs;
+int alt_config;
+int combo_jack;
 };

 #define dev_to_hda_codec(_dev)container_of(_dev, struct hda_codec,
core.dev)
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index ac0db16..12ee7f7 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -39,7 +39,6 @@
 #include hda_beep.h
 #include hda_generic.h

-
 /**
  * snd_hda_gen_spec_init - initialize hda_gen_spec struct
  * @spec: hda_gen_spec object to initialize
@@ -180,10 +179,10 @@ static void parse_user_hints(struct hda_codec *codec)
 /* the following two are just for compatibility */
 val = snd_hda_get_bool_hint(codec, add_out_jack_modes);
 if (val = 0)
-spec-add_jack_modes = !!val;
+spec-add_out_jack_modes = !!val;
 val = snd_hda_get_bool_hint(codec, add_in_jack_modes);
 if (val = 0)
-spec-add_jack_modes = !!val;
+spec-add_in_jack_modes = !!val;
 val = snd_hda_get_bool_hint(codec, add_jack_modes);
 if (val = 0)
 spec-add_jack_modes = !!val;
@@ -2648,7 +2720,7 @@ static void get_jack_mode_name(struct hda_codec
*codec, hda_nid_t pin,
 static int get_out_jack_num_items(struct hda_codec *codec, hda_nid_t pin)
 {
 struct hda_gen_spec *spec = codec-spec;
-if (spec-add_jack_modes) {
+if (spec-add_jack_modes || spec-add_out_jack_modes) {
 unsigned int pincap = snd_hda_query_pin_caps(codec, pin);
 if ((pincap  AC_PINCAP_OUT)  (pincap  AC_PINCAP_HP_DRV))
 return 2;
@@ -2791,7 +2863,7 @@ static int get_in_jack_num_items(struct hda_codec
*codec, hda_nid_t pin)
 {
 struct hda_gen_spec *spec = codec-spec;
 int nitems = 0;
-if (spec-add_jack_modes)
+if (spec-add_jack_modes || spec-add_in_jack_modes)
 nitems = hweight32(get_vref_caps(codec, pin));
 return nitems ? nitems : 1;
 }
@@ -3287,7 +3359,7 @@ static int create_input_ctls(struct hda_codec *codec)
 if (err  0)
 return err;

-if (spec-add_jack_modes) {
+if (spec-add_jack_modes || spec-add_in_jack_modes) {
 err = create_in_jack_mode(codec, pin);
 if (err  0)
 return err;
@@ -4895,13 +4971,13 @@ int snd_hda_gen_parse_auto_config(struct hda_codec
*codec,
  */
 if (spec-hp_mic_pin 
 (spec-auto_mic || spec-input_mux.num_items == 1 ||
- spec-add_jack_modes)) {
+ spec-add_jack_modes || spec-add_in_jack_modes)) {
 err = create_hp_mic_jack_mode(codec, spec-hp_mic_pin);
 if (err  0)
 return err;
 }

-if (spec-add_jack_modes) {
+if (spec-add_jack_modes || spec-add_out_jack_modes) {
 if (cfg-line_out_type != AUTO_PIN_SPEAKER_OUT) {
 err = create_out_jack_modes(codec, cfg-line_outs,
 cfg-line_out_pins);
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index 56e4139..f10c55b 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -227,6 +229,8 @@ struct hda_gen_spec {
 unsigned int prefer_hp_amp:1; /* enable HP amp for speaker if any */
 unsigned int add_stereo_mix_input:2; /* add aamix as a capture src */
 unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */
+unsigned int add_in_jack_modes:1; /* add in jack mode enum ctls */
+unsigned int add_out_jack_modes:1; /* add out jack mode enum ctls */
 unsigned int power_down_unused:1; /* power down unused widgets */
 unsigned int dac_min_mute:1; /* minimal = mute for DACs */

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 8e02cdf..b13f588 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1914,6 +1914,62 @@ static void alc889_fixup_mba21_vref(struct hda_codec
*codec,
   

Re: [pulseaudio-discuss] [ALC668]: Asus N751JK - surround 2.1 does not automatically selected when external subwoofer is plugged

2015-07-10 Thread Raymond Yau

 First I think I am going to split this mail into two topics, starting
with the easiest one, the External Base speaker.


 - The Base speaker does not switch automatically to any Surround when
plugged in.


http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/profile-sets/default.conf


[Mapping analog-surround-21]
device-strings = surround21:%f
channel-map = front-left,front-right,lfe
-paths-output = analog-output analog-output-lineout
analog-output-speaker-paths-output = analog-output
analog-output-subwooferpriority = 8
direction = output


analog-output-subwoofer.conf


[General]
priority = 100
description-key = analog-output-speaker

[Properties]
device.icon_name = audio-speakers

[Jack Headphone]
state.plugged = no
state.unplugged = unknown

[Jack Front Headphone]
state.plugged = no
state.unplugged = unknown

[Jack External Subwoofer]
required-any = any
state.plugged = yes
state.unplugged = no

[Jack Line Out]
state.plugged = no
state.unplugged = unknown

[Jack Line Out Front]
state.plugged = no
state.unplugged = unknown

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

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

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

[Element Master Mono]
switch = off
volume = off

[Element Headphone+LO]
switch = off
volume = off

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

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

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

[Element Front Speaker]
switch = mute
volume = merge
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 = off
volume = off

[Element Surround]
switch = off
volume = off

[Element Surround Speaker]
switch = off
volume = off

[Element Speaker Surround]
switch = off
volume = off

[Element Side]
switch = off
volume = off

[Element Speaker Side]
switch = off
volume = off

[Element Center]
switch = off
volume = off

[Element Center Speaker]
switch = off
volume = off

[Element LFE]
switch = mute
volume = merge
override-map.1 = lfe
override-map.2 = lfe,lfe

[Element LFE Speaker]
switch = mute
volume = merge
override-map.1 = lfe
override-map.2 = lfe,lfe
required-any = any

[Element Bass Speaker]
switch = mute
volume = merge
override-map.1 = lfe
override-map.2 = lfe,lfe
required-any = any

[Element CLFE]
switch = mute
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
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Strange hardware: XFX nForce 780i SLI MCP

2015-07-10 Thread Raymond Yau
 Yesterday I got an interesting email related to dcaenc support.

 The person has an XFX nForce 780i SLI MCP board:
 http://www.nvidia.com/object/product_nforce_780i_sli_us.html ,
 http://www.evga.com/support/manuals/files/132-CK-NF78.pdf

 As you see on page 18 of the manual, this board has no HDMI output, but
 there is an optical SPDIF. Strangely enough, this SPDIF is his
 hdmi:CARD=NVidia,DEV=0 device.

 Given the recent discussions related to dynamically creating PCM devices
 for HDMI, I think you will be interested in this alsa-info output.

 Is there anything here that would need special treatment by ALSA or
 PulseAudio? Or, is this just a misnumbered/misnamed codec?


swap dig_out_pins of autocfg when type are different

diff --git a/sound/pci/hda/hda_auto_parser.c
b/sound/pci/hda/hda_auto_parser.c
index 03b7399..3ff16e8 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -405,6 +405,19 @@ int snd_hda_parse_pin_defcfg(struct hda_codec *codec,
 sort(cfg-inputs, cfg-num_inputs, sizeof(cfg-inputs[0]),
  compare_input_type, NULL);

+if (cfg-dig_outs == 2) {
+if (cfg-dig_out_type[0] != cfg-dig_out_type[1]) {
+if (cfg-dig_out_type[0] == HDA_PCM_TYPE_HDMI) {
+hda_nid_t temp = cfg-dig_out_pins[0];
+int temp_type =cfg-dig_out_type[0];
+cfg-dig_out_pins[0] = cfg-dig_out_pins[1];
+cfg-dig_out_type[0] = cfg-dig_out_type[1];
+cfg-dig_out_pins[1] = temp;
+cfg-dig_out_type[1] = temp_type;
+}
+}
+}
+
 /*
  * debug prints of the parsed results
  */




___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Strange hardware: XFX nForce 780i SLI MCP

2015-07-08 Thread Raymond Yau

  
   Yesterday I got an interesting email related to dcaenc support.
  
   The person has an XFX nForce 780i SLI MCP board:
 http://www.nvidia.com/object/product_nforce_780i_sli_us.html ,
 http://www.evga.com/support/manuals/files/132-CK-NF78.pdf
  
   As you see on page 18 of the manual, this board has no HDMI output,
 but there is an optical SPDIF. Strangely enough, this SPDIF is his
 hdmi:CARD=NVidia,DEV=0 device.
  
   Given the recent discussions related to dynamically creating PCM
 devices for HDMI, I think you will be interested in this alsa-info
output.
  
   Is there anything here that would need special treatment by ALSA or
 PulseAudio? Or, is this just a misnumbered/misnamed codec?
  

 Check whether BIOS set the internal spdif as HDMI as pin default

 The alsa driver prefer HDMI  instead of SPDIF when there are two Digital
 Outs


 According to the manual, there is no such setting in the BIOS.

 (original reporter BCCed just in case)

Node 0x11 [Pin Complex] wcaps 0x400300: Mono Digital
Control: name=HDMI Phantom Jack, index=0, device=0
Pincap 0x0010: OUT
Pin Default 0x18567530: [Jack] Digital Out at Int HDMI
Conn = Digital, Color = Yellow DefAssociation = 0x3, Sequence = 0x0
Misc = NO_PRESENCE
Pin-ctls: 0x40: OUT
Connection: 1 0x10

Node 0x1e [Pin Complex] wcaps 0x400300: Mono Digital
Control: name=SPDIF Phantom Jack, index=0, device=0
Pincap 0x0010: OUT
Pin Default 0x01441520: [Jack] SPDIF Out at Ext Rear
Conn = RCA, Color = Black DefAssociation = 0x2, Sequence = 0x0
Misc = NO_PRESENCE Pin-ctls: 0x40: OUT
Connection: 1 0x06

The driver use the first digital pin's type HDMI or SPDIF , you need to
modify the logic in hda_generic.c when type of two digital pins are
different
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Strange hardware: XFX nForce 780i SLI MCP

2015-07-07 Thread Raymond Yau

 Yesterday I got an interesting email related to dcaenc support.

 The person has an XFX nForce 780i SLI MCP board:
http://www.nvidia.com/object/product_nforce_780i_sli_us.html ,
http://www.evga.com/support/manuals/files/132-CK-NF78.pdf

 As you see on page 18 of the manual, this board has no HDMI output, but
there is an optical SPDIF. Strangely enough, this SPDIF is his
hdmi:CARD=NVidia,DEV=0 device.

 Given the recent discussions related to dynamically creating PCM devices
for HDMI, I think you will be interested in this alsa-info output.

 Is there anything here that would need special treatment by ALSA or
PulseAudio? Or, is this just a misnumbered/misnamed codec?


Check whether BIOS set the internal spdif as HDMI as pin default

The alsa driver prefer HDMI  instead of SPDIF when there are two Digital
Outs
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [RFC] Dynamically created PCM devices for HDMI/DisplayPort

2015-06-30 Thread Raymond Yau

 It looks like in the future the ALSA drivers for some Intel hardware
 will dynamically create a new PCM device when a DisplayPort monitor is
 plugged in. This is being discussed in this thread (part of the thread
 is also cross-posted to pulseaudio-discuss):

http://thread.gmane.org/gmane.comp.freedesktop.xorg.drivers.intel/62703/focus=63002


 No objections to the plan below, but some nitpicks.



 PulseAudio doesn't currently support dynamic PCM devices, so work is
 needed to add that support. I may work on that, or it may be someone
 else from Intel. I'll describe here what code changes I think we should
 make. That serves two purposes: to get feedback about the plan before
 any code gets written, and to help with the implementation work if
 someone else than me is going to write the code.

 This is a long mail, but I'm sure I still didn't think of every issue
 that will arise when implementing this...


 Event: monitor gets plugged in
 --

 The first thing that happens should be that PulseAudio gets a wakeup
 from the alsa mixer, when a new ELD control for the monitor is added.
 This is important, because the mixer should be ready when PulseAudio
 starts to use the new PCM device. It's up to the driver developer to do
 this right. This wakeup can be ignored, so no code changes are needed in
 PulseAudio to handle this.

 The second thing that happens is that udev notifies PulseAudio about a
 new PCM device. Interfacing with udev is done in
 src/modules/module-udev-detect.c. Currently PulseAudio only cares about
 new and removed cards, so module-udev-detect has to be modified to also
 keep track of what PCM devices each card has, so that new devices can be
 noticed.


 I am not sure whether this wakeup from alsa mixer first, from udev
second ordering is something that can be relied on. But a ELD control
exists when udev notifies us requirement looks sensible.



 When module-udev-detect sees a new PCM device, it needs to notify
 module-alsa-card about it. module-udev-detect's only interface with
 module-alsa-card is pa_module, which is not useful for adding the
 notification. I think we should move the bulk of the code in
 module-alsa-card.c to a new class: pa_alsa_card. module-udev-detect
 would then create pa_alsa_card objects instead of loading
 module-alsa-card instances. module-alsa-card would still exist as a
 wrapper around pa_alsa_card, but the module would not be used by
 module-udev-detect. With pa_alsa_card in place, we can add a
 pa_alsa_card_pcm_added() function to its API.


 OK.


 pa_alsa_card should be defined in src/modules/alsa/alsa-card.[ch] and
 included in the libalsa-util.la helper library.

 When moving the code from module-alsa-card to pa_alsa_card, some changes
 to the sink and source error handling is needed. Currently, if something
 fails in the IO thread of an alsa sink or source, the sink/source
 unloads the module that owns the sink/source (see the end of
 thread_func() in alsa-sink.c and alsa-source.c). Now the owner module of
 alsa sinks and sources becomes module-udev-detect, and we certainly
 don't want to unload that if a single sink or source fails. The
 sink/source should notify the pa_alsa_card object of the failure (new
 functions pa_alsa_card_sink_failed() and pa_alsa_card_source_failed()),
 and pa_alsa_card should free the failed pa_alsa_sink or pa_alsa_source
 object.


 The case of manually-loaded module-alsa-sink is not described here, but
should be.


 Let's get back to the pa_alsa_card_pcm_added() function. What should it
 do? We shouldn't support dynamic PCMs for arbitrary hw PCMs, because
 that's not compatible with relying on logical device names like front,
 surround51 etc. At this point we only need to support dynamic PCMs
 that are dedicated to hotplugged HDMI/DisplayPort/Thunderbolt devices.
 The current proposal to detect such PCMs is to add a new HDMI class to
 snd_pcm_class_t, which can be queried with snd_pcm_info_get_class().

 Currently when opening HDMI devices, we use hdmi:x,y as the device
 string, where x is the card index and y is the device index. The device
 index may be different than the hw device index, but the mapping between
 hdmi:x,y to hw:x,z is static. The mapping can be different with
 different drivers, AFAIK. We currently blindly try all device indexes
 from 0 to 7 when probing the card. Takashi Iwai told that such behaviour
 won't be compatible with drivers that create dynamic PCMs for HDMI. I
 guess the reason is that the dynamically allocated hw device indexes can
 (and usually do) fall outside the index range that is used in hdmi:x,y.

 Since the new HDMI PCM class is new, old kernels and old alsa-lib won't
 use that class even with PCMs that are actually dedicated to HDMI. We
 need to tell apart drivers that use the new HDMI PCM class and drivers
 that don't. With drivers that never use the HDMI class, we should keep
 using the hdmi:x,y device strings. With drivers that use the HDMI
 class, 

Re: [pulseaudio-discuss] Need help with Behringer Firepower FCA610 profile

2015-06-26 Thread Raymond Yau
  
   I'd prefer a multi-purpose configuration with multiple
 sinks/sources:
  
   - Source 'DAW':   aux1,aux2,aux3,aux4,aux5,aux6
   - Source 'Mic/Instrument':channel 0/1 = left/right
   - Source 'Line':  channel 2/3 = left/right
   - Source 'S/PDIF' channel 4/5 = left/right
   - Source 'TV' channel 4/5 = left/right
 (=S/PDIF)
  
   - Sink   'DAW':
 aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9,aux10
   - Sink   'Stereo1/Headphone A':   channel 0/1 = left/right
   - Sink   'Stereo2/Headphone B':   channel 2/3 = left/right
   - Sink   'Stereo3':   channel 4/5 = left/right
   - Sink   'Stereo4':   channel 6/7 = left/right
   - Sink   'Stereo5/SPDIF': channel 8/9 = left/right
   - Sink   'Surround 7.1':  front-left, front-right,
 rear-left, rear-right, center, lfe, side-left, side-right
   - Sink   'Surround 7.1 - 5.0':   front-left, front-right,
 rear-left, rear-right, center, lfe - front-left + front-right,
 side-left - front-left + rear-left, side-right - front-right +
 rear-right


http://cgit.freedesktop.org/pulseaudio/pulseaudio/plain/src/modules/alsa/mixer/profile-sets/native-instruments-traktor-audio10.conf
 [1]


 Pulseaudio only support different device

 If your driver only have simgle device for 10 channel playback and 6
 channel capture


 ALSA provides the following hardware-devices/plugs:

 - sysdefault:CARD=FCA610
 - front:CARD=FCA610,DEV=0
 - surround21:CARD=FCA610,DEV=0
 - surround40:CARD=FCA610,DEV=0
 - surround41:CARD=FCA610,DEV=0
 - surround50:CARD=FCA610,DEV=0
 - surround51:CARD=FCA610,DEV=0
 - surround71:CARD=FCA610,DEV=0
 - iec958:CARD=FCA610,DEV=0
 - dmix:CARD=FCA610,DEV=0
 - dsnoop:CARD=FCA610,DEV=0
 - hw:CARD=FCA610,DEV=0
 - plughw:CARD=FCA610,DEV=0

Are you sure that those devices really work ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Need help with Behringer Firepower FCA610 profile

2015-06-25 Thread Raymond Yau
2015-6-24 下午7:44於 Rene Bartsch m...@bartschnet.de寫道:

 I'd prefer a multi-purpose configuration with multiple sinks/sources:

 - Source 'DAW':   aux1,aux2,aux3,aux4,aux5,aux6
 - Source 'Mic/Instrument':channel 0/1 = left/right
 - Source 'Line':  channel 2/3 = left/right
 - Source 'S/PDIF' channel 4/5 = left/right
 - Source 'TV' channel 4/5 = left/right (=S/PDIF)

 - Sink   'DAW':
 aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9,aux10
 - Sink   'Stereo1/Headphone A':   channel 0/1 = left/right
 - Sink   'Stereo2/Headphone B':   channel 2/3 = left/right
 - Sink   'Stereo3':   channel 4/5 = left/right
 - Sink   'Stereo4':   channel 6/7 = left/right
 - Sink   'Stereo5/SPDIF': channel 8/9 = left/right
 - Sink   'Surround 7.1':  front-left, front-right, rear-left,
rear-right, center, lfe, side-left, side-right
 - Sink   'Surround 7.1 - 5.0':   front-left, front-right, rear-left,
rear-right, center, lfe - front-left + front-right, side-left -
front-left + rear-left, side-right - front-right + rear-right

http://cgit.freedesktop.org/pulseaudio/pulseaudio/plain/src/modules/alsa/mixer/profile-sets/native-instruments-traktor-audio10.conf

Pulseaudio only support different device

If your driver only have simgle device for 10 channel playback and 6
channel capture

You should use jackd

http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/ICE1712.conf;hb=HEAD

Some devices (front, surround51, surround71,iec958) can be defined similar
to iec1712 in usb-audio.conf

http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/USB-Audio.conf;hb=HEAD

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] PCM Capture Source of usb audio not supported by pulseaudio

2015-06-23 Thread Raymond Yau

 Do you mean mic capture volume always reset to maximum by driver or
pulseaudio ?

 No

 pactl list sources

 http://pastebin.com/Dd0XLamN

Seem usb audio is not your default source

Refer to pact list sources in

https://bugs.freedesktop.org/show_bug.cgi?id=90781#c32

Порти:
analog-input-mic: Мікрофон (priority: 8700)
analog-input-linein: Лінійний вхід (priority: 8100)
Активний порт: analog-input-linein

The active port is linein , pulseaudio does not use the source in alsa  pcm
capture source control as active ports when there are no jack detection
control.

http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/paths/analog-input.conf.common

;
;  We explicitly don't want to wrap the following sources:
;
;   CD
;   Synth/MIDI
;   Phone
;   Mix
;   Digital/SPDIF
;   Master
;   PC Speaker

http://www.alsa-project.org/alsa-doc/alsa-lib/group___simple_mixer.html#ga6679dc52033e29b88da32f5bbd45f205

To achieve the above logic, it does not use snd_mixer_selem_get_enum_item()
in alsa-mixer.c to get the current selected enumerated item for the given
mixer simple element to set the active port

linein is the default port when there are no jack detection kctl in current
implementation
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] PCM Capture Source of usb audio not supported by pulseaudio

2015-06-22 Thread Raymond Yau

 (   0.094|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Setting
analog-input-microphone (analog-input-microphone) priority=0
 (   0.094|   0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_switch(): e-alsa_name Line
 (   0.094|   0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_switch(): e-direction == PA_ALSA_DIRECTION_OUTPUT 28404576
 (   0.094|   0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_switch(): b 0
 (   0.094|   0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_switch(): me 28912288
 (   0.094|   0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_switch
Line dir=2 index=0

 However, Mic is selected in sound menu.

 The pcm capture source seem changed to mic which is index 0


 According to log output element_set_volume() is never called at start,
only when opening sound UI.
 But it goes to other if branch, because of write_to_hw being false.

Do you mean mic capture volume always reset to maximum by driver or
pulseaudio ?

pactl list sources

Why do write_to_hw change to false if you capture volume control have dB
scale ?

Creative_Technology_Ltd_SB_Omni_Surround_5.1_00Q6-00
namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no
deferred_volume=yes use_ucm=yes
card_properties=module-udev-detect.discovered=1).

Do you mean PCM playback volume control does not have 6 channels volume
control change wtite to hw to false ?

 Here is fresh log of first run after restart: http://pastebin.com/GJyUiraP
 Mic was initially selected in UI, but didn't work, then I switched to
Line and back.

0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Available mixer paths
(after tidying):
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Path Set 0x23d4720,
direction=2
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Path analog-input-mic
(Microphone), direction=2, priority=87, probed=yes, supported=yes,
has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=48,
min_dB=-12, max_dB=12
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Element Mic,
direction=2, switch=1, volume=1, volume_limit=-1, enumeration=0,
required=0, required_any=4, required_absent=0, mask=0x36f66,
n_channels=2, override_map=yes

What is the meanimg of required_any=4 and required = 0 for Element Mic ?

(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Element PCM Capture
Source, direction=2, switch=0, volume=0, volume_limit=-1, enumeration=1,
required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0,
override_map=no

What is meaning of required=0, required_any=0 for Element PCM Capture
Source ?

(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Option Mic
(analog-input-microphone/analog-input-microphone) index=0, priority=0
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Element Line,
direction=2, switch=2, volume=2, volume_limit=-1, enumeration=0,
required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2,
override_map=no
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Jack Mic,
alsa_name='Mic Jack', detection unavailable
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Jack Mic Phantom,
alsa_name='Mic Phantom Jack', detection unavailable
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Setting
analog-input-microphone (analog-input-microphone) priority=0



0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Path analog-input-linein
(Line In), direction=2, priority=81, probed=yes, supported=yes,
has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=48,
min_dB=-12, max_dB=12
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Element Line,
direction=2, switch=1, volume=1, volume_limit=-1, enumeration=0,
required=0, required_any=4, required_absent=0, mask=0x36f66,
n_channels=2, override_map=yes
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Element PCM Capture
Source, direction=2, switch=0, volume=0, volume_limit=-1, enumeration=1,
required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0,
override_map=no
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Option Line
(analog-input-linein/analog-input-linein) index=1, priority=0
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Element Mic,
direction=2, switch=2, volume=2, volume_limit=-1, enumeration=0,
required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2,
override_map=no
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Jack Line,
alsa_name='Line Jack', detection unavailable
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Jack Line Phantom,
alsa_name='Line Phantom Jack', detection unavailable
(   0.325|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Setting
analog-input-linein (analog-input-linein) priority=0

Do the availability of both mic and line in ports are unknown since there
is no jack detection control ?

Do you mean pulseaudio select line in as active port when both ports are
unknown availability ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org

Re: [pulseaudio-discuss] S24_3LE not support in try_auto of set_format

2015-06-22 Thread Raymond Yau
  
   Do you mean you still cannot force pulseaudio to use 24 bits for
 your creative usb audio ?
  
   Seem try auto format did not include 24bits
  
   I have 24bit explicitly in pulseaudio config currently:
  
   default-sample-format = s24le
  
   But it still uses 16bit, didn't managed how to force it to use 24bit

 static const pa_sample_format_t try_order[] = {
  PA_SAMPLE_FLOAT32NE,
  PA_SAMPLE_FLOAT32RE,
  PA_SAMPLE_S32NE,
  PA_SAMPLE_S32RE,
  PA_SAMPLE_S24_32NE,
  PA_SAMPLE_S24_32RE,
  PA_SAMPLE_S24NE,
  PA_SAMPLE_S24RE,
 +  PA_SAMPLE_S24LE,
  PA_SAMPLE_S16NE,
  PA_SAMPLE_S16RE,
  PA_SAMPLE_ALAW,
  PA_SAMPLE_ULAW,
  PA_SAMPLE_U8
  };

 Seem missing PA_SAMPLE_S24LE in try_order, not sure any assembley code
 need to be changed


 S24LE is the same as S24NE on little-endian archs, and the same as S24RE
on big-endian archs.

  LE = Little endian
  BE = Big endian
  NE = Native endian
  RE = Reverse endian (i e, the opposite to the native one)



Can you post the output

aplay -D hw:CARD=S51 --dump-hw-params stereo.wav

to find which alsa format supported by your usb 5.1 ?

Can you post pulseaudio log which contain

   0.091|   0.000) D: [pulseaudio] alsa-util.c: Trying hw:1,1,0 with
SND_PCM_NO_AUTO_FORMAT ...
(   0.091|   0.000) D: [pulseaudio] alsa-util.c: Managed to open hw:1,1,0
(   0.091|   0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode
since BATCH flag is set
(   0.091|   0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size is
3640 ms
(   0.091|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.091|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.092|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.092|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.092|   0.000) D: [pulseaudio] alsa-util.c: Set neither period nor
buffer size.
(   0.093|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.093|   0.000) I: [pulseaudio] alsa-util.c: snd_pcm_hw_params failed:
Input/output error
(   0.093|   0.000) D: [pulseaudio] alsa-util.c: Trying hw:1,1,0 without
SND_PCM_NO_AUTO_FORMAT ...
(   0.093|   0.000) D: [pulseaudio] alsa-util.c: Managed to open hw:1,1,0
(   0.093|   0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode
since BATCH flag is set
(   0.093|   0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size is
3640 ms
(   0.093|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.094|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.094|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.094|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.094|   0.000) D: [pulseaudio] alsa-util.c: Set neither period nor
buffer size.
(   0.095|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.095|   0.000) I: [pulseaudio] alsa-util.c: snd_pcm_hw_params failed:
Input/output error

since I cannot reproduce those
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5) errors
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] PCM Capture Source of usb audio not supported by pulseaudio

2015-06-22 Thread Raymond Yau

 Do you mean mic capture volume always reset to maximum by driver or
pulseaudio ?

 No

 pactl list sources

 http://pastebin.com/Dd0XLamN

Your output did not include source usb audio input

Do you mean your usb audio are not default source ?

What is the default source ? alc892 analong input, alc892 output monitor,
usb output monitor or usb analog input

 I'm using 4.1 mode, since 2.1 is not working properly yet

What do you mean not working properly ?

Are you complie and run from git ?


 Why do write_to_hw change to false if you capture volume control have dB
scale ?

 I have no idea about this and following questions. There is something
wrong, but I have no idea what.

when pulseaudio did not find dB scale or user specify ignore dB scale ,
pulseaudio just set volume to maximum and use software volume

It use snd_mixer_elem_set_capture_volume instead of snd_mixer_elem_s
et_capture_dB
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] 2.1 profile does not work on usb 5.1 device ?

2015-06-22 Thread Raymond Yau

 pactl list sources

 http://pastebin.com/Dd0XLamN
 I'm using 4.1 mode, since 2.1 is not working properly yet

http://git.alsa-project.org/?p=alsa-lib.git;a=commit;h=1af088e39b75a0a0897c7036487b143e983cd423

Your pcm playback volume control is stereo , do pulseaudio allow you to
change the volume of 3 , 4,  5 or 6 different channels ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] PCM Capture Source of usb audio not supported by pulseaudio

2015-06-21 Thread Raymond Yau

 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Activating path
analog-input-mic
 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Path
analog-input-mic (Microphone), direction=2, priority=87, probed=yes,
supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0,
max_volume=48, min_dB=-12, max_dB=12
 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Element Mic,
direction=2, switch=1, volume=1, volume_limit=-1, enumeration=0,
required=0, required_any=4, required_absent=0, mask=0x36f66,
n_channels=2, override_map=yes
 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Element PCM Capture
Source, direction=2, switch=0, volume=0, volume_limit=-1, enumeration=1,
required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0,
override_map=no
 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Option Mic
(analog-input-microphone/analog-input-microphone) index=0, priority=0
 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Element Line,
direction=2, switch=2, volume=2, volume_limit=-1, enumeration=0,
required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2,
override_map=no
 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Jack Mic,
alsa_name='Mic Jack', detection unavailable
 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Jack Mic Phantom,
alsa_name='Mic Phantom Jack', detection unavailable
 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Setting
analog-input-microphone (analog-input-microphone) priority=0
 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_switch(): e-alsa_name Line
 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_switch():
e-direction == PA_ALSA_DIRECTION_OUTPUT 33694896

 Do you mean the direction is not input ?

 According to debug message, it is so, however in config:

Both are cvolume and cswitch

Simple mixer control 'Line',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 48
  Front Left: Capture 24 [50%] [0.00dB] [on]
  Front Right: Capture 24 [50%] [0.00dB] [on]
Simple mixer control 'Mic',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 48
  Front Left: Capture 24 [50%] [0.00dB] [on]
  Front Right: Capture 24 [50%] [0.00dB] [on]

Seem mono capture switch but capture volume are stereo


 [Mapping analog-stereo-input]
 device-strings = hw:%f,1,0
 paths-input = analog-input-mic analog-input-linein
 channel-map = left,right
 direction = input

 There is explicit mentioning of required direction.

 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_switch(): b 0

 pulseaudio seem just turn off line switch instead of turn on nic capture
volum/switch when activating mic path

 One line show element name , values or enum index and enum name instead
of three lines

tatic int element_set_switch(pa_alsa_element *e, snd_mixer_t *m, bool b) {
snd_mixer_elem_t *me;
snd_mixer_selem_id_t *sid;
int r;

pa_assert(m);
pa_assert(e);

SELEM_INIT(sid, e-alsa_name);
if (!(me = snd_mixer_find_selem(m, sid))) {
pa_log_warn(Element %s seems to have disappeared., e-alsa_name);
return -1;
}

if (e-direction == PA_ALSA_DIRECTION_OUTPUT)
r = snd_mixer_selem_set_playback_switch_all(me, b);
else
r = snd_mixer_selem_set_capture_switch_all(me, b);

if (r  0)
pa_log_warn(Failed to set switch of %s: %s, e-alsa_name,
pa_alsa_strerror(errno));
+   else
+  pa_log_dbg(element_set_switch %s dir=%d index=%d , e-alsa_name,
e-direction, b);
return r;
}


 Sorry, I'm not sure I understand what do you mean by this.
 I'm not C/C++ developer at all, can't even find definition of
snd_mixer_elem_t to find what is that and how to use it (my guess that
you've being asking about it, right?).

 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_option(): e-alsa_name PCM Capture Source
 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_option(): e-switch_use == PA_ALSA_SWITCH_SELECT 0
 (   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c:
element_set_option(): alsa_idx 0

 snd_mixer_selem_get_enum_item_name() provide the name of enum item by
index


The pcm capture source seem changed to mic which is index 0

There are some difference between Capture Source of ac97 codec and PCM
Capture Source of snd-usb-audio

The source of Ac97 capture source are  cswitch-exclusive , only one cswitch
can be on and others are off

Simple mixer control 'Line',0
  Capabilities: pvolume pswitch pswitch-joined cswitch cswitch-exclusive
penum
  Capture exclusive group: 0
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Front Left: Playback 0 [0%] [-34.50dB] [off] Capture [off]
  Front Right: Playback 0 [0%] [-34.50dB] [off] Capture [off]

Simple mixer control 'Mic',0
  Capabilities: pvolume pvolume-joined pswitch 

[pulseaudio-discuss] S24_3LE not support in try_auto of set_format

2015-06-21 Thread Raymond Yau

 Do you mean you still cannot force pulseaudio to use 24 bits for your
creative usb audio ?

 Seem try auto format did not include 24bits

 I have 24bit explicitly in pulseaudio config currently:

 default-sample-format = s24le

 But it still uses 16bit, didn't managed how to force it to use 24bit

static const pa_sample_format_t try_order[] = {
PA_SAMPLE_FLOAT32NE,
PA_SAMPLE_FLOAT32RE,
PA_SAMPLE_S32NE,
PA_SAMPLE_S32RE,
PA_SAMPLE_S24_32NE,
PA_SAMPLE_S24_32RE,
PA_SAMPLE_S24NE,
PA_SAMPLE_S24RE,
+  PA_SAMPLE_S24LE,
PA_SAMPLE_S16NE,
PA_SAMPLE_S16RE,
PA_SAMPLE_ALAW,
PA_SAMPLE_ULAW,
PA_SAMPLE_U8
};

Seem missing PA_SAMPLE_S24LE in try_order, not sure any assembley code need
to be changed

You need to call snd_pcm_hw_params_test_format first, if format is
supported call snd_pcm_hw_params_set_format

There are three calls in set_format

 -   if ((ret = snd_pcm_hw_params_set_format(pcm_handle, hwparams,
format_trans[*f])) = 0)
 -   return ret;
 +   if (snd_pcm_hw_params_test_format(pcm_handle, hwparams,
format_trans[*f]) == 0)
 +  return snd_pcm_hw_params_set_format(pcm_handle, hwparams,
format_trans[*f]);
+else
-   pa_log_debug(snd_pcm_hw_params_set_format(%s) failed: %s,
 snd_pcm_format_description(format_trans[*f]),
 pa_alsa_strerror(ret));
pa_log_debug(format (%s) not supported,
 snd_pcm_format_description(format_trans[*f]));
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] alsa-mixer: Recognize Dock Line Out jack

2015-06-20 Thread Raymond Yau

 Looks good, but analog-output-speaker-always.conf should be patched too.

http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules

It seem that those stac9200 in  90-pulseaudio.rules are affected by this
patch

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

The pin complexes of tac9200 codec does not has mute cap
The volume control and playback switch are shared by headphone and speaker

Pcm playback volume / switch of those stac9200 codecs  are changed to line
out playback volume / switch since auto parser move speaker pin/headphone
to spec-line_out_pins when there is no line out

Node 0x0b [Audio Selector] wcaps 0x300105: Stereo Amp-Out
  Control: name=PCM Playback Volume, index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name=PCM Playback Switch, index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: N/A
  Amp-Out vals:  [0x11 0x11]
  Connection: 1
 0x07

Node 0x0d [Pin Complex] wcaps 0x400181: Stereo
  Control: name=Headphone Jack, index=0, device=0
  Pincap 0x003f: IN OUT HP Detect Trigger ImpSense
  Pin Default 0x0421121f: [Jack] HP Out at Ext Right
Conn = 1/8, Color = Black
DefAssociation = 0x1, Sequence = 0xf
  Pin-ctls: 0xc0: OUT HP
  Unsolicited: tag=01, enabled=1
  Connection: 1
 0x0b
Node 0x0e [Pin Complex] wcaps 0x400181: Stereo
  Pincap 0x003f: IN OUT HP Detect Trigger ImpSense
  Pin Default 0x90170310: [Fixed] Speaker at Int N/A
Conn = Analog, Color = Unknown
DefAssociation = 0x1, Sequence = 0x0
Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Unsolicited: tag=00, enabled=0
  Connection: 1
 0x0b
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] alsa-mixer: Recognize Dock Line Out jack

2015-06-20 Thread Raymond Yau

 Looks good, but analog-output-speaker-always.conf should be patched too.

 Sjoerd, this does not disturb anything on your end, right?


http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa/mixer/paths/analog-output-headphones.conf?id=594da41d07edcebc5fd319388852a66cc3f12ace

Do this mean the driver won't create dock headphone playback swith when
dock headphone jack is created because headphone jack and dock headphone
jack share headphone playback volume control ?

How do pulseaudio mute dock headphone jack when headphone jack is plugged ?

Do this mean pulseaudio cannot disable driver auto mute mode ?

The driver create two headphone playblack switch with different index

Do driver always create headphone playback switch with index=0 for the
headphone jack and index=1 for dock headphone jack or vice versa ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] Added support for Creative SoundBlaster Omni Surround 5.1 USB sound card. Mic and Line in inputs were not working at all.

2015-06-20 Thread Raymond Yau
.
 Here is fresh verbose log with new debug messages:
http://pastebin.com/bfbrdfiv
 My debug lines start with element_set_option() and element_set_switch(),
also element_set_volume() was not called on start in my case, so it is not
present.

 I've tried to reflect in debug messages what exactly is printed.


(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Activating path
analog-input-mic
(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Path analog-input-mic
(Microphone), direction=2, priority=87, probed=yes, supported=yes,
has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=48,
min_dB=-12, max_dB=12
(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Element Mic,
direction=2, switch=1, volume=1, volume_limit=-1, enumeration=0,
required=0, required_any=4, required_absent=0, mask=0x36f66,
n_channels=2, override_map=yes
(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Element PCM Capture
Source, direction=2, switch=0, volume=0, volume_limit=-1, enumeration=1,
required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0,
override_map=no
(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Option Mic
(analog-input-microphone/analog-input-microphone) index=0, priority=0
(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Element Line,
direction=2, switch=2, volume=2, volume_limit=-1, enumeration=0,
required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2,
override_map=no
(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Jack Mic,
alsa_name='Mic Jack', detection unavailable
(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Jack Mic Phantom,
alsa_name='Mic Phantom Jack', detection unavailable
(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: Setting
analog-input-microphone (analog-input-microphone) priority=0
(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_switch():
e-alsa_name Line
(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_switch():
e-direction == PA_ALSA_DIRECTION_OUTPUT 33694896

Do you mean the direction is not input ?

(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_switch():
b 0

pulseaudio seem just turn off line switch instead of turn on nic capture
volum/switch when activating mic path

One line show element name , values or enum index and enum name instead of
three lines

(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_option():
e-alsa_name PCM Capture Source
(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_option():
e-switch_use == PA_ALSA_SWITCH_SELECT 0
(   0.090|   0.000) D: [lt-pulseaudio] alsa-mixer.c: element_set_option():
alsa_idx 0

snd_mixer_selem_get_enum_item_name() provide the name of enum item by index

Do you mean you still cannot force pulseaudio to use 24 bits for your
creative usb audio ?

Seem try auto format did not include 24bits
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] snd_pcm_avail no reliable

2015-06-16 Thread Raymond Yau
  
 below is what the terminate shows when running pcm_avail.c
  
 uid=0 gid=1007@nutshell:/ # alsactl_test
   min_period_size: 8 frames, dir: 0
   Playback hwparams: FIFO size is 8
   Hardware PCM card 0 'rsnd-dai.0-dirana3.0' device 0
subdevice 0
   Its setup is:
 stream   : PLAYBACK
 access   : RW_INTERLEAVED
 format   : S16_LE
 subformat: STD
 channels : 2
 rate : 48000
 exact rate   : 48000 (48000/1)
 msbits   : 16
 buffer_size  : 4096
 period_size  : 1024
 period_time  : 21333
 tstamp_mode  : NONE
 period_step  : 1
 avail_min: 1024
 period_event : 0
 start_threshold  : 1024
 stop_threshold   : 4096
 silence_threshold: 0
 silence_size : 0
 boundary : 1073741824
 appl_ptr : 0
 hw_ptr   : 0
   Playing silence
   Available: 0, loop iteration: 0
   Available: 1024, loop iteration: 1469
   Available: 2048, loop iteration: 5609
   Available: 3072, loop iteration: 9667
  
All I got is just the 4 lines.

 If your sound card only increment hw_ptr only at interrupt
occur, you
 need to increase default_rewind_safeguard from 256 bytes to your
 selected period size


 No. PulseAudio, in timer-scheduling mode, does not use periods
at all. You need to change the driver so that it reports
SNDRV_PCM_INFO_BATCH, so that PulseAudio does not try to use this mode.



 This mean that  your sound card won't work with timer
scheduling or
 dynamic latency, you can only archieve low latency by decrease
period size
 Why do pulseaudio enable timer scheduling when most sound card
use IRQ ?


 Because most broken sound cards driver authors forget to report
SNDRV_PCM_INFO_BATCH?
   
Why pulseaudio rely on the flag if your program can find out the
granulatity ?
  
   AFAIK, there isn't a way to figure out granularity. Having this
would be nice as we could be more intelligent about our tsched behaviour.
  
  
   There is not only no way to query granularity, in some cases it is
simply unknown. As for my approach (of measuring it directly), I currently
think (but do not insist) that it is not suitable for inclusion into
PulseAudio, because it is based on using a silent test sound,
busy-looping and repeatedly querying the position until it plays out. This
would be unreliable if there is an unrelated CPU usage spike, and I think
that busy-looping in general is not welcome.
 
  https://bugs.freedesktop.org/show_bug.cgi?id=86262#c19
 
  Seem hwptr of snd-usb-audio are  not that bad around 240 to 288 frames
(less than period size)  but not as good as snd-hda-intel 32 frames or
oxygen 8 frames
 
  How accurate do pulseaudio need to use timer base scheduling ?

 Our current safety margin on rewinds is 256 bytes or higher. If you can
confirm the USB audio max update size as being in the few hundred frames
range, we might be able to quirk this for now (till we have a better
mechanism, as is being discussed on alsa-devel).

Do the result of those two usb audio devices mean that pcm_available.c need
to use period time instead of period size for those usb audio and firewire ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] alsa-mixer: Recognize Dock Line Out jack

2015-06-15 Thread Raymond Yau

 Some machines provide Dock Line Out Jack control that should be
 handled like a normal line out.

Do it mean the name of the playback switch of dock line out jack will not
change from line out playback switch to dock line out playback switch ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] snd_pcm_avail no reliable

2015-06-10 Thread Raymond Yau
 
  
  

   below is what the terminate shows when running pcm_avail.c

   uid=0 gid=1007@nutshell:/ # alsactl_test
 min_period_size: 8 frames, dir: 0
 Playback hwparams: FIFO size is 8
 Hardware PCM card 0 'rsnd-dai.0-dirana3.0' device 0 subdevice 0
 Its setup is:
   stream   : PLAYBACK
   access   : RW_INTERLEAVED
   format   : S16_LE
   subformat: STD
   channels : 2
   rate : 48000
   exact rate   : 48000 (48000/1)
   msbits   : 16
   buffer_size  : 4096
   period_size  : 1024
   period_time  : 21333
   tstamp_mode  : NONE
   period_step  : 1
   avail_min: 1024
   period_event : 0
   start_threshold  : 1024
   stop_threshold   : 4096
   silence_threshold: 0
   silence_size : 0
   boundary : 1073741824
   appl_ptr : 0
   hw_ptr   : 0
 Playing silence
 Available: 0, loop iteration: 0
 Available: 1024, loop iteration: 1469
 Available: 2048, loop iteration: 5609
 Available: 3072, loop iteration: 9667

  All I got is just the 4 lines.
  
   If your sound card only increment hw_ptr only at interrupt occur,
you
   need to increase default_rewind_safeguard from 256 bytes to your
   selected period size
  
  
   No. PulseAudio, in timer-scheduling mode, does not use periods at
all. You need to change the driver so that it reports SNDRV_PCM_INFO_BATCH,
so that PulseAudio does not try to use this mode.
  
  
  
   This mean that  your sound card won't work with timer scheduling or
   dynamic latency, you can only archieve low latency by decrease
period size
   Why do pulseaudio enable timer scheduling when most sound card use
IRQ ?
  
  
   Because most broken sound cards driver authors forget to report
SNDRV_PCM_INFO_BATCH?
 
  Why pulseaudio rely on the flag if your program can find out the
granulatity ?

 AFAIK, there isn't a way to figure out granularity. Having this would be
nice as we could be more intelligent about our tsched behaviour.


 There is not only no way to query granularity, in some cases it is simply
unknown. As for my approach (of measuring it directly), I currently think
(but do not insist) that it is not suitable for inclusion into PulseAudio,
because it is based on using a silent test sound, busy-looping and
repeatedly querying the position until it plays out. This would be
unreliable if there is an unrelated CPU usage spike, and I think that
busy-looping in general is not welcome.

https://bugs.freedesktop.org/show_bug.cgi?id=86262#c19

Seem hwptr of snd-usb-audio are  not that bad around 240 to 288 frames
(less than period size)  but not as good as snd-hda-intel 32 frames or
oxygen 8 frames

How accurate do pulseaudio need to use timer base scheduling ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] snd_pcm_avail no reliable

2015-06-09 Thread Raymond Yau

 I tried using a smaller period_size (about 1/16 of hwbuf_size),
snd_pcm_avail returned a better value.

Period bytes  = 2Kbytes which is still larger than the default
rewind_safeguard 512 bytes

 But cpu usage moved from 1% to 4%, since we are using it in a
automotive, we don`t care about power saving,  I think it is acceptable.

 But I`m not sure if there is any other down side about time based
scheduling ?


___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] snd_pcm_avail no reliable

2015-06-09 Thread Raymond Yau
 
  
  

   below is what the terminate shows when running pcm_avail.c

   uid=0 gid=1007@nutshell:/ # alsactl_test
 min_period_size: 8 frames, dir: 0
 Playback hwparams: FIFO size is 8
 Hardware PCM card 0 'rsnd-dai.0-dirana3.0' device 0 subdevice 0
 Its setup is:
   stream   : PLAYBACK
   access   : RW_INTERLEAVED
   format   : S16_LE
   subformat: STD
   channels : 2
   rate : 48000
   exact rate   : 48000 (48000/1)
   msbits   : 16
   buffer_size  : 4096
   period_size  : 1024
   period_time  : 21333
   tstamp_mode  : NONE
   period_step  : 1
   avail_min: 1024
   period_event : 0
   start_threshold  : 1024
   stop_threshold   : 4096
   silence_threshold: 0
   silence_size : 0
   boundary : 1073741824
   appl_ptr : 0
   hw_ptr   : 0
 Playing silence
 Available: 0, loop iteration: 0
 Available: 1024, loop iteration: 1469
 Available: 2048, loop iteration: 5609
 Available: 3072, loop iteration: 9667

  All I got is just the 4 lines.
  
   If your sound card only increment hw_ptr only at interrupt occur, you
   need to increase default_rewind_safeguard from 256 bytes to your
   selected period size
  
  
   No. PulseAudio, in timer-scheduling mode, does not use periods at
all. You need to change the driver so that it reports SNDRV_PCM_INFO_BATCH,
so that PulseAudio does not try to use this mode.
  
  
  
   This mean that  your sound card won't work with timer scheduling or
   dynamic latency, you can only archieve low latency by decrease
period size
   Why do pulseaudio enable timer scheduling when most sound card use
IRQ ?
  
  
   Because most broken sound cards driver authors forget to report
SNDRV_PCM_INFO_BATCH?
 
  Why pulseaudio rely on the flag if your program can find out the
granulatity ?

 AFAIK, there isn't a way to figure out granularity. Having this would be
nice as we could be more intelligent about our tsched behaviour.


But in this case, alecandra `s program already indicate hw_ptr only
increment by period size which is not suitable to enable timer base
scheduling

The result also indicate pulseaudio have to change default rewind safeguard

What granularity do pulseaudio need for timer base scheduling ?

(e.g. sound card must report position better than 10ms processing time)
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] snd_pcm_avail no reliable

2015-06-09 Thread Raymond Yau
  
   
   
 
below is what the terminate shows when running pcm_avail.c
 
uid=0 gid=1007@nutshell:/ # alsactl_test
  min_period_size: 8 frames, dir: 0
  Playback hwparams: FIFO size is 8
  Hardware PCM card 0 'rsnd-dai.0-dirana3.0' device 0 subdevice 0
  Its setup is:
stream   : PLAYBACK
access   : RW_INTERLEAVED
format   : S16_LE
subformat: STD
channels : 2
rate : 48000
exact rate   : 48000 (48000/1)
msbits   : 16
buffer_size  : 4096
period_size  : 1024
period_time  : 21333
tstamp_mode  : NONE
period_step  : 1
avail_min: 1024
period_event : 0
start_threshold  : 1024
stop_threshold   : 4096
silence_threshold: 0
silence_size : 0
boundary : 1073741824
appl_ptr : 0
hw_ptr   : 0
  Playing silence
  Available: 0, loop iteration: 0
  Available: 1024, loop iteration: 1469
  Available: 2048, loop iteration: 5609
  Available: 3072, loop iteration: 9667
 
   All I got is just the 4 lines.
   
If your sound card only increment hw_ptr only at interrupt occur,
you
need to increase default_rewind_safeguard from 256 bytes to your
selected period size
   
   
No. PulseAudio, in timer-scheduling mode, does not use periods at
all.
You need to change the driver so that it reports
SNDRV_PCM_INFO_BATCH, so
that PulseAudio does not try to use this mode.
   
   
   
This mean that  your sound card won't work with timer scheduling
or
dynamic latency, you can only archieve low latency by decrease
period
size
Why do pulseaudio enable timer scheduling when most sound card use
IRQ ?
   
   
Because most broken sound cards driver authors forget to report
SNDRV_PCM_INFO_BATCH?
  
   Why pulseaudio rely on the flag if your program can find out the
   granulatity ?
 
  AFAIK, there isn't a way to figure out granularity. Having this would
be
  nice as we could be more intelligent about our tsched behaviour.
 
 
  But in this case, alecandra `s program already indicate hw_ptr only
  increment by period size which is not suitable to enable timer base
  scheduling

 There are two cases: the first is that pointer updates happen at
 period size, which should imply the BATCH flag, and we just disable
 timer-based scheduling.

Is this asoc sound card ?

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/soc/soc-generic-dmaengine-pcm.c?id=acde50a7bf1fd6ae0baa4402f0a02c4b1bd4c990
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] Added support for Creative SoundBlaster Omni Surround 5.1 USB sound card. Mic and Line in inputs were not working at all.

2015-06-09 Thread Raymond Yau

 During Activating path analog-input-mic,
 You may need add pa_log_info() to element_set_volume() ,
element_set_switch() and element_set_option() to log  alsa mixer element
and values (mic capture volume, mic capture switch and pcm capture source)
set by pulseaudio

 Do I need to put it into source code and recompile or what?


If you want to find out why mic was not selected

You need add pa_log_dbg to dump e-alsa_name and corresponding value for
those snd_mixer_selem_set_* functions in element_set_volume() ,
element_set_switch() and element_set_option()


snd_mixer_selem_set_playback_dB();

snd_mixer_selem_set_capture_dB()

 snd_mixer_selem_set_playback_switch_all();

 snd_mixer_selem_set_capture_switch_all();

snd_mixer_selem_set_enum_item()
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Fwd: [alsa-devel] Front speakers doesn't work in multichannel output, regression in ALC888

2015-06-08 Thread Raymond Yau
   No change.
  
http://www.alsa-project.org/db/?f=30b3f0087374b914a20dbe20a618fb892a5d6fd5
 
  Are there any  offical specificaion ?
 
  So far most review only mention stereo speakers and subwoofer, the
service
  guide only show how to replace two internal speakers

 Service manual mentions
  Dolby®-certified surround sound system with two built-in stereo
speakers and
 one subwoofer supporting low-frequency effects

 so all additional channels what I'm hearing in Windows is emulated. I hope
 that it is clear now that my laptop has two internal speakers and one
 subwoofer.


You have to determine which node 0x16 or 0x17 is your subwoofer and remove
the redundant speaker pin fixup

Thanks. I know how to help myself, but I expected it by default. I wonder
how  many other users will manage to get their sound working good as
before  regression.  And wasn't model=acer-aspire-4930g some sort of
early patching which was  thrown out of official code?

After remove the redundant internal speaker, 5.1 is only available after
you change the channel mode

Can  alsactl restore the channel mode before pulseaudio probe the sound
cards ?

Auto mic select is not enabled when the notebook has mic jack and line in
jack , internl mic

As jack retasking is specific to snd-hda-intel and some multi cjannel ac97
codecs

It is not easy to force pulseaudio to stop all client connection, reprobe
the profiles on board audio after jack retasking

hdajackretask also perform the same function
stop pulseaudio and using dynamic reconfiguration/early patching

For those notebook with headphone spdif combo jack, it need a customised
iec958.conf and you can use headphone jack to make iec958 unavailable

http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/paths/iec958-stereo-output.conf

[Jack Headphone]
state.plugged = no
state.unplugged = unknown
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] snd_pcm_avail no reliable

2015-06-08 Thread Raymond Yau


  
 below is what the terminate shows when running pcm_avail.c
  
 uid=0 gid=1007@nutshell:/ # alsactl_test
   min_period_size: 8 frames, dir: 0
   Playback hwparams: FIFO size is 8
   Hardware PCM card 0 'rsnd-dai.0-dirana3.0' device 0 subdevice 0
   Its setup is:
 stream   : PLAYBACK
 access   : RW_INTERLEAVED
 format   : S16_LE
 subformat: STD
 channels : 2
 rate : 48000
 exact rate   : 48000 (48000/1)
 msbits   : 16
 buffer_size  : 4096
 period_size  : 1024
 period_time  : 21333
 tstamp_mode  : NONE
 period_step  : 1
 avail_min: 1024
 period_event : 0
 start_threshold  : 1024
 stop_threshold   : 4096
 silence_threshold: 0
 silence_size : 0
 boundary : 1073741824
 appl_ptr : 0
 hw_ptr   : 0
   Playing silence
   Available: 0, loop iteration: 0
   Available: 1024, loop iteration: 1469
   Available: 2048, loop iteration: 5609
   Available: 3072, loop iteration: 9667
  
All I got is just the 4 lines.

 If your sound card only increment hw_ptr only at interrupt occur, you
 need to increase default_rewind_safeguard from 256 bytes to your
 selected period size


 No. PulseAudio, in timer-scheduling mode, does not use periods at all.
You need to change the driver so that it reports SNDRV_PCM_INFO_BATCH, so
that PulseAudio does not try to use this mode.



 This mean that  your sound card won't work with timer scheduling or
 dynamic latency, you can only archieve low latency by decrease period
size
 Why do pulseaudio enable timer scheduling when most sound card use IRQ ?


 Because most broken sound cards driver authors forget to report
SNDRV_PCM_INFO_BATCH?

Why pulseaudio rely on the flag if your program can find out the
granulatity ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] snd_pcm_avail no reliable

2015-06-08 Thread Raymond Yau

  
 below is what the terminate shows when running pcm_avail.c
  
 uid=0 gid=1007@nutshell:/ # alsactl_test
   min_period_size: 8 frames, dir: 0
   Playback hwparams: FIFO size is 8
   Hardware PCM card 0 'rsnd-dai.0-dirana3.0' device 0 subdevice 0
   Its setup is:
 stream   : PLAYBACK
 access   : RW_INTERLEAVED
 format   : S16_LE
 subformat: STD
 channels : 2
 rate : 48000
 exact rate   : 48000 (48000/1)
 msbits   : 16
 buffer_size  : 4096
 period_size  : 1024
 period_time  : 21333
 tstamp_mode  : NONE
 period_step  : 1
 avail_min: 1024
 period_event : 0
 start_threshold  : 1024
 stop_threshold   : 4096
 silence_threshold: 0
 silence_size : 0
 boundary : 1073741824
 appl_ptr : 0
 hw_ptr   : 0
   Playing silence
   Available: 0, loop iteration: 0
   Available: 1024, loop iteration: 1469
   Available: 2048, loop iteration: 5609
   Available: 3072, loop iteration: 9667
  
All I got is just the 4 lines.

 If your sound card only increment hw_ptr only at interrupt occur, you
 need to increase default_rewind_safeguard from 256 bytes to your
 selected period size


 No. PulseAudio, in timer-scheduling mode, does not use periods at all.
You need to change the driver so that it reports SNDRV_PCM_INFO_BATCH, so
that PulseAudio does not try to use this mode.



 This mean that  your sound card won't work with timer scheduling or
 dynamic latency, you can only archieve low latency by decrease period
size
 Why do pulseaudio enable timer scheduling when most sound card use IRQ ?


 Because most broken sound cards driver authors forget to report
SNDRV_PCM_INFO_BATCH?


Most driver use irq interrupt , only a few sound cards ( seem less than
ten) can report   DMA_RESIDUE_GRANULARITY_BURST

Why do timer based scheduling enablef by default ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] snd_pcm_avail no reliable

2015-06-08 Thread Raymond Yau

I found some audio noise problem when I trying to set the sink latency
to a lower value.

here is the alsa dump:

 D/NMAudio ( 1959): Its setup is:
 D/NMAudio ( 1959):   stream   : PLAYBACK
 D/NMAudio ( 1959):   access   : MMAP_INTERLEAVED
 D/NMAudio ( 1959):   format   : S16_LE
 D/NMAudio ( 1959):   subformat: STD
 D/NMAudio ( 1959):   channels : 2
 D/NMAudio ( 1959):   rate : 22050
 D/NMAudio ( 1959):   exact rate   : 22050 (22050/1)
 D/NMAudio ( 1959):   msbits   : 16
 D/NMAudio ( 1959):   buffer_size  : 8192
 D/NMAudio ( 1959):   period_size  : 2048
 D/NMAudio ( 1959):   period_time  : 92879
 D/NMAudio ( 1959):   tstamp_mode  : ENABLE
 D/NMAudio ( 1959):   period_step  : 1
 D/NMAudio ( 1959):   avail_min: 7751
 D/NMAudio ( 1959):   period_event : 0
 D/NMAudio ( 1959):   start_threshold  : -1
 D/NMAudio ( 1959):   stop_threshold   : 1073741824
 D/NMAudio ( 1959):   silence_threshold: 0
 D/NMAudio ( 1959):   s

here is the log when problem happened:

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/include/linux/dmaengine.h

* @DMA_RESIDUE_GRANULARITY_SEGMENT: Residue is updated after each
successfully
*  completed segment of the transfer (For cyclic transfers this is after
each
*  period). This is typically implemented by having the hardware generate an
*  interrupt after each transferred segment and then the drivers updates the
*  outstanding residue by the size of the segment. Another possibility is if
*  the hardware supports scatter-gather and the segment descriptor has a
field
*  which gets set after the segment has been completed. The driver then
counts
*  the number of segments without the flag set to compute the residue.
* @DMA_RESIDUE_GRANULARITY_BURST: Residue is updated after each transferred
*  burst. This is typically only supported if the hardware has a progress
*  register of some sort (E.g. a register with the current read/write
address
*  or a register with the amount of bursts/beats/bytes that have been
*  transferred or still need to be transferred).
*/

How accurate can you sound card hw_ptr increase ?  period size or DMA
brust size ?

http://mailman.alsa-project.org/pipermail/alsa-devel/2014-September/081501.html

you can try Alexander's pcm_avail.c
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [alsa-devel] Front speakers doesn't work in multichannel output, regression in ALC888

2015-06-07 Thread Raymond Yau

 My problem is that when I set channel output to Analog output surround
5.1
 (or 2.1 or 4.1), I hear no sound in front speakers, but in case of 5.1 or
4.1
 I can hear sound in rear speakers. I use kernel 3.19.5 and it didn't
happen in
 earlier kernels that is 3.18 and in 3.17 for sure.

 My configuration is:
 OS: Fedora 21 64 bit
 SoundCard: ALC888
 Model name: acer-aspire-4930g
 Laptop: Acer Aspire 5930g
 Speakers: external 5.1 with 3 jacks
 Sound channel configuration module is standard configuration module from
KDE.

 Additional info:
 1) When channel output is 5.1 and I unplug green jack and leave two others
 jacks connected then I can hear sound in laptop internal speakers.
 2) Earlier (kernel 3.18 and 3.17) I didn't have possibility to choose 2.1
 configuration and additionally to 4.1 configuration I could also choose
4.0
 configuration.

You have to provide pulseaudio verbose log

If driver create channel mode which allow you to support surround5.1 with
your headphone,  line in and mic jack

It is possible for pulseaudio mute two of your external 5.1 speaker when
headphone jack is plugged

http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/paths/analog-output-headphones.conf

[Element Rear]
switch = off
volume = off

[Element Surround]
switch = off
volume = off

[Element Center]
switch = off
volume = off

[Element LFE]
switch = off
volume = off
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] Added support for Creative SoundBlaster Omni Surround 5.1 USB sound card. Mic and Line in inputs were not working at all.

2015-06-06 Thread Raymond Yau

 Do capture work as there is no output of snd_pcm_dump of the
snd-usb-audio 's hw params ?

 Well, after system restart Mic is not working, while it is available and
selected in UI.
 After single switch to Line and back to Mic it starts working fine.
 I wasn't able to reproduce it twice during working session, so, here is
verbose log of the first start right after system restart where Mic was
initially selected but didn't work, and started working after switching to
Line and back: http://pastebin.com/fr0cTUu3

During Activating path analog-input-mic,
You may need add pa_log_info() to element_set_volume() ,
element_set_switch() and element_set_option() to log  alsa mixer element
and values (mic capture volume, mic capture switch and pcm capture source)
set by pulseaudio

0.166|   0.000) D: [pulseaudio] alsa-mixer.c: Activating path
analog-input-mic
(   0.166|   0.000) D: [pulseaudio] alsa-mixer.c: Path analog-input-mic
(Microphone), direction=2, priority=87, probed=yes, supported=yes,
has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=48,
min_dB=-12, max_dB=12
(   0.166|   0.000) D: [pulseaudio] alsa-mixer.c: Element Mic, direction=2,
switch=1, volume=1, volume_limit=-1, enumeration=0, required=0,
required_any=4, required_absent=0, mask=0x36f66, n_channels=2,
override_map=yes
(   0.166|   0.000) D: [pulseaudio] alsa-mixer.c: Element PCM Capture
Source, direction=2, switch=0, volume=0, volume_limit=-1, enumeration=1,
required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0,
override_map=no
(   0.166|   0.000) D: [pulseaudio] alsa-mixer.c: Option Mic
(analog-input-microphone/analog-input-microphone) index=0, priority=0
(   0.166|   0.000) D: [pulseaudio] alsa-mixer.c: Element Line,
direction=2, switch=2, volume=2, volume_limit=-1, enumeration=0,
required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2,
override_map=no
(   0.166|   0.000) D: [pulseaudio] alsa-mixer.c: Jack Mic, alsa_name='Mic
Jack', detection unavailable
(   0.166|   0.000) D: [pulseaudio] alsa-mixer.c: Jack Mic Phantom,
alsa_name='Mic Phantom Jack', detection unavailable
(   0.166|   0.000) D: [pulseaudio] alsa-mixer.c: Setting
analog-input-microphone (analog-input-microphone) priority=0
(   0.166|   0.000) I: [pulseaudio] alsa-source.c: Successfully enabled
deferred volume.
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] (alsa-lib)pcm_hw.c: Invalid PCM state for chmap_get: OPEN

2015-06-05 Thread Raymond Yau

 Have you tested surround21?

 Yes, front speakers work fine, however LFE doesn't seem to work. Instead
when I try to test LFE (from sound UI) I have weird noise in one of rear
speakers. There are no such problems with any other mode though (I see that
officially only 5.1 mode is supported, however 4.1, 5.0 and 5.1 all work
fine), I decided to leave 2.1 mode for now, not sure whose fault is that.

http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=3c4a22ea49a881cdbfe2d50eef94b17e38104734;hp=1ef1c5cdb4301898499c0391cdfac2117c7d4684#patch17

It is strange that pcm state is open

(   0.089|   0.001) D: [pulseaudio] alsa-mixer.c: Looking at profile
output:analog-surround-21
(   0.089|   0.000) D: [pulseaudio] alsa-mixer.c: Checking for playback on
Analog Surround 2.1 (analog-surround-21)
(   0.089|   0.000) D: [pulseaudio] alsa-util.c: Trying surround21:1 with
SND_PCM_NO_AUTO_FORMAT ...
(   0.089|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c: Invalid PCM state
for chmap_get: OPEN

(   0.089|   0.000) D: [pulseaudio] alsa-util.c: Managed to open
surround21:1
(   0.089|   0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode
since BATCH flag is set
(   0.089|   0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size is
1213 ms
(   0.090|   0.000) D: [pulseaudio] alsa-util.c: Set buffer size first (to
4797 samples), period size second (to 1199 samples).
(   0.090|   0.000) I: [pulseaudio] alsa-util.c: Device surround21:1
doesn't support 44100 Hz, changed to 48000 Hz.
(   0.090|   0.000) D: [pulseaudio] alsa-mixer.c: Profile
output:analog-surround-21 supported.
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)

2015-06-05 Thread Raymond Yau

 I've removed default-sample-format = s24le, now it uses S16_LE
everywhere, fresh log: http://pastebin.com/aaLvtEUQ

Some error messages can be reproduced by set default-sample-format to s24le

But cannot reproduce  SNDRV_PCM_IOCTL_HW_PARAMS

Any error meesage in system log , it seem snd_usb_pcm_hw_params return
error with your usb sound card



 (   0.091|   0.000) D: [pulseaudio] alsa-util.c: Trying hw:1,1,0 with
SND_PCM_NO_AUTO_FORMAT ...
 (   0.091|   0.000) D: [pulseaudio] alsa-util.c: Managed to open hw:1,1,0
 (   0.091|   0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode
since BATCH flag is set
 (   0.091|   0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size
is 3640 ms
 (   0.091|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
 (   0.091|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
 (   0.092|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
 (   0.092|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
 (   0.092|   0.000) D: [pulseaudio] alsa-util.c: Set neither period nor
buffer size.
 (   0.093|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
 (   0.093|   0.000) I: [pulseaudio] alsa-util.c: snd_pcm_hw_params
failed: Input/output error
 (   0.093|   0.000) D: [pulseaudio] alsa-util.c: Trying hw:1,1,0 without
SND_PCM_NO_AUTO_FORMAT ...
 (   0.093|   0.000) D: [pulseaudio] alsa-util.c: Managed to open hw:1,1,0
 (   0.093|   0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode
since BATCH flag is set
 (   0.093|   0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size
is 3640 ms
 (   0.093|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
 (   0.094|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
 (   0.094|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
 (   0.094|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
 (   0.094|   0.000) D: [pulseaudio] alsa-util.c: Set neither period nor
buffer size.
 (   0.095|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
 (   0.095|   0.000) I: [pulseaudio] alsa-util.c: snd_pcm_hw_params
failed: Input/output error
 (   0.095|   0.000) D: [pulseaudio] alsa-util.c: Trying plug:hw:1,1,0
with SND_PCM_NO_AUTO_FORMAT ...

 Do capture work as there is no output of snd_pcm_dump of the
snd-usb-audio 's hw params ?

 Well, after system restart Mic is not working, while it is available and
selected in UI.
 After single switch to Line and back to Mic it starts working fine.
 I wasn't able to reproduce it twice during working session, so, here is
verbose log of the first start right after system restart where Mic was
initially selected but didn't work, and started working after switching to
Line and back: http://pastebin.com/fr0cTUu3

It is strange that hardware volume are -19.5dB/-20dB when  dB range of Mic
capture volume and Line Capture Volume from -12 dB to +12dB

9.416|   0.000) D: [alsa-source-USB Audio] alsa-mixer.c: Setting
analog-input-linein (analog-input-linein) priority=0
(   9.418|   0.001) I: [alsa-source-USB Audio] alsa-source.c: Successfully
enabled deferred volume.
(   9.418|   0.000) I: [alsa-source-USB Audio] alsa-source.c: Hardware
volume ranges from -12,00 dB to 12,00 dB.
(   9.418|   0.000) I: [alsa-source-USB Audio] alsa-source.c: Fixing base
volume to -12,00 dB
(   9.418|   0.000) I: [alsa-source-USB Audio] alsa-source.c: Using
hardware volume control. Hardware dB scale supported.
(   9.418|   0.000) I: [alsa-source-USB Audio] alsa-source.c: Using
hardware mute control.
   9.419|   0.000) I: [pulseaudio] source.c: Changed port of source 2
alsa_input.usb-Creative_Technology_Ltd_SB_Omni_Surround_5.1_00Q6-00-S51.analog-stereo-input
to analog-input-linein
(   9.419|   0.000) I: [pulseaudio] module-device-restore.c: Restoring
volume for source
alsa_input.usb-Creative_Technology_Ltd_SB_Omni_Surround_5.1_00Q6-00-S51.analog-stereo-input.
(   9.419|   0.000) D: [alsa-source-USB Audio] alsa-source.c: Requested
volume: front-left: 31008 /  47% / -19,50 dB,   front-right: 30419 /  46% /
-20,00 dB
(   9.419|   0.000) D: [alsa-source-USB Audio] alsa-source.c: Got hardware
volume: front-left: 31008 /  47% / -19,50 dB,   front-right: 30419 /  46% /
-20,00 dB
(   9.419|   0.000) D: [alsa-source-USB Audio] alsa-source.c: Calculated
software volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 /
100% / 0,00 dB (accurate-enough=yes)
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)

2015-06-04 Thread Raymond Yau

 Do you mean try_auto does not work as expected ?

   [PA_SAMPLE_S24LE] = SND_PCM_FORMAT_S24_3LE,

 static const pa_sample_format_t try_order[] = {
 PA_SAMPLE_FLOAT32NE,
 PA_SAMPLE_FLOAT32RE,
 PA_SAMPLE_S32NE,
 PA_SAMPLE_S32RE,
 PA_SAMPLE_S24_32NE,
 PA_SAMPLE_S24_32RE,
 PA_SAMPLE_S24NE,
 PA_SAMPLE_S24RE,
 PA_SAMPLE_S16NE,
 PA_SAMPLE_S16RE,
 PA_SAMPLE_ALAW,
 PA_SAMPLE_ULAW,
 PA_SAMPLE_U8
 };

 No, I just found line in that file:

 ; default-sample-format = s16le

 This is comment, but I thought this is also default value, so I've added:

 default-sample-format = s24le

 at the end, didn't check it though.
 Should I remove it because of automatic detection?

try_order does contain PA_SAMPLE_S24LE

(   0.091|   0.000) D: [pulseaudio] alsa-util.c: Trying hw:1,1,0 with
SND_PCM_NO_AUTO_FORMAT ...
(   0.091|   0.000) D: [pulseaudio] alsa-util.c: Managed to open hw:1,1,0
(   0.091|   0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode
since BATCH flag is set
(   0.091|   0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size is
3640 ms
(   0.091|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.091|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.092|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.092|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.092|   0.000) D: [pulseaudio] alsa-util.c: Set neither period nor
buffer size.
(   0.093|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.093|   0.000) I: [pulseaudio] alsa-util.c: snd_pcm_hw_params failed:
Input/output error
(   0.093|   0.000) D: [pulseaudio] alsa-util.c: Trying hw:1,1,0 without
SND_PCM_NO_AUTO_FORMAT ...
(   0.093|   0.000) D: [pulseaudio] alsa-util.c: Managed to open hw:1,1,0
(   0.093|   0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode
since BATCH flag is set
(   0.093|   0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size is
3640 ms
(   0.093|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.094|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.094|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.094|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.094|   0.000) D: [pulseaudio] alsa-util.c: Set neither period nor
buffer size.
(   0.095|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.095|   0.000) I: [pulseaudio] alsa-util.c: snd_pcm_hw_params failed:
Input/output error
(   0.095|   0.000) D: [pulseaudio] alsa-util.c: Trying plug:hw:1,1,0 with
SND_PCM_NO_AUTO_FORMAT ...

Do capture work as there is no output of snd_pcm_dump of the snd-usb-audio
's hw params ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] Added support for Creative SoundBlaster Omni Surround 5.1 USB sound card. Mic and Line in inputs were not working at all.

2015-06-04 Thread Raymond Yau

 According to specification sound card is capable of 24bit 96kHz max, so I
have added:

 default-sample-format = s24le

 to my /etc/pulse/daemon.conf

Do you mean try_auto does not work as expected ?

  [PA_SAMPLE_S24LE] = SND_PCM_FORMAT_S24_3LE,

static const pa_sample_format_t try_order[] = {
PA_SAMPLE_FLOAT32NE,
PA_SAMPLE_FLOAT32RE,
PA_SAMPLE_S32NE,
PA_SAMPLE_S32RE,
PA_SAMPLE_S24_32NE,
PA_SAMPLE_S24_32RE,
PA_SAMPLE_S24NE,
PA_SAMPLE_S24RE,
PA_SAMPLE_S16NE,
PA_SAMPLE_S16RE,
PA_SAMPLE_ALAW,
PA_SAMPLE_ULAW,
PA_SAMPLE_U8
};
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] Added support for Creative SoundBlaster Omni Surround 5.1 USB sound card. Mic and Line in inputs were not working at all.

2015-06-04 Thread Raymond Yau
 pactl list sinks

 Приймач даних №1
 Стан: RUNNING
 Назва:
alsa_output.usb-Creative_Technology_Ltd_SB_Omni_Surround_5.1_00Q6-00-S51.analog-stereo
 Опис: SB Omni Surround 5.1 Аналогове стерео
 Драйвер: module-alsa-card.c
 Частотна специфікація: s24le 2кан. 48000Гц
 Карта каналів: front-left,front-right
 Модуль-власник: 7
 Стан вимикання: no
 Гучність: front-left: 27588 /  42% / -22,55 dB,   front-right: 27588
/  42% / -22,55 dB
 баланс 0,00
 Базова гучність: 65536 / 100% / 0,00 dB
 Джерело спостереження:
alsa_output.usb-Creative_Technology_Ltd_SB_Omni_Surround_5.1_00Q6-00-S51.analog-stereo.monitor
 Латентність: 108660 мкс, налаштовано 99937 мкс
 Прапорці: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
 Властивості:
 alsa.resolution_bits = 24
 device.api = alsa
 device.class = sound
 alsa.class = generic
 alsa.subclass = generic-mix
 alsa.name = USB Audio
 alsa.id = USB Audio
 alsa.subdevice = 0
 alsa.subdevice_name = subdevice #0
 alsa.device = 0
 alsa.card = 2
 alsa.card_name = SB Omni Surround 5.1
 alsa.long_card_name = Creative Technology Ltd SB Omni Surround
5.1 at usb-:00:14.0-6, full speed
 alsa.driver_name = snd_usb_audio
 device.bus_path = pci-:00:14.0-usb-0:6:1.0
 sysfs.path =
/devices/pci:00/:00:14.0/usb1/1-6/1-6:1.0/sound/card2
 udev.id =
usb-Creative_Technology_Ltd_SB_Omni_Surround_5.1_00Q6-00-S51
 device.bus = usb
 device.vendor.id = 041e
 device.vendor.name = Creative Technology, Ltd
 device.product.id = 322c
 device.product.name = SB Omni Surround 5.1
 device.serial =
Creative_Technology_Ltd_SB_Omni_Surround_5.1_00Q6
 device.string = front:2
 device.buffering.buffer_size = 28782
 device.buffering.fragment_size = 7194
 device.access_mode = mmap
 device.profile.name = analog-stereo
 device.profile.description = Аналогове стерео
 device.description = SB Omni Surround 5.1 Аналогове стерео
 alsa.mixer_name = USB Mixer
 alsa.components = USB041e:322c
 module-udev-detect.discovered = 1
 device.icon_name = audio-card-usb
 Порти:
 analog-output: Аналогове відтворення (priority: 9900)
 Активний порт: analog-output
 Формати:
 pcm


 How many profiles supported by omni ?

 I've tried to find something already and didn't succeed. Currently in
sound settings I can choose between Stereo, 2.1, 4.1, 5.0 and 5.1, Stereo
on S/PDIF (surround was not supported here, however images on official
website show that is should). There was 4.0 in past, but currently it is
not present.
 Funny thing is that even when S/PDIF chosen it still play sound through
Front/Headphones, can't check how it will work with real S/PDIF, also
S/PDIF volume is actually not absolute, but fraction from Analog Stereo,
not sure how it happens, but I had the same with other USB sound card even
without S/PDIF (Plantronics GameCom 777), it is like phantom output on
every card and works in similar way. I can remove S/PDIF, but there is a
chance that it may work for others.

Have you tested playback device 1 and 2 ?

It seem that some AudioStreaming Interface Descriptors contain 16 bits and
441000Hz

If device 0 only use S24_3LE, other device may support S16_LE and 441000Hz

AudioStreaming Interface Descriptor:
bLength11
bDescriptorType36
bDescriptorSubtype  2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize   2
bBitResolution 16
bSamFreqType1 Discrete
tSamFreq[ 0]48000

AudioStreaming Interface Descriptor:
bLength11
bDescriptorType36
bDescriptorSubtype  2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 2
bSubframeSize   3
bBitResolution 24
bSamFreqType1 Discrete
tSamFreq[ 0]48000

AudioStreaming Interface Descriptor:
bLength11
bDescriptorType36
bDescriptorSubtype  2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 6
bSubframeSize   2
bBitResolution 16
bSamFreqType1 Discrete
tSamFreq[ 0]48000

AudioStreaming Interface Descriptor:
bLength11
bDescriptorType36
bDescriptorSubtype  2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 6
bSubframeSize   3
bBitResolution 24
bSamFreqType1 

Re: [pulseaudio-discuss] [PATCH] Added support for Creative SoundBlaster Omni Surround 5.1 USB sound card. Mic and Line in inputs were not working at all.

2015-06-03 Thread Raymond Yau

 Why pulseaudio still try to open front device for recording ?
 Should pulseaudio just start from here ?

 I have no answers on those questions.

Seem missing direction = output in analog-stereo
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] Added support for Creative SoundBlaster Omni Surround 5.1 USB sound card. Mic and Line in inputs were not working at all.

2015-06-03 Thread Raymond Yau

 ---
  .../alsa/mixer/paths/analog-input-linein.conf  |  7 ++
  src/modules/alsa/mixer/paths/analog-input-mic.conf |  7 ++
  .../alsa/mixer/profile-sets/90-pulseaudio.rules|  1 +
  .../mixer/profile-sets/sb-omni-surround-5.1.conf   | 78
++
  4 files changed, 93 insertions(+)
  create mode 100644
src/modules/alsa/mixer/profile-sets/sb-omni-surround-5.1.conf


 diff --git
a/src/modules/alsa/mixer/profile-sets/sb-omni-surround-5.1.conf
b/src/modules/alsa/mixer/profile-sets/sb-omni-surround-5.1.conf
 new file mode 100644
 index 000..1c4aa7b
 --- /dev/null
 +++ b/src/modules/alsa/mixer/profile-sets/sb-omni-surround-5.1.conf
 @@ -0,0 +1,78 @@
 +# This file is part of PulseAudio.
 +#
 +# PulseAudio is free software; you can redistribute it and/or modify
 +# it under the terms of the GNU Lesser General Public License as
 +# published by the Free Software Foundation; either version 2.1 of the
 +# License, or (at your option) any later version.
 +#
 +# PulseAudio is distributed in the hope that it will be useful, but
 +# WITHOUT ANY WARRANTY; without even the implied warranty of
 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 +# General Public License for more details.
 +#
 +# You should have received a copy of the GNU Lesser General Public
License
 +# along with PulseAudio; if not, see http://www.gnu.org/licenses/.
 +
 +; Creative Sound Blaster Omni Surround 5.1
 +;
 +; This sound card have Mic/Line in at hw:%f,1,0 - this is the main
 +; difference from default.conf, also unsupported sections removed.
 +;
 +; See default.conf for an explanation on the directives used here.
 +
 +[General]
 +auto-profiles = yes
 +
 +[Mapping analog-stereo]
 +device-strings = front:%f hw:%f
 +channel-map = left,right
 +paths-output = analog-output
 +priority = 10
 +
 +[Mapping analog-stereo-input]
 +device-strings = hw:%f,1,0
 +paths-input = analog-input-mic analog-input-linein
 +channel-map = left,right
 +direction = input
 +

Why pulseaudio still try to open front device for recording ?

D: [pulseaudio] alsa-mixer.c: Checking for recording on Analog Stereo
(analog-stereo)
D: [pulseaudio] alsa-util.c: Trying front:2 with SND_PCM_NO_AUTO_FORMAT ...
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC2D0c' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device front:2: No such file
or directory
D: [pulseaudio] alsa-util.c: Trying hw:2 with SND_PCM_NO_AUTO_FORMAT ...
I: [pulseaudio] (alsa-lib)pcm_hw.c: open '/dev/snd/pcmC2D0c' failed (-2)
I: [pulseaudio] alsa-util.c: Error opening PCM device hw:2: No such file or
directory
D: [pulseaudio] alsa-mixer.c: Caching failure to open input:analog-stereo

Should pulseaudio just start from here ?

D: [pulseaudio] alsa-mixer.c: Looking at profile input:analog-stereo-input
D: [pulseaudio] alsa-mixer.c: Checking for recording on analog-stereo-input
(analog-stereo-input)
D: [pulseaudio] alsa-util.c: Trying hw:2,1,0 with SND_PCM_NO_AUTO_FORMAT ...
D: [pulseaudio] alsa-util.c: Managed to open hw:2,1,0
I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set

Seem pulseaudio always try to use pcm device name to open ctl/mixer device

I: [pulseaudio] (alsa-lib)conf.c: Unknown parameter 1
I: [pulseaudio] (alsa-lib)conf.c: Parse arguments error: No such file or
directory
I: [pulseaudio] (alsa-lib)control.c: Invalid CTL hw:2,1,0
I: [pulseaudio] alsa-util.c: Unable to attach to mixer hw:2,1,0: No such
file or directory
I: [pulseaudio] alsa-util.c: Successfully attached to mixer 'hw:2'

 +[Mapping analog-surround-21]
 +device-strings = surround21:%f
 +channel-map = front-left,front-right,lfe
 +paths-output = analog-output
 +priority = 5
 +direction = output

D: [pulseaudio] alsa-mixer.c: Looking at profile output:analog-surround-21
D: [pulseaudio] alsa-mixer.c: Checking for playback on Analog Surround 2.1
(analog-surround-21)
D: [pulseaudio] alsa-util.c: Trying surround21:2 with
SND_PCM_NO_AUTO_FORMAT ...
I: [pulseaudio] (alsa-lib)pcm_hw.c: Invalid PCM state for chmap_get: OPEN

I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
D: [pulseaudio] alsa-util.c: Set neither period nor buffer size.
I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
I: [pulseaudio] alsa-util.c: snd_pcm_hw_params failed: Input/output error

D: [pulseaudio] alsa-util.c: Trying hw:2,1,0 without SND_PCM_NO_AUTO_FORMAT
...
D: [pulseaudio] alsa-util.c: Managed to open hw:2,1,0
I: [pulseaudio] alsa-util.c: Disabling tsched mode since BATCH flag is set
D: [pulseaudio] alsa-util.c: Maximum hw buffer size is 3640 ms
I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
I: [pulseaudio] 

Re: [pulseaudio-discuss] [PATCH] Added support for Creative SoundBlaster Omni Surround 5.1 USB sound card. Mic and Line in inputs were not working at all.

2015-06-03 Thread Raymond Yau

 Do surround51 works since you have a hardware volume knob but PCM
playback volume is mono

 If I understood you correctly - I've took mono sound (wav from ALSA
package) and played it through VLC, all channels work as expected.

Card hw:2 'S51'/'Creative Technology Ltd SB Omni Surround 5.1 at
usb-:00:14.0-6.2, full spee'
  Mixer name : 'USB Mixer'
  Components : 'USB041e:322c'
  Controls  : 12
  Simple ctrls  : 5
Simple mixer control 'PCM',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 128
  Mono: Playback 91 [71%] [-18.50dB] [on]

Seem no individual channel volume control

Do this mean the balance slider in sound preference is useless ?

Usually those multichannel usb audio devices have this type of volume
control which is not supported by pulseaudio

Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right - Rear Left - Rear Right -
Front Center - Woofer - Side Left - Side Right
  Limits: Playback 0 - 197
  Mono:
  Front Left: Playback 196 [99%] [0.00dB] [on]
  Front Right: Playback 196 [99%] [0.00dB] [on]
  Rear Left: Playback 196 [99%] [0.00dB] [on]
  Rear Right: Playback 196 [99%] [0.00dB] [on]
  Front Center: Playback 196 [99%] [0.00dB] [on]
  Woofer: Playback 196 [99%] [0.00dB] [on]
  Side Left: Playback 196 [99%] [0.00dB] [on]
  Side Right: Playback 196 [99%] [0.00dB] [on]

http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa?id=527078523815587bfd021bc1d10782403e9b3e84
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] Added support for Creative SoundBlaster Omni Surround 5.1 USB sound card. Mic and Line in inputs were not working at all.

2015-06-03 Thread Raymond Yau
0.098|   0.000) D: [pulseaudio] alsa-util.c:
snd_pcm_hw_params_set_channels(4) failed: Invalid argument

   0.098|   0.000) D: [pulseaudio] alsa-mixer.c: Skipping profile
output:analog-surround-40+input:analog-stereo-input - will not be able to
open output:analog-surround-40

Seem not support 4 channels playback which is different from your claim

But 41 is supported

   0.098|   0.000) D: [pulseaudio] alsa-mixer.c: Looking at profile
output:analog-surround-41
(   0.098|   0.000) D: [pulseaudio] alsa-mixer.c: Checking for playback on
Analog Surround 4.1 (analog-surround-41)
(   0.098|   0.000) D: [pulseaudio] alsa-util.c: Trying surround41:1 with
SND_PCM_NO_AUTO_FORMAT ...
(   0.098|   0.000) D: [pulseaudio] alsa-util.c: Managed to open
surround41:1
(   0.098|   0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode
since BATCH flag is set
(   0.098|   0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size is
1213 ms
(   0.099|   0.000) D: [pulseaudio] alsa-util.c: Set buffer size first (to
4797 samples), period size second (to 1199 samples).
(   0.099|   0.000) I: [pulseaudio] alsa-util.c: Device surround41:1
doesn't support 44100 Hz, changed to 48000 Hz.
(   0.099|   0.000) D: [pulseaudio] alsa-mixer.c: Profile
output:analog-surround-41 supported.

Your capture device 1 seem support S24_3LE

0.101|   0.000) D: [pulseaudio] alsa-util.c: Managed to open hw:1,1,0
(   0.101|   0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode
since BATCH flag is set
(   0.101|   0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size is
3640 ms
(   0.101|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.101|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.102|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.102|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.102|   0.000) D: [pulseaudio] alsa-util.c: Set neither period nor
buffer size.
(   0.103|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.103|   0.000) I: [pulseaudio] alsa-util.c: snd_pcm_hw_params failed:
Input/output error

(   0.103|   0.000) D: [pulseaudio] alsa-util.c: Trying hw:1,1,0 without
SND_PCM_NO_AUTO_FORMAT ...
(   0.103|   0.000) D: [pulseaudio] alsa-util.c: Managed to open hw:1,1,0
(   0.103|   0.000) I: [pulseaudio] alsa-util.c: Disabling tsched mode
since BATCH flag is set
(   0.103|   0.000) D: [pulseaudio] alsa-util.c: Maximum hw buffer size is
3640 ms
(   0.104|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.104|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.104|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.105|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.105|   0.000) D: [pulseaudio] alsa-util.c: Set neither period nor
buffer size.
(   0.105|   0.000) I: [pulseaudio] (alsa-lib)pcm_hw.c:
SNDRV_PCM_IOCTL_HW_PARAMS failed (-5)
(   0.105|   0.000) I: [pulseaudio] alsa-util.c: snd_pcm_hw_params failed:
Input/output error

Not sure why it fail with Input/output error

(   0.105|   0.000) D: [pulseaudio] alsa-util.c: Trying plug:hw:1,1,0 with
SND_PCM_NO_AUTO_FORMAT ...

Seem default format change to S24_3LE

0.065|   0.000) D: [pulseaudio] alsa-util.c:
snd_pcm_hw_params_set_format(Signed 24 bit Little Endian in 3bytes) failed:
Invalid argument
(   0.065|   0.000) D: [pulseaudio] alsa-util.c:
snd_pcm_hw_params_set_format(Signed 24 bit Big Endian in 3bytes) failed:
Invalid argument
(   0.065|   0.000) D: [pulseaudio] alsa-util.c:
snd_pcm_hw_params_set_format(Float 32 bit Little Endian) failed: Invalid
argument
(   0.065|   0.000) D: [pulseaudio] alsa-util.c:
snd_pcm_hw_params_set_format(Float 32 bit Big Endian) failed: Invalid
argument

pactl list sinks

How many profiles supported by omni ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Capture volume

2015-06-01 Thread Raymond Yau

 Who/where is sensitivity settings for the microphone kept?

http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/paths/analog-input-mic.conf


 I try to use SFLPhone on a OpenSUSE KDE installation. SFLphone
 recognizes pulse and most seems to work. However when I receive or make
 a call, I always first have to locate KDEmix, find SFLphones capture
 devices and turn up the sensitivity. The sensitivity does not seem to be
 saved between calls.

If you sound card controls are not in mic conf, add it to the above conf
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] alsa-mixer: Add Line Out to known mixer controls

2015-05-22 Thread Raymond Yau
 ---
  src/modules/alsa/mixer/paths/analog-output-headphones-2.conf   | 4 
  src/modules/alsa/mixer/paths/analog-output-headphones.conf | 4 
  src/modules/alsa/mixer/paths/analog-output-lineout.conf| 6 ++
  src/modules/alsa/mixer/paths/analog-output-speaker-always.conf | 4 
  src/modules/alsa/mixer/paths/analog-output-speaker.conf| 4 
  5 files changed, 22 insertions(+)

 diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
b/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
 index ddabf77..1028b93 100644
 --- a/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
 +++ b/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
 @@ -47,6 +47,10 @@ volume = off
  switch = mute
  volume = zero

 +[Element Line Out]
 +switch = off
 +volume = off

Do any computer have two headphone jacks and Line Out Playback Volume ?

 +
  [Element Headphone+LO]
  switch = mute
  volume = zero
 diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf
b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
 index b6ee70b..a7a2140 100644
 --- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf
 +++ b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
 @@ -68,6 +68,10 @@ override-map.2 = all-left,all-right
  switch = off
  volume = off

 +[Element Line Out]
 +switch = off
 +volume = off

http://freedesktop.org/software/pulseaudio/doxygen/volume.html

Hence it is usually a better idea to treat all volume values as opaque with
a range from PA_VOLUME_MUTED (0%) to PA_VOLUME_NORM (100%) and to refrain
from any calculations with them.

Pulseaudio merge two controls (playback switch and playback volume ) into
it volume scale

It is a design problem of pulseaudio vokume scale

Do it mean pulseaudio won't restore line out playback volume when headphone
is unplugged ?

 diff --git
a/src/modules/alsa/mixer/paths/analog-output-speaker-always.conf
b/src/modules/alsa/mixer/paths/analog-output-speaker-always.conf
 index b6d9f94..101edd8 100644
 --- a/src/modules/alsa/mixer/paths/analog-output-speaker-always.conf
 +++ b/src/modules/alsa/mixer/paths/analog-output-speaker-always.conf
 @@ -68,6 +68,10 @@ volume = zero
  switch = mute
  volume = zero

 +[Element Line Out]
 +switch = off
 +volume = off
 +
  [Element Headphone+LO]
  switch = off
  volume = off
 diff --git a/src/modules/alsa/mixer/paths/analog-output-speaker.conf
b/src/modules/alsa/mixer/paths/analog-output-speaker.conf
 index 39193dd..e3b6c54 100644
 --- a/src/modules/alsa/mixer/paths/analog-output-speaker.conf
 +++ b/src/modules/alsa/mixer/paths/analog-output-speaker.conf
 @@ -84,6 +84,10 @@ volume = off
  switch = off
  volume = off

 +[Element Line Out]
 +switch = off
 +volume = off
 +
  [Element Speaker+LO]
  required-any = any
  switch = mute
 --

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [PATCH] alsa-mixer: Make line out path unavailable when Front Headphone is plugged in

2015-05-16 Thread Raymond Yau
2015-05-05 15:45 GMT+08:00 David Henningsson 
david.hennings...@canonical.com:

 This case was apparently overlooked.

 Signed-off-by: David Henningsson david.hennings...@canonical.com
 ---
  src/modules/alsa/mixer/paths/analog-output-lineout.conf | 4 
  1 file changed, 4 insertions(+)

 diff --git a/src/modules/alsa/mixer/paths/analog-output-lineout.conf
 b/src/modules/alsa/mixer/paths/analog-output-lineout.conf
 index 53ee2f4..68f444a 100644
 --- a/src/modules/alsa/mixer/paths/analog-output-lineout.conf
 +++ b/src/modules/alsa/mixer/paths/analog-output-lineout.conf
 @@ -29,6 +29,10 @@ required-any = any
  state.plugged = no
  state.unplugged = unknown

 +[Jack Front Headphone]
 +state.plugged = no
 +state.unplugged = unknown
 +
  [Jack Line Out Front]
  required-any = any

 --


 Why there is no [Element Line Out] in lineout.conf ?

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda?id=3abb4f4d0e7aaad0d12004b5057f4486a688752b
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [RFC] API for setting (default) port

2015-05-13 Thread Raymond Yau
 Since many years ago we have an API for setting default source/sink.

 Our default routing today is more port centric. So our UIs (at least the
 unity/gnome one) has developed ways around this, so that when a port is
 selected it first selects the right profile if needed.

 The problem is that in this world it's becoming more difficult to detect
 what the user actually wants, when the result is a chain of API calls. E
 g, if we first get a set profile call, we're not certain whether this
 is the user wanting to change the profile for the currently active port,
 or if this is the first part of a transition to a new port.


 This problem description isn't really detailed enough for me to
 understand what you're trying to solve.


 Ok. Assume you have 2.1 speakers, and headphones without full jack
 detection. (This is the case for some Dell laptops where the jack can be
 both used as headphone, headset and just mic, and the hardware cannot
 detect which one you plugged in.)

 Headphones are plugged in, and the user selects headphones manually.



Should the role of combo jack be defined by the driver when combo jack
support two or three roles ?

can user specify combo jack role as module parameter of snd-hda-intel when
the codec cannot  automatically differentiate headset and headphone ?

the driver use the combo jack parameter to set the role of the combo jack
1) headset - by remove hp mic pin and change headphone jack to headset jack
2) headphone - by remove hp mic pin and headset mic pin
3) mic  -- by set hp pin to mic pin and remove headset mic pin

driver can enable auto mic switch  when combo jack is set to single role
instead of asking the user whenever he plug the jack
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [alsa-devel] Front speakers doesn't work in multichannel output, regression in ALC888

2015-05-09 Thread Raymond Yau

 
 http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixe
r/paths/analog-output-headphones.conf
   
pulseaudio mute external center/lfe controls when headphone jack is
 
  plugged

 That would be unwanted.


This is common to all notebook using headphone jack and two other jacks to
support surround51 or surround71 since pulseaudio mute the other retasked
mio jack when headphone jack is plugged



   I used hdajackretask to override:
   PIN ID: 0x15 to Line out (front)


https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/patch/sound/pci/hda/patch_realtek.c?id=c3e837bbcc03e39991da5dd1f791c06cde9f7a45

When the static model were used, the jack was configured as line out
instead of headphone jack and there is no headphone playback volume

-static const struct hda_verb alc888_acer_aspire_4930g_verbs[] = {
-/* Enable unsolicited event for HP jack */
-{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC_HP_EVENT | AC_USRSP_EN},
-/* Connect HP out to front */
-{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
-{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
-{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
-{0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},

-static const struct snd_kcontrol_new alc888_acer_aspire_4930g_mixer[] = {
-HDA_CODEC_VOLUME(Front Playback Volume, 0x0c, 0x0, HDA_OUTPUT),
-HDA_BIND_MUTE(Front Playback Switch, 0x0c, 2, HDA_INPUT),

The jack is configured as headphone jack after the auto parser is used


  Pulseaudio don't know node 0x15 is headphone / Line Out (External
 speaker)
 
  select speaker profile mute the headphone playback switch

 Doesn't HP mean HeadPhone? Isn't solution to my problem obvious, namely add
 Line out capability to 0x15?


Are there any side effect if you change the headphone jack to Line Out jack
as the jack no longer enable HP amp ?


use add_out_jack_modes for create Headphone/Line Out jack mode control to
change Headphone to Line Out and vice versa


diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 3d2597b..f25cd23 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -180,10 +180,10 @@ static void parse_user_hints(struct hda_codec *codec)
 /* the following two are just for compatibility */
 val = snd_hda_get_bool_hint(codec, add_out_jack_modes);
 if (val = 0)
-spec-add_jack_modes = !!val;
+spec-add_out_jack_modes = !!val;
 val = snd_hda_get_bool_hint(codec, add_in_jack_modes);
 if (val = 0)
spec-add_jack_modes = !!val;
@@ -2640,7 +2642,7 @@ static void get_jack_mode_name(struct hda_codec
*codec, hda_nid_t pin,
 static int get_out_jack_num_items(struct hda_codec *codec, hda_nid_t pin)
 {
 struct hda_gen_spec *spec = codec-spec;
-if (spec-add_jack_modes) {
+if (spec-add_out_jack_modes || spec-add_jack_modes) {
 unsigned int pincap = snd_hda_query_pin_caps(codec, pin);
 if ((pincap  AC_PINCAP_OUT)  (pincap  AC_PINCAP_HP_DRV))
 return 2;
@@ -4892,7 +4895,7 @@ int snd_hda_gen_parse_auto_config(struct hda_codec
*codec,
 return err;
 }

-if (spec-add_jack_modes) {
+if (spec-add_out_jack_modes || spec-add_jack_modes) {
 if (cfg-line_out_type != AUTO_PIN_SPEAKER_OUT) {
 err = create_out_jack_modes(codec, cfg-line_outs,
 cfg-line_out_pins);
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index 56e4139..8d7568b 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -227,6 +227,8 @@ struct hda_gen_spec {
 unsigned int prefer_hp_amp:1; /* enable HP amp for speaker if any */
 unsigned int add_stereo_mix_input:2; /* add aamix as a capture src */
 unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */
+unsigned int add_out_jack_modes:1;
 unsigned int power_down_unused:1; /* power down unused widgets */
 unsigned int dac_min_mute:1; /* minimal = mute for DACs */
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [alsa-devel] Front speakers doesn't work in multichannel output, regression in ALC888

2015-05-08 Thread Raymond Yau
   My laptop has built-in front left, front right, rear left, rear right
and
   subwoofer and something is strange.
   When I set channel output to 5.1 or 4.1 and external speakers are
   disconnected, then front left and front right work as expected but
 
  built-in
 
   subwoofer is heard only if I test rear left channel (wrong channel
 
  mapping?)
 
 
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc
  i/hda/hda_codec.c?id=cd4035e814b04c009ece9939396d06370c53ed44
 
  Seem only two pairs of stereo speakers and internal subwoofer at left
  channel before this patch
 
  ALSA: hda - Enable surround speakers (when line out is also present)

 On my laptop case Virtual SurroundSound is written . When I test front
left
 and rear left, I hear distinct sound, so it would mean it's from two
different
 sources of sound.

The driver use more than two channels only after David 's patch

But all internal speakers of the notebook are at front of  the user, The 3D
sound effect is quite different from your external 5.1 speakers

Do you mean your 5930g need champ {FL FR RL RR LFE }?

This can be easily implemented by using swap center/lfe switch for those
codec support R/L swap

http://git.alsa-project.org/?p=alsa-lib.git;a=blob_plain;f=test/chmap.c;hb=HEAD

http://git.alsa-project.org/?p=alsa-lib.git;a=tree;f=src/conf/pcm;hb=HEAD

If codec does not support R/L swap, your 4.1 swap chmap need 5.0 routing

Do you expect pulseaudio show 4.1 swap(5.0) profile for internal speakers
and 4.1 and 5.1 profiles for external speakers ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] [alsa-devel] Front speakers doesn't work in multichannel output, regression in ALC888

2015-05-03 Thread Raymond Yau
   My problem is that when I set channel output to Analog output
surround
   5.1
   (or 2.1 or 4.1), I hear no sound in front speakers, but in case of
5.1 or
   4.1

You need pulseaudio lfe-filter for 2.1

http://cgit.freedesktop.org/pulseaudio/pulseaudio/log/?qt=grepq=lfe-filter

do you mean surround21 need 6 channel instead of channels with 5.1 internal
/external speaker ?

http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=48f1b308cc66152eb6db66742dd0d08d888cda8d;hp=5c4cd46810cef8850b037fca9e38ffd43b0bff22


   I can hear sound in rear speakers. I use kernel 3.19.5 and it didn't
   happen in
   earlier kernels that is 3.18 and in 3.17 for sure.
  
   My configuration is:
   OS: Fedora 21 64 bit
   SoundCard: ALC888
   Model name: acer-aspire-4930g
   Laptop: Acer Aspire 5930g
   Speakers: external 5.1 with 3 jacks
   Sound channel configuration module is standard configuration module
from
   KDE.
  
   Additional info:
   1) When channel output is 5.1 and I unplug green jack and leave two
others
   jacks connected then I can hear sound in laptop internal speakers.

auto mute only check headphone jack or line out jack but not those retasked
mio jacks


   2) Earlier (kernel 3.18 and 3.17) I didn't have possibility to choose
2.1
   configuration and additionally to 4.1 configuration I could also
choose
   4.0
   configuration.
  
   You need to switch Channel mode to 6 ch if you need to use
external
 
  5.1 speakers since you have 5.1 internal speakers
 
  this change pin-ctl of headphone jack, mic jack and line in to OUT
 
  post the output of alsa-info.sh

 I always switched to 6 ch through alsamixer. It always worked as
expected,
 but recently I've got problems with it so it regressed somewhere.



 My alsa-info.sh with 6 ch set through alsamixer and Analog output
surround
 5.1 + Analog input stereo set through KDE configuration module.
 http://www.alsa-project.org/db/?f=ff3f5a1f7f3e4662c3fa9bcf0158474a076b4cc4

 With that I hear all channels except front left and front right.

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


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

Node 0x15 [Pin Complex] wcaps 0x40058f: Stereo Amp-In Amp-Out
  Control: name=Headphone Playback Switch, index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name=Front Headphone Jack, index=0, device=0
  Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
  Amp-In vals:  [0x00 0x00]
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x80 0x80]
  Pincap 0x0001003e: IN OUT HP EAPD Detect Trigger
  EAPD 0x2: EAPD
  Pin Default 0x0221101f: [Jack] HP Out at Ext Front
Conn = 1/8, Color = Black
DefAssociation = 0x1, Sequence = 0xf
  Pin-ctls: 0xc0: OUT HP
  Unsolicited: tag=01, enabled=1
  Power states:  D0 D1 D2 D3 EPSS
  Power: setting=D0, actual=D0
  Connection: 5
 0x0c* 0x0d 0x0e 0x0f 0x26

it is still headphone jack with pin-ctl : 0xc0 OUT HP while mic jack and
line in jack 's pin ctl are changed to 0x40 OUT

channel mode only change two mio jacks from IN to OUT

May need to use add_out_jack_mode=1 instead of add_jack_modes=1 when there
are Mic and line in jacks

Use Headphone Jack Mode control to switch HP to Line Out for pin-ctl and
EAPD

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

 To exclude that my speakers are broken or wrong connected: I get sound
from
 front left and front right if i switch in KDE configuration module to
Analog
 duplex stereo, but then I get no sound from rest of my speakers.

http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/paths/analog-output-headphones.conf

pulseaudio mute external center/lfe controls when headphone jack is plugged
since pulseaudio not aware that the role of headphone has been changed


[Element Center]
switch = off
volume = off

[Element LFE]
switch = off
volume = off




 KDE configuration module lets me choose connector configuration but
only in
 stereo mode.
 In stereo mode I can choose between headphones and speakers.
 If it is set to headphones I hear sound in front left and front right
 speakers.
 If it is set to speakers I hear sound in rear left and rear right
speakers.


you need to switch channel mode to 2 ch if you want to use your 5.1
internal speaker


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


There are difference between static model and generic 

Re: [pulseaudio-discuss] Mic Boost on AC97 audio causes bad behavior of mic volume control

2015-04-29 Thread Raymond Yau
 I did observe something by ear, but it's a long story. Since you asked
 for it, the full story is related to
 http://lists.nongnu.org/archive/html/qemu-devel/2015-04/msg02271.html,
 and goes like this:

 I (have to) run Microsoft Lync for telephone conferencing in a Windows
 guest on Qemu/KVM under Linux. I use Qemu's spice audio protocol to link
 my sound sources/sinks to the Windows guest. The Windows guest sees an
 emulated Intel HD Audio codec (ICH6 or ICH9) that has a 74dB volume
 scale for capture. For unknown reasons, Windows uses only the upper
 ~30dB. Therfore setting the Windows volume slider to 1% lets the HW
 volume in the emulated HD audio chip jump ~40% immediately. See the
 above qemu-devel post for details.

 The libvirt spice server communicates this percentage  to PA. PA is
 using the 48dB Capture + 36dB Boost = 84dB volume scale. Setting this
 to 40% results in Capture=+30dB (maximum) and Boost=+12dB. Again, this
 happens if I set just 1% volume under Windows, about the lowest possible
 setting!



 are you using pulseaudio as backend ?

http://git.qemu.org/?p=qemu.git;a=commitdiff;h=6e7a7f3d9bc2031b4c93c05400b18775ba1b1f55;hp=a394aed235d6b3f048eeae83289f4d21eca7023c

qemu seem using stream volume control
pa_context_set_source_volume_by_index() instead of source volume control
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Mic Boost on AC97 audio causes bad behavior of mic volume control

2015-04-27 Thread Raymond Yau
2015-04-27 19:08 GMT+08:00 Wilck, Martin martin.wi...@ts.fujitsu.com:

 On Fr, 2015-04-24 at 13:53 +0800, Raymond Yau wrote:

 However the driver seems to hide this complexity. For simplicity, we
 should focus the discussion on the jack mics and leave Internal Mic
 aside. I can only say that from user land, volume control of Internal
 Mic apparently behaved the same as the other two Mics.


But the mic jack can also be used as line in according to lifeboof e744
datasheet, The output jack can be used as line out or headphone

User need to know the real 0dB at the pulseaudio volume scale when using
line in

http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/Clients/WritingVolumeControlUIs/


   Here is how PA, Capture, and Boost volume, in dB, correlate in the
  error
   case (i.e. if Capture is listed before the relevant Mic Boost in
  the
   path conf file, the current PA default). PA volumes are obtained
  using
   pactl list sources, Capture/Boost values using amixer -c1 get
   scontrol:
  
   PA(%)   PA(dB)  Captu   Boost   Capture+Boost-66dB
   121%5.0030.00   36.00   0.00
   100%0.0030.00   24.00   -12.00
 
 
 
  
   In contrast, if I list Mic Boost before Capture in the path conf
   file, it looks like this:
   PA(%)   PA(dB)  Captu   Boost   Capture+Boost-dB
   121%5.0030.00   36.00   0.00
   100%0.0029.25   36.00   -0.75
 
  If base volume is -66dB , why maximum volume and boost is 121%?

  Seem total hardware gain exceed pulseaudio limit on maximum gain

 Sorry for causing confusion. I had observed that setting 0dB or 100%
 in PA didn't actually set full HW volume (actual volume was -12dB or
 -0.75 dB, see above). So I let my test script move beyond 100%, and
 because my it made 5dB steps, this has set +5dB/121%. I might as well
 just set 100.01% in PA. I seems to be necessary to go slightly beyond
 100% in PA in order to reach the actual maximum (+30dB Capture and +36dB
 Boost). That may be a rounding problem. It's not relevant to my point
 here (well, some may argue that getting -12dB when you set 100% volume
 is unexpected, but that's a minor issue for me).

 Coming back to the original point, wouldn't you agree that the way these
 volume controls behave by default is erratic  confusing?


There are 118 unique dB level out of 256 combination when volume has 64
steps and boost has 4 steps.
Pulseaudio just use ( 64 + 4 ) or ( 4 + 64 ) hardware setting with
pulseaudio software volume when changing the order of using volume and
boost
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] ThinkPad T-510 audio output mute LED non-workingness

2015-04-26 Thread Raymond Yau
2015-04-27 0:05 GMT+08:00 Takashi Iwai ti...@suse.de:

 At Sun, 26 Apr 2015 09:20:12 -0600,
 Glenn Golden wrote:
 
  Anyway, just my 2c, and entirely distinct from the issue at hand. Let's
get
  the LED working as intended first.

 It's likely just a missing quirk application.  There was already a
 quick specific to your device (17aa:215e), but this doesn't include
 the thinkpad_acpi hook.

 A patch like below may fix the issue.  Give it a try.


Seem Thinkpad T510 has Conexant codec instead of realtek

!!Advanced information - PCI Vendor/Device/Subsystem ID's
!!---

00:1b.0 0403: 8086:3b56 (rev 06)
Subsystem: 17aa:215e

Codec: Conexant CX20585
Address: 0
AFG Function Id: 0x1 (unsol 1)
MFG Function Id: 0x2 (unsol 1)
Vendor Id: 0x14f15069
Subsystem Id: 0x17aa218b
Revision Id: 0x100302

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

Seem T410 and T510 have same PCI SSID but different Codec SSID
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] ThinkPad T-510 audio output mute LED non-workingness

2015-04-25 Thread Raymond Yau
  in response to the event.  What action can be taken to turn on the mute
 LED?
  Issue an amixer/pactl/pacmd command to toggle the Master Playback mute
 state?

 Speaking as the thinkpad-acpi driver maintainer: Keeping the ThinkPad MUTE
 LED states in sync is the kernel's job. This is the beginning and the end
 of it.

 It clearly is not working properly right now.  Possibly the defect is
 restricted to some thinkpads: Lenovo changes firmware behaviour sometimes.
 They're good about leaving a knob you can set to get whatever behaviour you
 want/need.  They're not always that good about _testing_ it, though.  And
 we (kernel side) are not that good at either knowing the behaviour exists,
 or making use of it.

 Or it might be a simple driver bug that affects every thinkpad with a mute
 LED. I hope so, because that's much easier to fix.

 Those are the facts.  It doesn't look like there is anything pulse-audio
 related in this issue:  it is a matter for the kernel to fix. Either in the
 ALSA sublayer, if it is not being able to correctly signal thinkpad-acpi to
 change Mute LED state, or in thinkpad-acpi if it is not correctly relaying
 to the thinkpar firmware the desired mute LED state.

  No, that won't do it, because the LED isn't following the mixer mute
 state
  (see earlier posts in this thread).  Directly access the LED via some
 exposed
  interface to it?  No sign that any such any such interface is available
 in
  /proc/acpi or /sys/class/leds (see comment #15 in the kernel bugtracker).

 And it is not going to be made available (in some thinkpads, it cannot
 even be done: when you change the hardware mute gate state, the EC updates
 the LED state to match).  This is why we will consider any mute led
 misbehavior to be a kernel issue, to be fixed in the kernel.

  As I mentioned on the kernel bugtracker, I'm going to take this up with
 the
  thinkpad ACPI folks, see if they have any suggestions.

 I lack the hardware to develop-and-test a fix (I am long overdue for a
 replacement thinkpad, really. I only have a good T43, and a damaged R60),
 but I am open to help (and ACK kernel-side patches).

 --


http://support.lenovo.com/us/en/documents/migr-58317

T43 seem using snd-intel8x0 AC97 codec AD1981B

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

The mute led and mic led only supported by those HDA codecs (Realtek and
Connexant) which use hda/thinkpad_helper.c

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/pci/hda/patch_analog.c?qt=grepq=thinkpad

Those thinkpads using ADI HDA codecs are not affected by the above patch


http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/platform/x86/thinkpad_acpi.c?id=420f9739a62cdb027f5580d25c813501ff93aa6f

as tpacpi_led_set is always exported by thinkpad-acpi, only thinkpad_acpi
module know whether ssms interface is available or not

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/platform/x86/thinkpad_acpi.c?id=9a417ec0c9d1f7af5394333411fc4d98adb8761b


Should thinkpad_acpi only disable EC console only when either SSMS or
MMTS is available ?
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Mic Boost on AC97 audio causes bad behavior of mic volume control

2015-04-23 Thread Raymond Yau

  Since alc282 has a separate dmic  , this mean the driver need to use
  dynamic ADC switching if your laptop internal Mic use dmic instead of
  switching input sources with the audio mixer as selector

 I don't quite understand what you are saying here.

Pin complex 0x12 is directly connected to audio input 0x11.

Driver  switch between audio inputs node 0x11 and node 0x08 for internal
mic jack and external Mic jack


The driver need to bind the amp in of node 0x11 and 0x08 to create the
capture volume control when two  Mic jacks connected to audio input node
0x08 through node 0x23

I: [alsa-source-ALC282 Analog] alsa-source.c: Hardware volume ranges
 from -17,25 dB to 30,00 dB.
 I: [alsa-source-ALC282 Analog] alsa-source.c: Fixing base volume to
 -30,00 dB


 I: [alsa-source-ALC282 Analog] alsa-source.c: Hardware volume ranges
 from -17,25 dB to 66,00 dB.

 I: [alsa-source-ALC282 Analog] alsa-source.c: Fixing base volume to
 -66,00 dB



   = There is no smooth volume control above 25%.
   The graphical volume controls don't reflect this;
 
  alsamixer -c0 cannot reflect the change on pulseaudio software
  volume ?

 If the described effect occurs, I can see with alsamixer that the real
 volume is jumping up and down. The volume displayed by pactl list
 sources (and likewise by the sliders e.g. in the GNOME volume control
 widget) is not the real but the user-set value.

alsamixer -D pulse

The color or percentage does not reflect the hw capture volume / boost


 Here is how PA, Capture, and Boost volume, in dB, correlate in the error
 case (i.e. if Capture is listed before the relevant Mic Boost in the
 path conf file, the current PA default). PA volumes are obtained using
 pactl list sources, Capture/Boost values using amixer -c1 get
 scontrol:

 PA(%)   PA(dB)  Captu   Boost   Capture+Boost-66dB
 121%5.0030.00   36.00   0.00
 100%0.0030.00   24.00   -12.00


 In contrast, if I list Mic Boost before Capture in the path conf
 file, it looks like this:
 PA(%)   PA(dB)  Captu   Boost   Capture+Boost-dB
 121%5.0030.00   36.00   0.00
 100%0.0029.25   36.00   -0.75

If base volume is -66dB , why maximum volume and boost is 121%?

Seem total hardware gain exceed pulseaudio limit on maximum gain
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Mic Boost on AC97 audio causes bad behavior of mic volume control

2015-04-22 Thread Raymond Yau

 Hello,

 there has been some discussion about Mic Boost  / Dock Mic Boost in the
 past already. Some have reported no Mic output at all without Boost,
 other say that enabling Boost will cause high noise on their systems.

 I have another point here that AFAICS hasn't been reported yet.

 It has been caused by the commit e6051cdf alsa-mixer: Prefer moving
 Capture before moving boosts
 (
http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=e6051cdf8db554c0bbd4257959c37a7ecc9c10c5
)
 (see also
 https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1085402).

 In short, on my system, input volume control is hardly possible above
 25% because of this patch.


 The effect that I am seeing is as follows: I have two merged volume
 controls for my Mic, Capture and Dock Mic Boost.

It strange that you just have two instead of three if you have dock mic

If the internal mic has no boost control, the dB range is suddenly
increased when you plug Mic or Dock Mic  ?

Since alc282 has a separate dmic  , this mean the driver need to use
dynamic ADC switching if your laptop internal Mic use dmic instead of
switching input sources with the audio mixer as selector

They are applied by
 PA in the order encountered in the path conf file. On my system (Fujitsu
 Lifebook E744 with Realtek ALC282 Codec), the Capture Amp has a range
 of -18..30 dB in 0.75 dB steps, and Dock Mic Boost has 4 12dB steps
 (0, 12, 24, 36). PA merges these two controls to a single volume control
 with an overall range of -18..66dB. Normalizing at the max, PA converts
 this to -84..0dB, where the Boost comes in at -36dB, or 25% of the
 scale. The base volume, calculated from the offset of the ALSA amp,
 is at -66dB or 8%.

 Because of the above patch, the Capture control is used first. Thus
 the range from -84...-36 dB (or 0..25%, because of the non-linearity of
 PA's volume control) is covered with Capture. Above that level,
 Capture is always held at 100% and only Doc Mic Boost changes. This
 means that above 25%, there are only 3 steps that are actually possible:
 -24dB / 40%, -12dB / 63%, and 0dB / 100%.
 = There is no smooth volume control above 25%.
 The graphical volume controls don't reflect this;

alsamixer -c0 cannot reflect the change on pulseaudio software volume ?

Do this occur only in dock Mic?

You need to check whether the driver set the amp in of the correct audio
input correctly when using dock mic

Do pactl list source  indicate the dock Mic is active port ?

thus user control
 input volume is almost impossible at higher levels than 25%. Volume will
 appear to change non-predictably to users.

 By changing the ordering of Capture and Mic Boost in the path conf
 file /usr/share/pulseaudio/alsa-mixer/paths/analog-input-dock-mic.conf,
 I can get smooth changes over the whole dynamic range again. Therefore I
 reckon that commit e6051cdf should be reverted because the effect
 described here is general, while the noise level seems to be different
 between models: On my system, there is no perceivable difference in
 noise level if the overall volume is the same (thus, 30dB Capture +
 0dB Boost has the same noise level as 18 dB Capture and 12 dB
 Boost or -6dB Capure and 36dB Boost).


___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Playback - Overwrite buffer with silence

2015-04-22 Thread Raymond Yau

 Pulseaudio is a sound server which mix several playback streams, silence
size may has no effect since the alsa sink may use different period
size/buffer size or disable period wakeup when using timer scheduling

 Then, How I can avoid under-run? I mean, If I attempt to write data in a
buffer and the under-run occurs, It takes a long time to recover the pcm
and the data must be lost. ¿how I can put silence in buffer instead of lost
data?

Did your program work when using alsa hw device instead of pulse plugin ?

Did you get back the period size after snd_pcm_hw_params()?

You need to keep at least one period of data in alsa buffer at any time if
the sound card just increment hwptr by one period when interrupt occur

It look like bug in your decode and write loop since alsa-pulse plugin
won't report underrun by default

http://git.alsa-project.org/?p=alsa-plugins.git;a=commit;h=c20d516e229620129ee20175d8fee8511cc3a4bd

Do you mean your input source always provide data less than the specified
rate ?

 I have set the snd_pcm_sw_params_set_stop_threshold() to the boundary
value also, but the under-run occurs

 My Playback PCM now:

 INFO: Using default device.

 ALSA - PulseAudio PCM I/O Plugin
 Its setup is:
   stream   : PLAYBACK
   access   : RW_INTERLEAVED
   format   : S16_LE
   subformat: STD
   channels : 2
   rate : 48000
   exact rate   : 48000 (48000/1)
   msbits   : 16
   buffer_size  : 720
   period_size  : 240
   period_time  : 5000
   tstamp_mode  : NONE
   period_step  : 1
   avail_min: 240
   period_event : 0
   start_threshold  : 720
   stop_threshold   : 6485183463413514240

   silence_threshold: 0
   silence_size : 6485183463413514240
   boundary : 6485183463413514240


___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


  1   2   3   >