diff mbox

[-,alsa-lib,1/1] add surround21 for Echo3G devices

Message ID 569a947e.870d620a.17535.2cf0@mx.google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tom Yan Jan. 16, 2016, 7:05 p.m. UTC
From: Tom Yan <tom.ty89@gmail.com>

It's the only card conf that make use of surround41.conf and surround50.conf but not surround21.conf; Adding it for consistency, since all three of them are derived from surround51.

Signed-off-by: Tom Yan <tom.ty89@gmail.com>

Comments

Tom Yan Jan. 16, 2016, 7:17 p.m. UTC | #1
There is actually ONE card conf, AACI.conf, that supports surround51
but not surround20/surround41/surround50, but I don't feel like
touching it, coz it's in the ideal state of what I proposed here:
http://mailman.alsa-project.org/pipermail/alsa-devel/2016-January/103121.html

On 17 January 2016 at 03:05,  <tom.ty89@gmail.com> wrote:
> From: Tom Yan <tom.ty89@gmail.com>
>
> It's the only card conf that make use of surround41.conf and surround50.conf but not surround21.conf; Adding it for consistency, since all three of them are derived from surround51.
>
> Signed-off-by: Tom Yan <tom.ty89@gmail.com>
>
> diff --git a/src/conf/cards/Echo_Echo3G.conf b/src/conf/cards/Echo_Echo3G.conf
> index 766f13f..93d9ce4 100644
> --- a/src/conf/cards/Echo_Echo3G.conf
> +++ b/src/conf/cards/Echo_Echo3G.conf
> @@ -50,6 +50,40 @@ Echo_Echo3G.pcm.side.0 {
>         subdevice 6
>  }
>
> +<confdir:pcm/surround21.conf>
> +Echo_Echo3G.pcm.surround21.0 {
> +       @args [ CARD ]
> +       @args.CARD {
> +               type string
> +       }
> +       type multi
> +       slaves [
> +               {
> +                       pcm {
> +                               @func concat
> +                               strings [
> +                                       "cards.Echo_Echo3G.pcm.front.0:CARD=" $CARD
> +                               ]
> +                       }
> +                       channels 2
> +               }
> +               {
> +                       pcm {
> +                               @func concat
> +                               strings [
> +                                       "cards.Echo_Echo3G.pcm.center_lfe.0:CARD=" $CARD
> +                               ]
> +                       }
> +                       channels 2
> +               }
> +       ]
> +       bindings [
> +               { slave 0 channel 0 }
> +               { slave 0 channel 1 }
> +               { slave 1 channel 0 }
> +       ]
> +}
> +
>  <confdir:pcm/surround40.conf>
>  Echo_Echo3G.pcm.surround40.0 {
>         @args [ CARD ]
> --
> 2.7.0
>
Tom Yan Jan. 17, 2016, 1:49 p.m. UTC | #2
It's included in another patchset:
http://mailman.alsa-project.org/pipermail/alsa-devel/2016-January/103140.html
So that the surround21 definition will be before surround30 instead of
surround40.

On 17 January 2016 at 03:17, Tom Yan <tom.ty89@gmail.com> wrote:
> There is actually ONE card conf, AACI.conf, that supports surround51
> but not surround20/surround41/surround50, but I don't feel like
> touching it, coz it's in the ideal state of what I proposed here:
> http://mailman.alsa-project.org/pipermail/alsa-devel/2016-January/103121.html
>
> On 17 January 2016 at 03:05,  <tom.ty89@gmail.com> wrote:
>> From: Tom Yan <tom.ty89@gmail.com>
>>
>> It's the only card conf that make use of surround41.conf and surround50.conf but not surround21.conf; Adding it for consistency, since all three of them are derived from surround51.
>>
>> Signed-off-by: Tom Yan <tom.ty89@gmail.com>
>>
>> diff --git a/src/conf/cards/Echo_Echo3G.conf b/src/conf/cards/Echo_Echo3G.conf
>> index 766f13f..93d9ce4 100644
>> --- a/src/conf/cards/Echo_Echo3G.conf
>> +++ b/src/conf/cards/Echo_Echo3G.conf
>> @@ -50,6 +50,40 @@ Echo_Echo3G.pcm.side.0 {
>>         subdevice 6
>>  }
>>
>> +<confdir:pcm/surround21.conf>
>> +Echo_Echo3G.pcm.surround21.0 {
>> +       @args [ CARD ]
>> +       @args.CARD {
>> +               type string
>> +       }
>> +       type multi
>> +       slaves [
>> +               {
>> +                       pcm {
>> +                               @func concat
>> +                               strings [
>> +                                       "cards.Echo_Echo3G.pcm.front.0:CARD=" $CARD
>> +                               ]
>> +                       }
>> +                       channels 2
>> +               }
>> +               {
>> +                       pcm {
>> +                               @func concat
>> +                               strings [
>> +                                       "cards.Echo_Echo3G.pcm.center_lfe.0:CARD=" $CARD
>> +                               ]
>> +                       }
>> +                       channels 2
>> +               }
>> +       ]
>> +       bindings [
>> +               { slave 0 channel 0 }
>> +               { slave 0 channel 1 }
>> +               { slave 1 channel 0 }
>> +       ]
>> +}
>> +
>>  <confdir:pcm/surround40.conf>
>>  Echo_Echo3G.pcm.surround40.0 {
>>         @args [ CARD ]
>> --
>> 2.7.0
>>
Raymond Yau Jan. 17, 2016, 4:12 p.m. UTC | #3
7>
> There is actually ONE card conf, AACI.conf, that supports surround51
> but not surround20/surround41/surround50, but I don't feel like
> touching it, coz it's in the ideal state of what I proposed here:
>
http://mailman.alsa-project.org/pipermail/alsa-devel/2016-January/103121.html
>
> On 17 January 2016 at 03:05,  <tom.ty89@gmail.com> wrote:
> > From: Tom Yan <tom.ty89@gmail.com>
> >
> > It's the only card conf that make use of surround41.conf and
surround50.conf but not surround21.conf; Adding it for consistency, since
all three of them are derived from surround51.
> >
> > Signed-off-by: Tom Yan <tom.ty89@gmail.com>
> >
> > diff --git a/src/conf/cards/Echo_Echo3G.conf
b/src/conf/cards/Echo_Echo3G.conf
> > index 766f13f..93d9ce4 100644
> > --- a/src/conf/cards/Echo_Echo3G.conf
> > +++ b/src/conf/cards/Echo_Echo3G.conf
> > @@ -50,6 +50,40 @@ Echo_Echo3G.pcm.side.0 {
> >         subdevice 6
> >  }
> >
> > +<confdir:pcm/surround21.conf>
> > +Echo_Echo3G.pcm.surround21.0 {
> > +       @args [ CARD ]
> > +       @args.CARD {
> > +               type string
> > +       }
> > +       type multi
> > +       slaves [
> > +               {
> > +                       pcm {
> > +                               @func concat
> > +                               strings [
> > +
 "cards.Echo_Echo3G.pcm.front.0:CARD=" $CARD
> > +                               ]
> > +                       }
> > +                       channels 2
> > +               }
> > +               {
> > +                       pcm {
> > +                               @func concat
> > +                               strings [
> > +
 "cards.Echo_Echo3G.pcm.center_lfe.0:CARD=" $CARD
> > +                               ]
> > +                       }
> > +                       channels 2
> > +               }
> > +       ]
> > +       bindings [
> > +               { slave 0 channel 0 }
> > +               { slave 0 channel 1 }
> > +               { slave 1 channel 0 }
> > +       ]
> > +}
> > +

Have you tested with real hardware for surround21 since pulseaudio fail
with multi plugin with error -77  ?

http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-November/022670.html
Raymond Yau Jan. 18, 2016, 1:50 a.m. UTC | #4
>
> On 18 January 2016 at 00:12, Raymond Yau <superquad.vortex2@gmail.com>
wrote:
> > 7>
> >
> >
> >> There is actually ONE card conf, AACI.conf, that supports surround51
> >> but not surround20/surround41/surround50, but I don't feel like
> >> touching it, coz it's in the ideal state of what I proposed here:
> >>
> >>
http://mailman.alsa-project.org/pipermail/alsa-devel/2016-January/103121.html
> >>
> >> On 17 January 2016 at 03:05,  <tom.ty89@gmail.com> wrote:
> >> > From: Tom Yan <tom.ty89@gmail.com>
> >> >
> >> > It's the only card conf that make use of surround41.conf and
> >> > surround50.conf but not surround21.conf; Adding it for consistency,
since
> >> > all three of them are derived from surround51.
> >> >
> >> > Signed-off-by: Tom Yan <tom.ty89@gmail.com>
> >> >
> >> > diff --git a/src/conf/cards/Echo_Echo3G.conf
> >> > b/src/conf/cards/Echo_Echo3G.conf
> >> > index 766f13f..93d9ce4 100644
> >> > --- a/src/conf/cards/Echo_Echo3G.conf
> >> > +++ b/src/conf/cards/Echo_Echo3G.conf
> >> > @@ -50,6 +50,40 @@ Echo_Echo3G.pcm.side.0 {
> >> >         subdevice 6
> >> >  }
> >> >
> >> > +<confdir:pcm/surround21.conf>
> >> > +Echo_Echo3G.pcm.surround21.0 {
> >> > +       @args [ CARD ]
> >> > +       @args.CARD {
> >> > +               type string
> >> > +       }
> >> > +       type multi
> >> > +       slaves [
> >> > +               {
> >> > +                       pcm {
> >> > +                               @func concat
> >> > +                               strings [
> >> > +
> >> > "cards.Echo_Echo3G.pcm.front.0:CARD=" $CARD
> >> > +                               ]
> >> > +                       }
> >> > +                       channels 2
> >> > +               }
> >> > +               {
> >> > +                       pcm {
> >> > +                               @func concat
> >> > +                               strings [
> >> > +
> >> > "cards.Echo_Echo3G.pcm.center_lfe.0:CARD=" $CARD
> >> > +                               ]
> >> > +                       }
> >> > +                       channels 2
> >> > +               }
> >> > +       ]
> >> > +       bindings [
> >> > +               { slave 0 channel 0 }
> >> > +               { slave 0 channel 1 }
> >> > +               { slave 1 channel 0 }
> >> > +       ]
> >> > +}
> >> > +
> >
> > Have you tested with real hardware for surround21 since pulseaudio fail
with
> > multi plugin with error -77  ?
> >
> >
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-November/022670.html

> Nope, not tested with one that uses a card conf that make use of the
> multi plugin.
>
> I just happen to have found this particular conf have surround21
> missing, so I add it back for consistency:
>
http://mailman.alsa-project.org/pipermail/alsa-devel/2016-January/103123.html
>
> But I do wonder why some card conf needs the multi plugin while others
> doesn't. I wonder if it had been abused. Feels like it is something
> that should be implemented in the actual driver code instead.

Those cards allow user to play two audio streams to front and rear
devices,  they need multi plugin for multi channel playback

http://git.alsa-project.org/?p=alsa-plugins.git;a=commit;h=a0693150dfd428fdd4df474efdc6b5e26a41ba21

It seem that playback of some plugins can be started at first write when
start threshold is -1

Pulseaudio call snd_pcm_start when pcm state is already running
Tom Yan Jan. 18, 2016, 6:17 a.m. UTC | #5
Then what about this:
http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/SB-XFi.conf;h=eb2218bfdcc704e4bf39e0e0c21539ee7f9ff8f8;hb=HEAD
It seems to be allow the "multi-streaming" you mentioned but it
doesn't need the multi plugin.

Hmm, I feel like definitions for "ttable PCMs" in Echo_Echo3G.conf
should be cleaned up...

On 18 January 2016 at 09:50, Raymond Yau <superquad.vortex2@gmail.com> wrote:
>
>>
>> On 18 January 2016 at 00:12, Raymond Yau <superquad.vortex2@gmail.com>
>> wrote:
>> > 7>
>> >
>> >
>> >> There is actually ONE card conf, AACI.conf, that supports surround51
>> >> but not surround20/surround41/surround50, but I don't feel like
>> >> touching it, coz it's in the ideal state of what I proposed here:
>> >>
>> >>
>> >> http://mailman.alsa-project.org/pipermail/alsa-devel/2016-January/103121.html
>> >>
>> >> On 17 January 2016 at 03:05,  <tom.ty89@gmail.com> wrote:
>> >> > From: Tom Yan <tom.ty89@gmail.com>
>> >> >
>> >> > It's the only card conf that make use of surround41.conf and
>> >> > surround50.conf but not surround21.conf; Adding it for consistency,
>> >> > since
>> >> > all three of them are derived from surround51.
>> >> >
>> >> > Signed-off-by: Tom Yan <tom.ty89@gmail.com>
>> >> >
>> >> > diff --git a/src/conf/cards/Echo_Echo3G.conf
>> >> > b/src/conf/cards/Echo_Echo3G.conf
>> >> > index 766f13f..93d9ce4 100644
>> >> > --- a/src/conf/cards/Echo_Echo3G.conf
>> >> > +++ b/src/conf/cards/Echo_Echo3G.conf
>> >> > @@ -50,6 +50,40 @@ Echo_Echo3G.pcm.side.0 {
>> >> >         subdevice 6
>> >> >  }
>> >> >
>> >> > +<confdir:pcm/surround21.conf>
>> >> > +Echo_Echo3G.pcm.surround21.0 {
>> >> > +       @args [ CARD ]
>> >> > +       @args.CARD {
>> >> > +               type string
>> >> > +       }
>> >> > +       type multi
>> >> > +       slaves [
>> >> > +               {
>> >> > +                       pcm {
>> >> > +                               @func concat
>> >> > +                               strings [
>> >> > +
>> >> > "cards.Echo_Echo3G.pcm.front.0:CARD=" $CARD
>> >> > +                               ]
>> >> > +                       }
>> >> > +                       channels 2
>> >> > +               }
>> >> > +               {
>> >> > +                       pcm {
>> >> > +                               @func concat
>> >> > +                               strings [
>> >> > +
>> >> > "cards.Echo_Echo3G.pcm.center_lfe.0:CARD=" $CARD
>> >> > +                               ]
>> >> > +                       }
>> >> > +                       channels 2
>> >> > +               }
>> >> > +       ]
>> >> > +       bindings [
>> >> > +               { slave 0 channel 0 }
>> >> > +               { slave 0 channel 1 }
>> >> > +               { slave 1 channel 0 }
>> >> > +       ]
>> >> > +}
>> >> > +
>> >
>> > Have you tested with real hardware for surround21 since pulseaudio fail
>> > with
>> > multi plugin with error -77  ?
>> >
>> >
>> > http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-November/022670.html
>
>> Nope, not tested with one that uses a card conf that make use of the
>> multi plugin.
>>
>> I just happen to have found this particular conf have surround21
>> missing, so I add it back for consistency:
>>
>> http://mailman.alsa-project.org/pipermail/alsa-devel/2016-January/103123.html
>>
>> But I do wonder why some card conf needs the multi plugin while others
>> doesn't. I wonder if it had been abused. Feels like it is something
>> that should be implemented in the actual driver code instead.
>
> Those cards allow user to play two audio streams to front and rear devices,
> they need multi plugin for multi channel playback
>
> http://git.alsa-project.org/?p=alsa-plugins.git;a=commit;h=a0693150dfd428fdd4df474efdc6b5e26a41ba21
>
> It seem that playback of some plugins can be started at first write when
> start threshold is -1
>
> Pulseaudio call snd_pcm_start when pcm state is already running
Raymond Yau Jan. 18, 2016, 6:50 a.m. UTC | #6
> Then what about this:
>
http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/SB-XFi.conf;h=eb2218bfdcc704e4bf39e0e0c21539ee7f9ff8f8;hb=HEAD
> It seems to be allow the "multi-streaming" you mentioned but it
> doesn't need the multi plugin.
>
> Hmm, I feel like definitions for "ttable PCMs" in Echo_Echo3G.conf
> should be cleaned up...

No,  only those creative sound card emu10k1 and ca0106 allow up to four pcm
devices

For hda,  you need to change the logic of alsa playback stream similar to
multiple alsa capture devices,  you can use hint "indep_hp=1" to enable
multi stream playback (analog and alt analog playback )

Freebsd allow you to use your hda intel as four independent pcm devices

https://www.freebsd.org/cgi/man.cgi?query=snd_hda&sektion=4&manpath=FreeBSD+7.2-RELEASE
Tom Yan Jan. 18, 2016, 8:30 a.m. UTC | #7
When did I say "hda"? Have you even read the link? I've been talking about X-Fi.

Compare these these two conf:
http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/SB-XFi.conf;h=eb2218bfdcc704e4bf39e0e0c21539ee7f9ff8f8;hb=HEAD
http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/CA0106.conf;h=2f0eaf0afdc8dc826cbd3722b61cdb3310ca07f0;hb=HEAD

BOTH of them shows that the four "stereo" ports they have exist as
"device", but the SB-XFi.conf does not use the multi plugin to bind
them to provide a surround PCM like CA0106.conf; instead it can simply
use the "front" PCM, apparently.

On 18 January 2016 at 14:50, Raymond Yau <superquad.vortex2@gmail.com> wrote:
>
>> Then what about this:
>>
>> http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/SB-XFi.conf;h=eb2218bfdcc704e4bf39e0e0c21539ee7f9ff8f8;hb=HEAD
>> It seems to be allow the "multi-streaming" you mentioned but it
>> doesn't need the multi plugin.
>>
>> Hmm, I feel like definitions for "ttable PCMs" in Echo_Echo3G.conf
>> should be cleaned up...
>
> No,  only those creative sound card emu10k1 and ca0106 allow up to four pcm
> devices
>
> For hda,  you need to change the logic of alsa playback stream similar to
> multiple alsa capture devices,  you can use hint "indep_hp=1" to enable
> multi stream playback (analog and alt analog playback )
>
> Freebsd allow you to use your hda intel as four independent pcm devices
>
> https://www.freebsd.org/cgi/man.cgi?query=snd_hda&sektion=4&manpath=FreeBSD+7.2-RELEASE
>
Raymond Yau Jan. 18, 2016, 9:54 a.m. UTC | #8
>
> Compare these these two conf:
>
http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/SB-XFi.conf;h=eb2218bfdcc704e4bf39e0e0c21539ee7f9ff8f8;hb=HEAD
>
http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/CA0106.conf;h=2f0eaf0afdc8dc826cbd3722b61cdb3310ca07f0;hb=HEAD
>
> BOTH of them shows that the four "stereo" ports they have exist as
> "device", but the SB-XFi.conf does not use the multi plugin to bind
> them to provide a surround PCM like CA0106.conf; instead it can simply
> use the "front" PCM, apparently.

These two cards are different, emu10k1  have "rear" device,  "centerlfe"
and "side" devices

but they use multi plugin instead of surroundxx use pcm.front

SB-XFi.pcm.surround40.0 cards.SB-XFi.pcm.front.0
SB-XFi.pcm.surround51.0 cards.SB-XFi.pcm.front.0
SB-XFi.pcm.surround71.0 cards.SB-XFi.pcm.front.0
Tom Yan Jan. 18, 2016, 3:11 p.m. UTC | #9
different from what? each other? you mean the confs (yeah that's why I
pasted the links) or the actual cards (so that they derserve confs in
different from SOMEHOW)?

and emu10k1 doesn't even have "side".

I know some of the confs use multi and some use front. that's my
question/doubt, coz that seem to imply that some of their drivers are
sort of "incomplete".

and you haven't been really making any point/sense tbh. i don't feel
like i should continue any discussion/conversation with you. it's out
of the scope of my patch anyway.

On 18 January 2016 at 17:54, Raymond Yau <superquad.vortex2@gmail.com> wrote:
>
>>
>> Compare these these two conf:
>>
>> http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/SB-XFi.conf;h=eb2218bfdcc704e4bf39e0e0c21539ee7f9ff8f8;hb=HEAD
>>
>> http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/CA0106.conf;h=2f0eaf0afdc8dc826cbd3722b61cdb3310ca07f0;hb=HEAD
>>
>> BOTH of them shows that the four "stereo" ports they have exist as
>> "device", but the SB-XFi.conf does not use the multi plugin to bind
>> them to provide a surround PCM like CA0106.conf; instead it can simply
>> use the "front" PCM, apparently.
>
> These two cards are different, emu10k1  have "rear" device,  "centerlfe" and
> "side" devices
>
> but they use multi plugin instead of surroundxx use pcm.front
>
> SB-XFi.pcm.surround40.0 cards.SB-XFi.pcm.front.0
> SB-XFi.pcm.surround51.0 cards.SB-XFi.pcm.front.0
> SB-XFi.pcm.surround71.0 cards.SB-XFi.pcm.front.0
diff mbox

Patch

diff --git a/src/conf/cards/Echo_Echo3G.conf b/src/conf/cards/Echo_Echo3G.conf
index 766f13f..93d9ce4 100644
--- a/src/conf/cards/Echo_Echo3G.conf
+++ b/src/conf/cards/Echo_Echo3G.conf
@@ -50,6 +50,40 @@  Echo_Echo3G.pcm.side.0 {
 	subdevice 6
 }
 
+<confdir:pcm/surround21.conf>
+Echo_Echo3G.pcm.surround21.0 {
+	@args [ CARD ]
+	@args.CARD {
+		type string
+	}
+	type multi
+	slaves [
+		{
+			pcm {
+				@func concat
+				strings [
+					"cards.Echo_Echo3G.pcm.front.0:CARD=" $CARD
+				]
+			}
+			channels 2
+		}
+		{
+			pcm {
+				@func concat
+				strings [
+					"cards.Echo_Echo3G.pcm.center_lfe.0:CARD=" $CARD
+				]
+			}
+			channels 2
+		}
+	]
+	bindings [
+		{ slave 0 channel 0 }
+		{ slave 0 channel 1 }
+		{ slave 1 channel 0 }
+	]
+}
+
 <confdir:pcm/surround40.conf>
 Echo_Echo3G.pcm.surround40.0 {
 	@args [ CARD ]