Possible to rename "MIDI function" to something else?

Hello,

When I use midi-ox (for example) the Zynthian shows up as “MIDI funtion”. Is it possible to rename this persistently to, for example, Zynthian? I’ve seached through discourse and could not find any info on this.
Thanks,
Harry

Hi @harrylnorris

I think you are referring to plugging the Zynthian’s USB-C connector to a computer so that Zynthian acts as a MIDI USB device. The name presented is currently hardcoded into the kernel module that provides this function. It is a relatively new feature of Raspberry Pi and we were waiting for it to be further enhanced, e.g. it does not currently support audio over USB. Of course anything is possible but we would probably need to recompile the kernel (or at least the relevant module) which is an overhead we may wish to avoid. Let’s see if there is any capacity in our effort…

1 Like

Understood. Thanks.

BTW, the other end of the link is equally oddly named, appearing as “fmidi” within Zynthian. I am sure we would all want to see these have more representative names (and meet the person who thought those names made any sense!!!).

I missed the fact this was possible at all! But how is Zynthian powered if the USB-C is connected to a computer? Can a computer deliver power in a stable enough way, avoiding x runs? Or is power delivered by soldering wires to some test ports? Or is it door 3, it’s not a cable connected to RPI’s usb-c, but to one of the other 4 USB ports (though the way you phrased it didn’t read like that)?

It’s possible to power the pi through gpio 40 pi s port (5V pins 2 and 4).

Just need to take care about cable thickness.

1 Like

One can get a “splitter cable” with usb data on one cable and usb power on the other. That way the Zynthian can be a usb client while still getting power from the wall supply. For example: https://www.amazon.com/dp/B09C5BQ7VB?psc=1&ref=ppx_yo2ov_dt_b_product_details
Harry

2 Likes

Both ideas seem suited for different projects (small zynth box with the splitter cable, and a eurorack mounted zynthian likely powered internally, skipping the usb-c cable altogether). I’ll see what i come up with after the festive break, thank you both!

If you power the RPi via is GPI pin header you must ensure:

  • PSU is very well regulated and limited
  • Connecting wires are sufficiently thick
  • Connection is good (well crimped/soldered and making good contact with the pins)

I’ve had trouble finding a USB Y-cable that provides the right connections in the right direction but that was micro-USB which may have had different constraints to USB-C. I found that most cables offered data from the micro-USB to a USB plug but power inject feed the same USB plug, not the micro-USB connected to the phone/tablet/RPi. Maybe USB-C is easier to use for this purpose.

I have managed to power a RPi from PC USB via a powered USB hub but it wasn’t reliable. It is challenging to get the (nearly) 3A required by a Zynthian at full throttle, turned up to eleven!

Good advices as usual, thanks @riban

So this is something I need to get better at, as last time I tried getting a better buck converter I ended up(likely) shorting the USBC port of a now dead RPI 4 (maybe comatose? I’ll need to try putting it via gpio, see if it still has some hope!

I’ll do some digging on this in January. I’ll report back if I find something reasonably priced and available in the UK (the one Harry suggested isn’t on Amazon around here, but I didn’t spend much time looking, yet. I hope there’s something :slight_smile: )

I couldn’t resist the challenge…

This looks to be exactly what is required. It allows connection to the RPi4 USB-C socket via a (not included) USB-C to USB-C cable. It presents that port a an OTG port to allow connection to a host computer via another (not included) USB-C to USB-C cable. Power can be injected with a standard USB-C PSU, e.g. RPi standard PSU or via a 5.5mm (2.1/2.5) DC supply connector. £3 looks fair although postage is an issue with The Pi Hut unless you have a higher value order.

This could be the solution many of us seek.

3 Likes

Looks fantastic, only issue I can find is fitting it into (already) tight enclosures, but it’s more due to the extra cable that’ll need to be inside as well. I know, just being picky now :joy: Feature wise seems exactly what I want. Thanks!

I am looking at the naming thing…

It is possible to pass the parameter iProduct to the g_midi device driver which changes the name the Zynthian will appear with to the host device so we will change that in a future update, e.g. modprobe g_midi iProduct=Zynthian.

We could also add extra virtual MIDI ports within the USB link, e.g. modprobe g_midi in_ports=2 outputs=2 would give 2 virtual ports in each direction. Some may find this useful. Maybe that would be configurable within the Zynthian MIDI Profile configuration.

I have also seen that audio over USB is now also supported. Indeed, if I install the module g_audio then I see the Zynthian as an audio device connected to my laptop. This is probably of limited use at the moment as Zynthian relies on Jack Audio Connection Kit which depends on a single audio interface for its samplerate and timing. (There are ways to add extra audio interfaces but the CPU overhead associated with the required samplerate conversion is generally undesirable. This is how we use onboard audio interface for headphone output.) It may be of more use if we move to Pipewire which handles multiple audio interfaces natively. (We haven’t done any detailed investigation into Pipewire which is still in its infancy and may also be prone to the same resource demands for such use cases.)

There may be other modules of interest to us, e.g. sharing some of the Zynthian file storage via g_mass_storage or presenting a network interface via g_ether.

I think that is enough for now - what I haven’t yet figured out is how to present the interfaces with different names within Zynthian but there are a few options that we could look at (including jack aliases). I have wanted to change some of these names for some time because we want it to be more obvious to a user what they are, for example ttymidi doesn’t (and shouldn’t) mean much to most people. (FYI: ttymidi is the interface used to present the physical MIDI ports on the back of the Zynthian, connected to the RPi’s onboard UART via its GPI header. That should make even less sense to normal people!)

[Edit] I have made the change for USB OTG MIDI name in the testing branch. If there are any intrepid explorers out there who want to validate this, please test.

4 Likes

There’s also one linked from that page with microusb which could be handy for powering older Pis without needing an official supply.