This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
linux:linux [2017/06/07 16:56] cipibad |
linux:linux [2017/06/07 17:22] (current) cipibad |
||
|---|---|---|---|
| Line 16: | Line 16: | ||
| </code> | </code> | ||
| - | ====== usb headphone ====== | + | ====== usb headphone (Jabra) ====== |
| - find device | - find device | ||
| <code> | <code> | ||
| Line 58: | Line 58: | ||
| ATTRS{supports_autosuspend}=="1" | ATTRS{supports_autosuspend}=="1" | ||
| + | looking at parent device '/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1.1': | ||
| + | KERNELS=="3-1.1" | ||
| + | SUBSYSTEMS=="usb" | ||
| + | DRIVERS=="usb" | ||
| + | ATTRS{authorized}=="1" | ||
| + | ATTRS{avoid_reset_quirk}=="0" | ||
| + | ATTRS{bConfigurationValue}=="1" | ||
| + | ATTRS{bDeviceClass}=="00" | ||
| + | ATTRS{bDeviceProtocol}=="00" | ||
| + | ATTRS{bDeviceSubClass}=="00" | ||
| + | ATTRS{bMaxPacketSize0}=="8" | ||
| + | ATTRS{bMaxPower}=="100mA" | ||
| + | ATTRS{bNumConfigurations}=="1" | ||
| + | ATTRS{bNumInterfaces}==" 4" | ||
| + | ATTRS{bcdDevice}=="0203" | ||
| + | ATTRS{bmAttributes}=="80" | ||
| + | ATTRS{busnum}=="3" | ||
| + | ATTRS{configuration}=="" | ||
| + | ATTRS{devnum}=="37" | ||
| + | ATTRS{devpath}=="1.1" | ||
| + | ATTRS{idProduct}=="0313" | ||
| + | ATTRS{idVendor}=="0b0e" | ||
| + | ATTRS{ltm_capable}=="no" | ||
| + | ATTRS{manufacturer}=="GN Audio A/S" | ||
| + | ATTRS{maxchild}=="0" | ||
| + | ATTRS{product}=="Jabra EVOLVE 30 II" | ||
| + | ATTRS{quirks}=="0x0" | ||
| + | ATTRS{removable}=="unknown" | ||
| + | ATTRS{serial}=="0002AD72CD6E07" | ||
| + | ATTRS{speed}=="12" | ||
| + | ATTRS{urbnum}=="97635" | ||
| + | ATTRS{version}==" 2.00" | ||
| + | |||
| + | ..... | ||
| + | </code> | ||
| + | - create udev rules file (''/etc/udev/rules.d/90-jabra.rules'') similar to the one bellow (replace | ||
| + | **ionescu** with your username) | ||
| + | <code> | ||
| + | KERNEL=="controlC1", SUBSYSTEM=="sound", ACTION=="add", ATTRS{product}=="Jabra EVOLVE 30 II", RUN+=" | ||
| + | /home/ionescu/bin/jabra_wrapper.sh" | ||
| + | </code> | ||
| + | - create /home/ionescu/bin/jabra_wrapper.sh file | ||
| + | <code> | ||
| + | #!/bin/sh | ||
| + | |||
| + | /usr/bin/nohup /bin/su ionescu -c /home/ionescu/bin/jabra.sh >/dev/null 2>&1 </dev/null & | ||
| + | </code> | ||
| + | - create /home/ionescu/bin/jabra.sh file | ||
| + | <code> | ||
| + | #!/bin/sh | ||
| + | |||
| + | PULSE_SERVER="unix:/run/user/`id -u`/pulse/native" | ||
| + | |||
| + | SINK_NAME="alsa_output.usb-GN_Audio_A_S_Jabra_EVOLVE_30_II_0002AD72CD6E07-00.analog-stereo" | ||
| + | |||
| + | SINK_LIST_CMD="pactl --server $PULSE_SERVER list sinks" | ||
| + | |||
| + | nSinks=`$SINK_LIST_CMD | grep "Name: $SINK_NAME" | wc -l` | ||
| + | tries=0 | ||
| + | MAX_TRIES=10 | ||
| + | |||
| + | while [ $nSinks -ne 1 -a $tries -lt $MAX_TRIES ]; do | ||
| + | nSinks=`$SINK_LIST_CMD | grep "Name: $SINK_NAME" | wc -l` | ||
| + | tries=$((tries+1)) | ||
| + | sleep 1 | ||
| + | done | ||
| + | |||
| + | pactl --server "$PULSE_SERVER" set-default-sink alsa_output.usb-GN_Audio_A_S_Jabra_EVOLVE_30_II_0002AD72CD6E07-00 | ||
| + | .analog-stereo | ||
| + | </code> | ||
| + | - make the two new files executable | ||
| + | <code> | ||
| + | $ chmod +x /home/ionescu/bin/jabra.sh /home/ionescu/bin/jabra_wrapper.sh | ||
| + | </code> | ||
| + | - double check and adapt to your environment (username/sink name/etc.) | ||