On 4/12/06, Clemens Ladisch <[EMAIL PROTECTED]> wrote:
Sergey Kolosov wrote:
> How can use function getenv from alsa config file? I have created .asoundrc
> with next contents:
> pcm.!default {
>         type hw
>         card 0
>         device
>                 {
>                         @func igetenv
>                                 vars [ MY_TEST_ALSA_DEVICE ]
>                                 default { 2 }
>                 }
> }

This "default" key needs a simple value instead of a node.  The
"igetenv" call in alsa.conf uses braces because the call to "refer"
needs a node.

(Function calls replace their entire node with the function's return
value.)

I have replaced "default { 2 }"  with "default 2"  and it has worked.

> But alsa say,what my configuration is wrong
> [EMAIL PROTECTED]:~$ MY_TEST_ALSA_DEVICE=2 aplay test.wav
> ALSA lib conf.c:1592:(snd_config_load1) _toplevel_:12:0:Unexpected char

Which character is this?
[EMAIL PROTECTED]:~$
  wc -l .asoundrc
11 .asoundrc

This file have only 11 lines not 12.

Regards,
Clemens

Thanks for the help!

Reply via email to