[MPlayer-users] ALSA device mangling rules?

Christian Jaeger chrjae at gmail.com
Sun Mar 2 17:27:00 CET 2014

2014-03-02 14:45 GMT+00:00 Reimar Döffinger <Reimar.Doeffinger at gmx.de>:
> MPlayer cannot support the normal ALSA naming as , and : already have other reserved meanings, though if really desired a more advance escaping scheme could be designed.

If my current code as per the github link in my second mail (which is
passing "default=C1100" to mplayer/mencoder for my example) will
continue to work, and work in all reasonable ALSA device situations,
then I'm fine (more precise documentation in man mplayer would still
be a good thing).

Otherwise, perhaps either

(a) with a local change to the alsa handler: a backslash before any
character (e.g. = or . or \) meaning that the character is verbatim
and not to be mapped back (the backslash being removed).

(b) a change to the global option parser that allows for (infinite)
nesting, replacing the need to turn ':' into something else: use
double quote as the start and end of a substring; backslash escapes
like in (a) (i.e. the string syntax as used in most programming
languages would work if backslash is only used to escape the double
quote and the backslash). Such options could be created by bash with:

 $ export FOO="default:"CARD"='C1100'"
 $ echo someoption=""`printf '%q' "$FOO"`""

If the option parser passes on a flag on whether the substring was in
quotes, then the alsa handler would know whether to do backwards
compatible mapping of = into : or not.

Probably a bit involved, but would allow for proper nesting for any
subsystem, avoiding special-casing ALSA.

> For now you'll just have to define aliases with fewer special characters.

I haven't defined ALSA aliases for a long time, if ever really, and
I'm pretty sure the target users of my program won't do that.


More information about the MPlayer-users mailing list