Patchwork alsa-state: Provide an empty asound.conf by default

login
register
mail settings
Submitter Darren Hart
Date July 9, 2013, 10:15 p.m.
Message ID <e01e4656b562f087f270dc1134e7501c8f6b169b.1373408128.git.dvhart@linux.intel.com>
Download mbox | patch
Permalink /patch/53409/
State Accepted
Commit 788f176a735fdce7224b8baf45358dd1b34da3bb
Headers show

Comments

Darren Hart - July 9, 2013, 10:15 p.m.
An empty asound.conf should work for most cases. The existing asound.conf
uses plug dmix which causes arecord to fail without a special -D device
specification on the command line (as no capture device is defined).

Clear asound.conf for the default case. Any needed changes should be
made in the BSP layers.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Koen Kooi <koen@dominion.thruhere.net>
---
 meta/recipes-bsp/alsa-state/alsa-state/asound.conf | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
Saul Wold - July 9, 2013, 10:43 p.m.
On 07/09/2013 03:15 PM, Darren Hart wrote:
> An empty asound.conf should work for most cases. The existing asound.conf
> uses plug dmix which causes arecord to fail without a special -D device
> specification on the command line (as no capture device is defined).
>
> Clear asound.conf for the default case. Any needed changes should be
> made in the BSP layers.
>
Does there need to be any corresponding change for the meta-yocto-bsps?


Sau!


> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> Cc: Koen Kooi <koen@dominion.thruhere.net>
> ---
>   meta/recipes-bsp/alsa-state/alsa-state/asound.conf | 13 +------------
>   1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
> index 6be0242..03653cf 100644
> --- a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
> +++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
> @@ -1,12 +1 @@
> -# default dmix configuration
> -
> -pcm.!default {
> -    type plug
> -    slave.pcm "dmix"
> -}
> -
> -ctl.mixer0 {
> -    type hw
> -    card 0
> -}
> -
> +# Global alsa-lib configuration
>
Darren Hart - July 9, 2013, 10:59 p.m.
On Tue, 2013-07-09 at 15:43 -0700, Saul Wold wrote:
> On 07/09/2013 03:15 PM, Darren Hart wrote:
> > An empty asound.conf should work for most cases. The existing asound.conf
> > uses plug dmix which causes arecord to fail without a special -D device
> > specification on the command line (as no capture device is defined).
> >
> > Clear asound.conf for the default case. Any needed changes should be
> > made in the BSP layers.
> >
> Does there need to be any corresponding change for the meta-yocto-bsps?

I don't believe so, but I have not built and tested every one. The old
one setup an alias "mixer0" to hardware card 0, which isn't necessary
for alsamixer to work and should be the default anyway.

I don't know what the motivation was to use dmix for the default pcm.
This was pulled in from open-embedded, which has a minimal commit
message:

commit bbc2776c0d955da7ec774ae934c541f33133f876
Author: Michael Lauer <mickey@vanille-media.de>
Date:   Thu Sep 13 01:10:23 2007 +0000

    alsa-state: ship standard asoundrc (simple dmix configuration)
    that should be a reasonable default for most devices

According to the alsa wiki, the asound.conf should not be required for
basic functionality:

http://www.alsa-project.org/main/index.php/Asoundrc

--
Darren

> 
> 
> Sau!
> 
> 
> > Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> > Cc: Koen Kooi <koen@dominion.thruhere.net>
> > ---
> >   meta/recipes-bsp/alsa-state/alsa-state/asound.conf | 13 +------------
> >   1 file changed, 1 insertion(+), 12 deletions(-)
> >
> > diff --git a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
> > index 6be0242..03653cf 100644
> > --- a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
> > +++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
> > @@ -1,12 +1 @@
> > -# default dmix configuration
> > -
> > -pcm.!default {
> > -    type plug
> > -    slave.pcm "dmix"
> > -}
> > -
> > -ctl.mixer0 {
> > -    type hw
> > -    card 0
> > -}
> > -
> > +# Global alsa-lib configuration
> >
Saul Wold - July 9, 2013, 11:32 p.m.
On 07/09/2013 03:59 PM, Darren Hart wrote:
> On Tue, 2013-07-09 at 15:43 -0700, Saul Wold wrote:
>> On 07/09/2013 03:15 PM, Darren Hart wrote:
>>> An empty asound.conf should work for most cases. The existing asound.conf
>>> uses plug dmix which causes arecord to fail without a special -D device
>>> specification on the command line (as no capture device is defined).
>>>
>>> Clear asound.conf for the default case. Any needed changes should be
>>> made in the BSP layers.
>>>
>> Does there need to be any corresponding change for the meta-yocto-bsps?
>
> I don't believe so, but I have not built and tested every one. The old
> one setup an alias "mixer0" to hardware card 0, which isn't necessary
> for alsamixer to work and should be the default anyway.
>
> I don't know what the motivation was to use dmix for the default pcm.
> This was pulled in from open-embedded, which has a minimal commit
> message:
>
> commit bbc2776c0d955da7ec774ae934c541f33133f876
> Author: Michael Lauer <mickey@vanille-media.de>
> Date:   Thu Sep 13 01:10:23 2007 +0000
>
Given it's 5 years old, it might be that alsa now "does the right thing" 
and your change is valid.

