@Carsten

I think I have an easy generic way to determine idVendor and idProduct
from just the card name (i.e. the output device specified in the
squeezelite command line).  In my case I have the output device set to
'hw:CARD=DAC,DEV=0', so the card name is 'DAC'.  On my system the two
ids seem to be recorded in a file named usbid in /proc/asound/card<n>/
where <n> is the card number.  

Would you be kind enough to try this script (I called it DACfinder.sh)
to see if it is suitably generic, or whether differences between setups
will make this more complex.  If this is suitably generic, then the udev
rules could be written automatically, and the udev script would need no
user editing.


Code:
--------------------
    #!/bin/sh
  
  cardname=$1
  
  cardno=$(cat /proc/asound/cards | grep -m 1 $cardname | awk {'print $1'})
  
  usbid=$(cat /proc/asound/card$cardno/usbid)
  idVendor=$(echo $usbid | awk -F: {'print $1'})
  idProduct=$(echo $usbid | awk -F: {'print $2'})
  
  echo "idVendor = $idVendor"
  echo "idProduct = $idProduct"
--------------------


Run it with a single command line parameter, e.g. DACfinder DAC, or
DACfinder Soundsticks (if that's what your card name is).


------------------------------------------------------------------------
chill's Profile: http://forums.slimdevices.com/member.php?userid=10839
View this thread: http://forums.slimdevices.com/showthread.php?t=113661

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to