Re: [pulseaudio-discuss] Overrun in Pulseaudio8.0 when switching endpoints

2016-09-20 Thread Tanu Kaskinen
On Mon, 2016-09-19 at 14:41 +0530, Nishit Sharma wrote:
>  *  Is there any workaround to close device/stream and open new
> device/stream when switching from AMIC to DMIC??*

I can't think of any way to do that (except modifying the code).

> *   I mean, When AMIC plugged out the device/stream should be closed
> and opens new device/stream for DMIC as pulseaudio did for AMIC. Instead of
> switching only port, DMIC  Initailzation happens as done for
> AMIC*

You seem to be convinced that the stream should be reopened when
changing the port. What is that conviction based on? Normally there's
no need to do that. Is your hardware somehow special in this regard?

Have you tested that recording from DMIC works with plain alsa tools,
without pulseaudio in the middle? Have you tried recording from AMIC
with arecord, and then switching to DMIC while arecord is still
running? If your theory of needing stream reopening is true, recording
with arecord should stop working when you switch to DMIC, but start
working again if you restart arecord so that the stream is recreated.

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


Re: [pulseaudio-discuss] Overrun in Pulseaudio8.0 when switching endpoints

2016-09-19 Thread Nishit Sharma
>
>
>> When PulseAudio boots up it initializes AMIC (
>
> Headset ) only and i can record using it.
>
>  Now, the problem starts. When i plugged Headset the Port switching done
>
>  from AMIC to DMIC and after sometime i got overrun without recording
>
>  anything.
>
>
>>  You seem to be saying that AMIC is the same thing as Headset
>
>
>>   *Yes AMIC is detected as HeadSet when executed pulseaudio*
>
>
>> but then you say that when the headset is plugged in, the port changes
>
>
>>  from AMIC
>
>  to DMIC, which doesn't make sense.
>
>
>>   * I missed one thing, when i plugged out Headset from target board,
>
>  pulseaudio switches port from AMIC to DMIC*
>
>  *which i think should initializes ( hw params ) DMIC first as done for
>
>  AMIC??*
>
>
>> No, hw params are not reconfigured. Only mixer settings are changed
>
> according to the UCM configuration.
>
>
>>  My analysis:- PulseAudio should initialize both AMIC and DMIC ( setting
>
>  hw params and other stuff ) but only AMIC initialized. Only port switching
>
>  should not have been happened as no hw params setup for DMIC. Port
>
>  switched but PulseAudio is expecting I/P for AMIC. Am i right here?
>
>
>>  Hw params are set when opening the PCM device. If AMIC and DMIC are on
>
>  the same PCM device, there's no need to reconfigure the hw params (or
>
>  if the hardware requires such reconfiguration, pulseaudio certainly
>
>  won't do it). It's a bit unclear unclear whether AMIC and DMIC are on
>
>  same or different PCM devices, but if they are two ports on the same
>
>  sink, then they are on the same PCM device.
>
>
>>If it is so then DMIC will be accepting HW params which were set for
>
>  AMIC ( HeadSet ), but then there will be difference between the period
>
>  size, buffer size passed to DMIC sink which **again can cause problem? *
>
>
>> Why would there be a difference in the buffer parameters? Since we
>
> don't reconfigure the hw params, it's clear that there will be no
>
> difference.
>
>
>> If you actually want different buffering parameters depending on the
>
> active port, that's not supported in pulseaudio.
>
>  *  Is there any workaround to close device/stream and open new
device/stream when switching from AMIC to DMIC??*
*   I mean, When AMIC plugged out the device/stream should be closed
and opens new device/stream for DMIC as pulseaudio did for AMIC. Instead of
switching only port, DMIC  Initailzation happens as done for
AMIC*

>
>> Regards
>
>Nishit

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


Re: [pulseaudio-discuss] Overrun in Pulseaudio8.0 when switching endpoints

2016-09-19 Thread Tanu Kaskinen
On Sun, 2016-09-18 at 17:56 +0530, Nishit Sharma wrote:
> On Sun, Sep 18, 2016 at 5:19 PM, Tanu Kaskinen  wrote:
> > On Sat, 2016-09-17 at 17:51 +0530, Nishit Sharma wrote:
> > > When PulseAudio boots up it initializes AMIC (
> > > Headset ) only and i can record using it.
> > > Now, the problem starts. When i plugged Headset the Port switching done
> > > from AMIC to DMIC and after sometime i got overrun without recording
> > > anything.
> > 
> > You seem to be saying that AMIC is the same thing as Headset
> 
>*Yes AMIC is detected as HeadSet when executed pulseaudio*
> 
>  but then you say that when the headset is plugged in, the port changes
> > 
> > from AMIC
> > to DMIC, which doesn't make sense.
> 
>* I missed one thing, when i plugged out Headset from target board,
> pulseaudio switches port from AMIC to DMIC*
> *which i think should initializes ( hw params ) DMIC first as done for
> AMIC??*

No, hw params are not reconfigured. Only mixer settings are changed
according to the UCM configuration.

