Skip to contentSkip to conversation

asoundrc parse error (bug)

DISCUSSION Paul Davis 2 participants 3 messages May 9, 2002

lore
Share & tools
lore

Paul Davis

author
#0 lore raw

i mentioned a month or two ago that the parsing of asoundrc didn't handle things that were apparently integers unless they were quoted. abramo claimed this was fixed, and indeed it is in top level constructs. but here's one:

pcm.9652 {
type hw
card 2
}

pcm.st {
       type plug
       slave.pcm 9652
       ttable.0.24 1
       ttable.1.25 1
}       

this will fail unless you put the "9652" for the slave.pcm definition in quotes. the error is:

ALSA lib pcm.c:1621:(snd_pcm_open_conf) Invalid type for PCM definition (id: pcm, value: 9652)
arecord: main:447: audio open error: Invalid argument

further, this:

pcm.spdif {
       type plug
       slave.pcm "9652"
       ttable.0.24 1
       ttable.1.25 1
}       

will fail like this:

ALSA lib conf.c:1131:(parse_def) spdif is not a compound
ALSA lib conf.c:1520:(snd_config_load1) _toplevel_:16:11:Invalid argument
ALSA lib conf.c:2616:(snd_config_hook_load) /home/pbd/.asoundrc may be old or corrupted: consider to remove or fix it ALSA lib conf.c:2463:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument ALSA lib conf.c:2859:(snd_config_update_r) hooks failed, removing configuration
aplay: pcm_list:248: snd_config_update: Invalid argument
pbd[555]>aplay -L
ALSA lib conf.c:1131:(parse_def) spdif is not a compound
ALSA lib conf.c:1520:(snd_config_load1) _toplevel_:16:11:Invalid argument
ALSA lib conf.c:2616:(snd_config_hook_load) /home/pbd/.asoundrc may be old or corrupted: consider to remove or fix it ALSA lib conf.c:2463:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument ALSA lib conf.c:2859:(snd_config_update_r) hooks failed, removing configuration
aplay: pcm_list:248: snd_config_update: Invalid argument

simply changing "spdif" to "st" will fix that error. it seems that "spdif" is recognized as a keyword, or something like that.

--p

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [email protected]

#1 lore raw
Quoted 17 lines · Paul Davis

i mentioned a month or two ago that the parsing of asoundrc didn't handle things that were apparently integers unless they were quoted. abramo claimed this was fixed, and indeed it is in top level constructs. but here's one:

pcm.9652 {
type hw
card 2
}

pcm.st {
       type plug
       slave.pcm 9652
       ttable.0.24 1
       ttable.1.25 1
}       
Quoted 5 lines

this will fail unless you put the "9652" for the slave.pcm definition in quotes. the error is:

ALSA lib pcm.c:1621:(snd_pcm_open_conf) Invalid type for PCM definition (id: pcm, value: 9652)
arecord: main:447: audio open error: Invalid argument

It's ok, slave.pcm should be a string (as defined in asoundrc.txt or alsa-lib reference guide).

Quoted 26 lines

further, this:

pcm.spdif {
       type plug
       slave.pcm "9652"
       ttable.0.24 1
       ttable.1.25 1
}       

will fail like this:

ALSA lib conf.c:1131:(parse_def) spdif is not a compound
ALSA lib conf.c:1520:(snd_config_load1) _toplevel_:16:11:Invalid argument
ALSA lib conf.c:2616:(snd_config_hook_load) /home/pbd/.asoundrc may be old or corrupted: consider to remove or fix it ALSA lib conf.c:2463:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument ALSA lib conf.c:2859:(snd_config_update_r) hooks failed, removing configuration
aplay: pcm_list:248: snd_config_update: Invalid argument
pbd[555]>aplay -L
ALSA lib conf.c:1131:(parse_def) spdif is not a compound
ALSA lib conf.c:1520:(snd_config_load1) _toplevel_:16:11:Invalid argument
ALSA lib conf.c:2616:(snd_config_hook_load) /home/pbd/.asoundrc may be old or corrupted: consider to remove or fix it ALSA lib conf.c:2463:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument ALSA lib conf.c:2859:(snd_config_update_r) hooks failed, removing configuration
aplay: pcm_list:248: snd_config_update: Invalid argument

Quoted 2 lines

simply changing "spdif" to "st" will fix that error. it seems that "spdif" is recognized as a keyword, or something like that.

We have already defined pcm.spdif in global configuration file /usr/share/alsa/alsa.conf. If you want to override the defaults you should use 'pcm.!spdif { }' (override old configuration node).

Anyway, it would be better to add support for RME cards to standard configuration files. I've created initial ones, could you verify them? They are placed in /usr/share/alsa/cards/ directory - RME9636.conf and RME9652.conf files (sources are in alsa-lib/src/conf). The S/PDIF output should work as 'plug:spdif' or simply 'spdif' when no conversion is necessary.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [email protected]

author
#2 lore raw
Quoted 10 lines
Quoted 10 lines
pcm.st {
       type plug
       slave.pcm 9652
       ttable.0.24 1
       ttable.1.25 1
}       

this will fail unless you put the "9652" for the slave.pcm definition in quotes. the error is:

Quoted 6 lines
Quoted 1 line

ALSA lib pcm.c:1621:(snd_pcm_open_conf) Invalid type for PCM definition (id:

pcm, value: 9652)

Quoted 1 line

arecord: main:447: audio open error: Invalid argument

It's ok, slave.pcm should be a string (as defined in asoundrc.txt or alsa-lib reference guide).

well, my original claim was that the parsing code wouldn't allow the use of numerics as device names. abramo claimed that there was no problem with this. this example shows that there is.

there is nothing ambiguous about the example above. the problem arises only because a formal grammar is not being used to parse it. whatever.

Quoted 6 lines

Anyway, it would be better to add support for RME cards to standard configuration files. I've created initial ones, could you verify them? They are placed in /usr/share/alsa/cards/ directory - RME9636.conf and RME9652.conf files (sources are in alsa-lib/src/conf). The S/PDIF output should work as 'plug:spdif' or simply 'spdif' when no conversion is necessary.

they look fine, to the extent that i actually understand them :)

--p

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [email protected]