aplay -l -v | grep "\[USB Device 0x41e:0x30d3\]" (which is what is run on line 1188) gives :
- Code: Select all
card 1: U0x41e0x30d3 [USB Device 0x41e:0x30d3], device 0: USB Audio [USB Audio]
- Code: Select all
$subdeviceid = explode(':',$description[0]); // will give an array ["card 1", " U0x41e0x30d3 [USB Device 0x41e", "0x30d3], device 0", " USB Audio [USB Audio]"]
// Then, we're working on $subdeviceid[1] whereas we're actually interested in $subdeviceid[2], everything being fucked of by the colon
$subdeviceid = explode(',',trim($subdeviceid[1])); // gives one-element array ["U0x41e0x30d3 [USB Device 0x41e"]
$subdeviceid = explode(' ',trim($subdeviceid[1])); // gives actually nothing because $subdeviceid[1] is out of bounds
$data['device'] = 'hw:'.$card_index.','.$subdeviceid[1];
Then I don't know what's the best solution to sort it out... maybe a regexp that checks not only for ":" and ",", but also the word "device" ?
/, device ([0-9]+):/