Thanks
	Sau!

>      alsa-state: ship standard asoundrc (simple dmix configuration)
>      that should be a reasonable default for most devices
>
> According to the alsa wiki, the asound.conf should not be required for
> basic functionality:
>
> http://www.alsa-project.org/main/index.php/Asoundrc
>
> --
> Darren
>
>>
>>
>> Sau!
>>
>>
>>> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
>>> Cc: Koen Kooi <koen@dominion.thruhere.net>
>>> ---
>>>    meta/recipes-bsp/alsa-state/alsa-state/asound.conf | 13 +------------
>>>    1 file changed, 1 insertion(+), 12 deletions(-)
>>>
>>> diff --git a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
>>> index 6be0242..03653cf 100644
>>> --- a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
>>> +++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
>>> @@ -1,12 +1 @@
>>> -# default dmix configuration
>>> -
>>> -pcm.!default {
>>> -    type plug
>>> -    slave.pcm "dmix"
>>> -}
>>> -
>>> -ctl.mixer0 {
>>> -    type hw
>>> -    card 0
>>> -}
>>> -
>>> +# Global alsa-lib configuration
>>>
>
Darren Hart - July 10, 2013, 4:52 p.m.
On Tue, 2013-07-09 at 16:32 -0700, Saul Wold wrote:
> On 07/09/2013 03:59 PM, Darren Hart wrote:
> > On Tue, 2013-07-09 at 15:43 -0700, Saul Wold wrote:
> >> On 07/09/2013 03:15 PM, Darren Hart wrote:
> >>> An empty asound.conf should work for most cases. The existing asound.conf
> >>> uses plug dmix which causes arecord to fail without a special -D device
> >>> specification on the command line (as no capture device is defined).
> >>>
> >>> Clear asound.conf for the default case. Any needed changes should be
> >>> made in the BSP layers.
> >>>
> >> Does there need to be any corresponding change for the meta-yocto-bsps?
> >
> > I don't believe so, but I have not built and tested every one. The old
> > one setup an alias "mixer0" to hardware card 0, which isn't necessary
> > for alsamixer to work and should be the default anyway.
> >
> > I don't know what the motivation was to use dmix for the default pcm.
> > This was pulled in from open-embedded, which has a minimal commit
> > message:
> >
> > commit bbc2776c0d955da7ec774ae934c541f33133f876
> > Author: Michael Lauer <mickey@vanille-media.de>
> > Date:   Thu Sep 13 01:10:23 2007 +0000
> >
> Given it's 5 years old, it might be that alsa now "does the right thing" 
> and your change is valid.

Apparently Angstrom has been doing this for a while now. Koen, do you
agree this is the right thing for oe-core?

I missed the PR bump... I can't remember, do we do that anymore?

--
Darren

> 
> Thanks
> 	Sau!
> 
> >      alsa-state: ship standard asoundrc (simple dmix configuration)
> >      that should be a reasonable default for most devices
> >
> > According to the alsa wiki, the asound.conf should not be required for
> > basic functionality:
> >
> > http://www.alsa-project.org/main/index.php/Asoundrc
> >
> > --
> > Darren
> >
> >>
> >>
> >> Sau!
> >>
> >>
> >>> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> >>> Cc: Koen Kooi <koen@dominion.thruhere.net>
> >>> ---
> >>>    meta/recipes-bsp/alsa-state/alsa-state/asound.conf | 13 +------------
> >>>    1 file changed, 1 insertion(+), 12 deletions(-)
> >>>
> >>> diff --git a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
> >>> index 6be0242..03653cf 100644
> >>> --- a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
> >>> +++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
> >>> @@ -1,12 +1 @@
> >>> -# default dmix configuration
> >>> -
> >>> -pcm.!default {
> >>> -    type plug
> >>> -    slave.pcm "dmix"
> >>> -}
> >>> -
> >>> -ctl.mixer0 {
> >>> -    type hw
> >>> -    card 0
> >>> -}
> >>> -
> >>> +# Global alsa-lib configuration
> >>>
> >

Patch

diff --git a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
index 6be0242..03653cf 100644
--- a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
+++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
@@ -1,12 +1 @@ 
-# default dmix configuration
-
-pcm.!default {
-    type plug
-    slave.pcm "dmix"
-}
-
-ctl.mixer0 {
-    type hw
-    card 0
-}
-
+# Global alsa-lib configuration