Cislovani zvukovych zarizeni

Zdravim, mam TV kartu a ta aby mi slapala i se zvukem musim spoustet tvtime pomoci nejakeho takoveho scriptu:


#!/bin/sh
tvtime &
p1=$!
arecord -D hw:2,0 -r 32000 -c 2 -f S16_LE | aplay &
wait $p1
killall -9 arecord
killall -9 aplay

Slape to celkem v poho akorat se mi porad meni cislo zvukoveho zarizeni z hw:2,0 na hw:0,0 a naopak. V /proc/asound/cards mam jednou:


 0 [CX8801         ]: CX88x - Conexant CX8801
                      Conexant CX8801 at 0xf9000000
 1 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xfdff8000 irq 43
 2 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfdcfc000 irq 45

a jindy


 0 [HDMI           ]: HDA-Intel - HDA ATI HDMI
                      HDA ATI HDMI at 0xfdcfc000 irq 45
 1 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xfdff8000 irq 43
 2 [CX8801         ]: CX88x - Conexant CX8801
                      Conexant CX8801 at 0xf9000000

Nejak se mi nedari najit zpusob jak to cislovani ustalit a na promakanejsi script mam malo mozkovych bunek :smiley: Nenapada Vas nejake solidni reseni at nemusim ten script kazkou chvili prepisovat :slight_smile: Zrovna me napadlo specifikovat to menici se cislo v tom scriptu necim takovym grep CX88x /proc/asound/cards | cut -c2 , ale to mi prijde volajake divoke :-))

Nevim zda se daji cisla karet zafixovat. Zrejme by s tim slo neco udelat pres udev, ale z hlavy nevim. Mozna by to zvladlo i pulseaudio.

Nevidim na pouziti takoveho berlicky nic spatneho.


arecord -D hw:`grep CX88x /proc/asound/cards | cut -c2`,0 -r 32000 -c 2 -f S16_LE | aplay &

Dik covex, poresil jsem to tak a pohoda :-)) Jeste by me zajimalo, jestli pulseaudiacke prikazy parecord a paplay maji stejne funkce jako arecord a aplay u alsy ?