[pulseaudio-discuss] M-Audio FastTrack Pro

Lennart Poettering lennart at poettering.net
Fri Jan 15 06:57:42 PST 2010


On Fri, 15.01.10 09:22, Colin Guthrie (gmane at colin.guthr.ie) wrote:

> 
> 'Twas brillig, and Lennart Poettering at 14/01/10 20:34 did gyre and gimble:
> > udev actually sets two props: ID_MODEL and ID_MODEL_ENC. The former
> > has all special chars (including spaces) replaced by underscore. The
> > latter has them escape in a \x20 like notation.
> > 
> > I have now modified PA to use ID_MODEL_ENC and undo the encoding. You
> > should now get the USB supplied names without underscores.
> 
> Warning: pedantic quibble ahead!
> 
> May I suggest some kind of rtrim() behaviour to strip out whitespace at
> the RHS?
> 
> e.g.
>    alsa.card_name = "YAMAHA YST-M45D USB Speaker  "
> 
> It's not a biggie. If I find time I'll tweak the behaviour to do an
> rtrim-like thing after decoding (either that or tweak the state machine
> itself to suppress spaces until a valid char is found - not really
> looked at the code), but feel free to beat me to it.

I added this now, so that we won't forget:

http://pulseaudio.org/ticket/778

We probably should have a core-util.h function called
pa_cleanup_spaces() or so, that does ltrim, rtrim and replaces
multiple sequential spaces by a single one. So that " foo    bar "
becomes "foo bar".

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list