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:57] 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 93: | Line 93: | ||
| ..... | ..... | ||
| </code> | </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.) | ||