# Samson Carbon 49 needs to be plugged in twice \[solved\]

**URL:** <https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739>\
**Category:** Using Zynthian\
**Created:** [May 29, 2017, 9:40pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739 "2017-05-29T21:40:07Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![steveb](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/steveb/32/336_2.png) [@steveb](https://discourse.zynthian.org/u/steveb)\
**Post date:** [May 29, 2017, 9:40pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/1 "2017-05-29T21:40:07Z")

</div>

I have an issue when first plugging in one of my usb midi keyboards (or having it already plugged in on boot). The first time the keyboard isn’t properly recognised. Hitting keys results in screen navigation events instead of notes being played.

It starts working properly if it is unplugged and replugged. Here is the journal for the first time its plugged in:

```
May 29 22:24:21 zynthian kernel: usb 1-1.2: new full-speed USB device number 4 using dwc_otg
May 29 22:24:21 zynthian kernel: usb 1-1.2: New USB device found, idVendor=1234, idProduct=5678
May 29 22:24:21 zynthian kernel: usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 29 22:24:21 zynthian kernel: usb 1-1.2: Product: SAMSONG Carbon49 
May 29 22:24:21 zynthian kernel: usb 1-1.2: Manufacturer: James Lam
May 29 22:24:21 zynthian kernel: usb 1-1.2: SerialNumber: FF17406A3834
May 29 22:24:21 zynthian kernel: input: James Lam SAMSONG Carbon49 as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.1/input/input1
May 29 22:24:21 zynthian kernel: usbcore: registered new interface driver usbtouchscreen
May 29 22:24:21 zynthian kernel: usbcore: registered new interface driver snd-usb-audio

```

And the second time:

```
May 29 22:26:31 zynthian kernel: usb 1-1.2: new full-speed USB device number 5 using dwc_otg
May 29 22:26:31 zynthian kernel: usb 1-1.2: New USB device found, idVendor=1234, idProduct=5678
May 29 22:26:31 zynthian kernel: usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 29 22:26:31 zynthian kernel: usb 1-1.2: Product: SAMSONG Carbon49 
May 29 22:26:31 zynthian kernel: usb 1-1.2: Manufacturer: James Lam
May 29 22:26:31 zynthian kernel: usb 1-1.2: SerialNumber: FF17406A3834
May 29 22:26:31 zynthian jackd[353]: scan: added port hw:1,0,0 in-hw-1-0-0-SAMSONG-Carbon49-MIDI-1
May 29 22:26:31 zynthian jackd[353]: scan: added port hw:1,0,0 out-hw-1-0-0-SAMSONG-Carbon49-MIDI-1
May 29 22:26:31 zynthian jackd[353]: scan: opened port hw:1,0,0 in-hw-1-0-0-SAMSONG-Carbon49-MIDI-1
May 29 22:26:31 zynthian jackd[353]: scan: opened port hw:1,0,0 out-hw-1-0-0-SAMSONG-Carbon49-MIDI-1

```

It looks like jackd isn’t picking it up on the first time. This only happens with the samsong, I can’t make it happen with my Korg nanokey.

I can try debugging this myself if you can point me in the right direction.

---

<div class="post-metadata">

**Author:** ![steveb](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/steveb/32/336_2.png) [@steveb](https://discourse.zynthian.org/u/steveb)\
**Post date:** [May 29, 2017, 9:42pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/2 "2017-05-29T21:42:13Z")

</div>

Its like the first time it gets registered as an input device:

```
May 29 22:24:21 zynthian kernel: input: James Lam SAMSONG Carbon49 as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.1/input/input1
```

---

<div class="post-metadata">

**Author:** ![steveb](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/steveb/32/336_2.png) [@steveb](https://discourse.zynthian.org/u/steveb)\
**Post date:** [May 29, 2017, 11:21pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/3 "2017-05-29T23:21:00Z")

</div>

I think the Carbon49 usb data is too sparse or bogus and is triggering some catch-all input rule. I’ll be changing my midi controller soon anyway so I can put up with this behaviour for now.

---

<div class="post-metadata">

**Author:** ![jofemodo](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/jofemodo/32/2_2.png) [@jofemodo](https://discourse.zynthian.org/u/jofemodo)\
**Post date:** [May 30, 2017, 9:25am UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/4 "2017-05-30T09:25:00Z")

</div>

Can you check how many MIDI sub-devices creates your keyboard? Sometimes this is a problem …

Regards!

---

<div class="post-metadata">

**Author:** ![Andy](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@Andy](https://discourse.zynthian.org/u/Andy)\
**Post date:** [May 31, 2017, 1:55pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/5 "2017-05-31T13:55:38Z")

</div>

I’ve had similar problems with my Carbon 49. Device is recognised when Zynthian is rebooted, but midi doesn’t work until the keyboard is unplugged/replugged. I can kinda live with it,…

---

<div class="post-metadata">

**Author:** ![jofemodo](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/jofemodo/32/2_2.png) [@jofemodo](https://discourse.zynthian.org/u/jofemodo)\
**Post date:** [May 31, 2017, 3:30pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/6 "2017-05-31T15:30:36Z")

</div>

Is the Carbon 49 the only MIDI-USB device connected to Zynthian?

---

<div class="post-metadata">

**Author:** ![steveb](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/steveb/32/336_2.png) [@steveb](https://discourse.zynthian.org/u/steveb)\
**Post date:** [May 31, 2017, 10:10pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/7 "2017-05-31T22:10:52Z")

</div>

I also have a Korg nanoKEY2 which works just fine plugged in in whatever order.

I think I’ve found the problem, the first time the Carbon49 is plugged in the usbtouchscreen driver gets loaded

```
# lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
        |__ Port 2: Dev 4, If 0, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 2: Dev 4, If 1, Class=Audio, Driver=usbtouchscreen, 12M

```

So now I’ve done this and it works first time

```
root@zynthian:~# cat /etc/modprobe.d/usbtouchscreen.conf 
blacklist usbtouchscreen

```

I assume there won’t be a zynthian box which needs the `usbtouchscreen` driver, so I’ll propose this to zynthian-sys

---

<div class="post-metadata">

**Author:** ![john](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/j/a3d4f5/32.png) [@john](https://discourse.zynthian.org/u/john)\
**Post date:** [May 31, 2017, 11:09pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/8 "2017-05-31T23:09:34Z")

</div>

Have had issues with Roland GR20 to midi to usb interface in to the Zynthian. have deduced the problem is that Roland sends out a Midi Time Code sync command every 3 seconds which the gives the os a problem at boot up if I turn on the GR20 after boot up then no problem.

---

<div class="post-metadata">

**Author:** ![steveb](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/steveb/32/336_2.png) [@steveb](https://discourse.zynthian.org/u/steveb)\
**Post date:** [May 31, 2017, 11:11pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/9 "2017-05-31T23:11:27Z")

</div>

The Carbon49 issue also happens the first time it is plugged in after boot.

---

<div class="post-metadata">

**Author:** ![john](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/j/a3d4f5/32.png) [@john](https://discourse.zynthian.org/u/john)\
**Post date:** [May 31, 2017, 11:16pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/10 "2017-05-31T23:16:59Z")

</div>

What happens if you use a midi cable from Carbon49 into Zynthian?

---

<div class="post-metadata">

**Author:** ![steveb](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/steveb/32/336_2.png) [@steveb](https://discourse.zynthian.org/u/steveb)\
**Post date:** [May 31, 2017, 11:17pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/11 "2017-05-31T23:17:40Z")

</div>

I haven’t wired up my midi socket yet 🙂

---

<div class="post-metadata">

**Author:** ![john](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/j/a3d4f5/32.png) [@john](https://discourse.zynthian.org/u/john)\
**Post date:** [May 31, 2017, 11:20pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/12 "2017-05-31T23:20:32Z")

</div>

have you plugged it into a computer and use a program like MIDI Monitor to see what data Carbon49 is sending when Idle?

---

<div class="post-metadata">

**Author:** ![steveb](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/steveb/32/336_2.png) [@steveb](https://discourse.zynthian.org/u/steveb)\
**Post date:** [May 31, 2017, 11:22pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/13 "2017-05-31T23:22:11Z")

</div>

I haven’t. I think the problem is fixed by blacklisting usbtouchscreen, so I’m happy now.

---

<div class="post-metadata">

**Author:** ![jofemodo](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/jofemodo/32/2_2.png) [@jofemodo](https://discourse.zynthian.org/u/jofemodo)\
**Post date:** [June 1, 2017, 3:54pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/14 "2017-06-01T15:54:17Z")

</div>

Hi Steve!

I’m not sure of blacklisting the usbtouchscreen driver. There are people using different displays, some of them with USB touch interface, so we have to find a better solution.

It seems that the driver is loading incorrectly, so perhaps we can solve tweaking some rule of the udev system (/etc/rules.d):

> [udev - ArchWiki](https://wiki.archlinux.org/index.php/udev)

Regards!

---

<div class="post-metadata">

**Author:** ![steveb](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/steveb/32/336_2.png) [@steveb](https://discourse.zynthian.org/u/steveb)\
**Post date:** [June 1, 2017, 9:25pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/15 "2017-06-01T21:25:59Z")

</div>

OK, I’ll see if I can come up with an authorized=0 udev rule

---

<div class="post-metadata">

**Author:** ![steveb](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/steveb/32/336_2.png) [@steveb](https://discourse.zynthian.org/u/steveb)\
**Post date:** [June 1, 2017, 10:58pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/16 "2017-06-01T22:58:51Z")

</div>

OK, I have another /etc/modprobe.d/ based fix. The Carbon49 usb data has vendor=1234 product=5678, which is not unique and clashes with an alias rule in /lib/modules/4.9.24-v7+/modules.alias that loads usbtouchscreen

This rule is much more specific, and is unlikely to affect usbtouchscreen devices that may be used by zynthian users:

```
# cat /etc/modprobe.d/carbon49-alias.conf 
# Ensure the Samson Carbon 49 loads the snd-usb-audio instead of
# usbtouchscreen. This midi controller has the non-unique 
# vendor=1234 product=5678
alias usb:v1234p5678d*dc*dsc*dp*ic*isc*ip*in* snd-usb-audio
```

---

<div class="post-metadata">

**Author:** ![steveb](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/steveb/32/336_2.png) [@steveb](https://discourse.zynthian.org/u/steveb)\
**Post date:** [June 1, 2017, 11:07pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/17 "2017-06-01T23:07:26Z")

</div>

I’ve fixed up the pull-request, sorry about the churn.

---

<div class="post-metadata">

**Author:** ![jofemodo](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/jofemodo/32/2_2.png) [@jofemodo](https://discourse.zynthian.org/u/jofemodo)\
**Post date:** [June 2, 2017, 10:08pm UTC](https://discourse.zynthian.org/t/samson-carbon-49-needs-to-be-plugged-in-twice-solved/739/18 "2017-06-02T22:08:37Z")

</div>

Great, @steveb!

I’ve merged your changes into the master branch and it will be included in the next update bundle 😉

Thanks a lot!