> > > My analysis:- PulseAudio should initialize both AMIC and DMIC ( setting
> > > hw params and other stuff ) but only AMIC initialized. Only port switching
> > > should not have been happened as no hw params setup for DMIC. Port
> > > switched but PulseAudio is expecting I/P for AMIC. Am i right here?
> > 
> > Hw params are set when opening the PCM device. If AMIC and DMIC are on
> > the same PCM device, there's no need to reconfigure the hw params (or
> > if the hardware requires such reconfiguration, pulseaudio certainly
> > won't do it). It's a bit unclear unclear whether AMIC and DMIC are on
> > same or different PCM devices, but if they are two ports on the same
> > sink, then they are on the same PCM device.
> 
> *   If it is so then DMIC will be accepting HW params which were set for
> AMIC ( HeadSet ), but then there will be difference between the period
> size, buffer size passed to DMIC sink which **again can cause problem? *

Why would there be a difference in the buffer parameters? Since we
don't reconfigure the hw params, it's clear that there will be no
difference.

If you actually want different buffering parameters depending on the
active port, that's not supported in pulseaudio.

(By the way, it would be better if you could send plain text emails to
mailing lists rather than using HTML formatting. The formatting will be
lost anyway in replies, and the list archive also strips the
formatting.)

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


Re: [pulseaudio-discuss] Overrun in Pulseaudio8.0 when switching endpoints

2016-09-18 Thread Nishit Sharma
Please find the reply below:-

On Sun, Sep 18, 2016 at 5:19 PM, Tanu Kaskinen  wrote:

> On Sat, 2016-09-17 at 17:51 +0530, Nishit Sharma wrote:
> > Hi All,
> >
> > I have observed strange behavior of PulseAudio8.0 which is as:-
> > I have one card which have 2 devices AMIC and DMIC. I am using ALSA, UCM
> > config files with PulseAudio. Before pulseaudio boots up Headset and DMIC
> > have been connected on card.
>
> What does "connected on card" mean?
>
   *On a sound card we have AMIC, DMIC, Speaker as different Playback and
Capture devices *

>
> > When PulseAudio boots up it initializes AMIC (
> > Headset ) only and i can record using it.
> > Now, the problem starts. When i plugged Headset the Port switching done
> > from AMIC to DMIC and after sometime i got overrun without recording
> > anything.
>
> You seem to be saying that AMIC is the same thing as Headset

   *Yes AMIC is detected as HeadSet when executed pulseaudio*

 but then you say that when the headset is plugged in, the port changes
> from AMIC
> to DMIC, which doesn't make sense.

   * I missed one thing, when i plugged out Headset from target board,
pulseaudio switches port from AMIC to DMIC*
*which i think should initializes ( hw params ) DMIC first as done for
AMIC??*

Why would the port change away from
> the headset when the headset is plugged in? Did you mix up AMIC and
> DMIC at some point in your description?
> *Explained above ( When Headset plugged out the switching happened from
> AMIC port to DMIC port )*




> > My analysis:- PulseAudio should initialize both AMIC and DMIC ( setting
> hw
> > params and other stuff ) but only AMIC initialized. Only port switching
> > should not have been happened as no hw params setup for DMIC. Port
> switched
> > but PulseAudio is expecting I/P for AMIC. Am i right here?
>
> Hw params are set when opening the PCM device. If AMIC and DMIC are on
> the same PCM device, there's no need to reconfigure the hw params (or
> if the hardware requires such reconfiguration, pulseaudio certainly
> won't do it). It's a bit unclear unclear whether AMIC and DMIC are on
> same or different PCM devices, but if they are two ports on the same
> sink, then they are on the same PCM device.
>
> *   If it is so then DMIC will be accepting HW params which were set for
AMIC ( HeadSet ), but then there will be difference between the period
size, buffer size passed to DMIC sink which **again can cause problem? *

> I have no idea what you mean by "I/P".
>
> --
> Tanu
> ___
> pulseaudio-discuss mailing list
> pulseaudio-discuss@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
>
___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Overrun in Pulseaudio8.0 when switching endpoints

2016-09-18 Thread Tanu Kaskinen
On Sat, 2016-09-17 at 17:51 +0530, Nishit Sharma wrote:
> Hi All,
> 
> I have observed strange behavior of PulseAudio8.0 which is as:-
> I have one card which have 2 devices AMIC and DMIC. I am using ALSA, UCM
> config files with PulseAudio. Before pulseaudio boots up Headset and DMIC
> have been connected on card.

What does "connected on card" mean?

> When PulseAudio boots up it initializes AMIC (
> Headset ) only and i can record using it.
> Now, the problem starts. When i plugged Headset the Port switching done
> from AMIC to DMIC and after sometime i got overrun without recording
> anything.

You seem to be saying that AMIC is the same thing as Headset, but then
you say that when the headset is plugged in, the port changes from AMIC
to DMIC, which doesn't make sense. Why would the port change away from
the headset when the headset is plugged in? Did you mix up AMIC and
DMIC at some point in your description?

> My analysis:- PulseAudio should initialize both AMIC and DMIC ( setting hw
> params and other stuff ) but only AMIC initialized. Only port switching
> should not have been happened as no hw params setup for DMIC. Port switched
> but PulseAudio is expecting I/P for AMIC. Am i right here?

Hw params are set when opening the PCM device. If AMIC and DMIC are on
the same PCM device, there's no need to reconfigure the hw params (or
if the hardware requires such reconfiguration, pulseaudio certainly
won't do it). It's a bit unclear unclear whether AMIC and DMIC are on
same or different PCM devices, but if they are two ports on the same
sink, then they are on the same PCM device.

I have no idea what you mean by "I/P".

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