Jump to content

Odroidian

Members
  • Posts

    5
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. It works! I tested the quick and dirty hack. Okay, not quick. I had to compile the Buster minimal image two times, because my change was overwritten when ./compile.sh downloads the sources. The second time I waited until the download had finished and the kernel's menuconfig popped up. In this pause I edited meson_uart.c and removed meson_uart.o. When I now set the UART to 38400 baud ... stty -F /dev/ttyAML1 38400 ... it actually outputs with 31250 baud, for example when I enter some characters with minicom running on the Odroid N2+: With the program ttymidi I am able to read the input (RX) of /dev/ttyAML1 and to connect it to ALSA. My virtual piano software is presenting a new MIDI input then (with the name "midi out"). ttymidi -s /dev/ttyAML1 -b 38400 Probably it is not necessary to compile the whole Armbian image, but I don't know so far how to compile and install the kernel only. I guess I have to "freeze" my image now in some kind, so that my change is not overwritten by accident in the future. Feel free to give me some advice what could have been done better. PS: Now on minimal Armbian_21.08.0-trunk_Odroidn2_buster_current_5.10.32.img
  2. Just from analogy ... could that work? static void meson_uart_change_speed(struct uart_port *port, unsigned long baud) { u32 val; while (!meson_uart_tx_empty(port)) cpu_relax(); /* Would this force 38400 to 31250 for MIDI? */ if (baud == 38400) { baud = 31250; } if (port->uartclk == 24000000) { val = ((port->uartclk / 3) / baud) - 1; val |= AML_UART_BAUD_XTAL; } else { val = ((port->uartclk * 10 / (baud * 4) + 5) / 10) - 1; } val |= AML_UART_BAUD_USE; writel(val, port->membase + AML_UART_REG5); }
  3. Yes, snd_usb_audio is what I used the last years, thank you. But now the plan is a dedicated Armbian-SBC with UART midi input and stereo analog audio output for the best possible piano latency.
  4. The Odroid N2+ has a serial port, that I would like to use for MIDI input. At the moment this is impossible, because MIDI requires 31250 baud, but Armbian - like the most other OS - supports only standard rates like 38400 baud. On my Armbian Buster current it is /dev/ttyAML1 at pin 8 and 10 of the 40-pin J2. It has 9600 baud per default and I can exchange serial data with my Laptop (minicom, usb-to-serial, /dev/ttyUSB0). Fine to this point. But how to change the baudrate to the 31250? I found a nice hack for hardkernels legacy Ubuntu, where the meson_uart.c is patched that it works actually with 31250 baud when 38400 baud is selected. Odroid N2 UART Custom Baud Rate for MIDI Just for demonstration: ... static void meson_uart_change_speed(struct uart_port *port, unsigned long baud) { u32 val; struct meson_uart_port *mup = to_meson_port(port); struct platform_device *pdev = to_platform_device(port->dev); while (!(readl(port->membase + AML_UART_STATUS) & AML_UART_TX_EMPTY)) cpu_relax(); #ifdef UART_TEST_DEBUG if (port->line != 0) baud = 115200; #endif // this part is added. // trace_printk() is not neccesarry, it is just for debugging. trace_printk("Your baudrate: %ld\n", baud); if(baud == 38400) { baud = 31250; trace_printk("Change to %ld\n", baud); } ... But I can't find similar code in my build of Armbian Buster current: ~/build/cache/sources/linux-mainline/linux-5.10.y/drivers/tty/serial/meson_uart.c --> https://pastebin.com/raw/gEJt1reB Will it be impossible to hack the meson_uart.c in Armbian, that it supports "baud = 31250"? My serial/UART in dmesg: [...] [ 0.943915] soc soc0: Amlogic Meson G12B (S922X) Revision 29:c (40:2) Detected [...] [ 0.945359] VCC_3V3: supplied by VDDAO_3V3 [ 0.945394] FLASH_1V8: supplied by VCC_3V3 [ 0.945423] VCC_1V8: supplied by VCC_3V3 [ 0.945450] VDDAO_1V8: supplied by VDDAO_3V3 [ 0.945494] VDDCPU_A: supplied by regulator-dummy [ 0.945917] VDDCPU_B: supplied by regulator-dummy [ 0.946680] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled [ 0.949136] Serial: AMBA driver [ 0.949436] ff803000.serial: ttyAML0 at MMIO 0xff803000 (irq = 25, base_baud = 1500000) is a meson_uart [ 0.949552] printk: console [ttyAML0] enabled [ 0.950111] ffd24000.serial: ttyAML1 at MMIO 0xffd24000 (irq = 33, base_baud = 1500000) is a meson_uart [...] It is Armbian 21.08.0-trunk Buster with Linux 5.10.32-meson64. My C-programming is more than limited, sorry, but I can compile a linux kernel or Armbian image if needed. Serial MIDI-input with an Armbian powered N2+ would be a dream machine! Kind regards
  5. Hello forum, I am new to Armbian. Selected it for my Odroid N2+ because I need high CPU performance for a virtual piano software and current Armbian Buster comes with 2.4 GHz. I'd like to share my alsa settings for the analog stereo output of the N2+. Could not find much info on the net, but at least I have analog sound now at the 3.5mm TRS-jack -- don't know really, why it works, but it does Created a /etc/asound.conf with pcm.!default { type plug slave { pcm "hw:0,1" } } (sets analog stereo device as default). The alsamixer settings I made manually. The following is the output of the command amixer: Simple mixer control 'ACODEC',0 Capabilities: pvolume pswitch pswitch-joined Playback channels: Front Left - Front Right Limits: Playback 0 - 255 Mono: Front Left: Playback 222 [87%] [-12.33dB] [on] Front Right: Playback 222 [87%] [-12.33dB] [on] Simple mixer control 'ACODEC Left DAC Sel',0 Capabilities: enum Items: 'Left' 'Right' Item0: 'Left' Simple mixer control 'ACODEC Mute Ramp',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [off] Simple mixer control 'ACODEC Playback Channel Mode',0 Capabilities: enum Items: 'Stereo' 'Mono' Item0: 'Stereo' Simple mixer control 'ACODEC Ramp Rate',0 Capabilities: enum Items: 'Fast' 'Slow' Item0: 'Fast' Simple mixer control 'ACODEC Right DAC Sel',0 Capabilities: enum Items: 'Right' 'Left' Item0: 'Right' Simple mixer control 'ACODEC Unmute Ramp',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [off] Simple mixer control 'FRDDR_A SINK 1 SEL',0 Capabilities: enum Items: 'OUT 0' 'OUT 1' 'OUT 2' 'OUT 3' 'OUT 4' 'OUT 5' 'OUT 6' 'OUT 7' Item0: 'OUT 1' Simple mixer control 'FRDDR_A SINK 2 SEL',0 Capabilities: enum Items: 'OUT 0' 'OUT 1' 'OUT 2' 'OUT 3' 'OUT 4' 'OUT 5' 'OUT 6' 'OUT 7' Item0: 'OUT 0' Simple mixer control 'FRDDR_A SINK 3 SEL',0 Capabilities: enum Items: 'OUT 0' 'OUT 1' 'OUT 2' 'OUT 3' 'OUT 4' 'OUT 5' 'OUT 6' 'OUT 7' Item0: 'OUT 0' Simple mixer control 'FRDDR_A SRC 1 EN',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'FRDDR_A SRC 2 EN',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [off] Simple mixer control 'FRDDR_A SRC 3 EN',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [off] Simple mixer control 'FRDDR_B SINK 1 SEL',0 Capabilities: enum Items: 'OUT 0' 'OUT 1' 'OUT 2' 'OUT 3' 'OUT 4' 'OUT 5' 'OUT 6' 'OUT 7' Item0: 'OUT 2' Simple mixer control 'FRDDR_B SINK 2 SEL',0 Capabilities: enum Items: 'OUT 0' 'OUT 1' 'OUT 2' 'OUT 3' 'OUT 4' 'OUT 5' 'OUT 6' 'OUT 7' Item0: 'OUT 0' Simple mixer control 'FRDDR_B SINK 3 SEL',0 Capabilities: enum Items: 'OUT 0' 'OUT 1' 'OUT 2' 'OUT 3' 'OUT 4' 'OUT 5' 'OUT 6' 'OUT 7' Item0: 'OUT 0' Simple mixer control 'FRDDR_B SRC 1 EN',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'FRDDR_B SRC 2 EN',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [off] Simple mixer control 'FRDDR_B SRC 3 EN',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [off] Simple mixer control 'FRDDR_C SINK 1 SEL',0 Capabilities: enum Items: 'OUT 0' 'OUT 1' 'OUT 2' 'OUT 3' 'OUT 4' 'OUT 5' 'OUT 6' 'OUT 7' Item0: 'OUT 3' Simple mixer control 'FRDDR_C SINK 2 SEL',0 Capabilities: enum Items: 'OUT 0' 'OUT 1' 'OUT 2' 'OUT 3' 'OUT 4' 'OUT 5' 'OUT 6' 'OUT 7' Item0: 'OUT 0' Simple mixer control 'FRDDR_C SINK 3 SEL',0 Capabilities: enum Items: 'OUT 0' 'OUT 1' 'OUT 2' 'OUT 3' 'OUT 4' 'OUT 5' 'OUT 6' 'OUT 7' Item0: 'OUT 0' Simple mixer control 'FRDDR_C SRC 1 EN',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'FRDDR_C SRC 2 EN',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [off] Simple mixer control 'FRDDR_C SRC 3 EN',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [off] Simple mixer control 'TDMIN_A SRC SEL',0 Capabilities: enum Items: 'IN 0' 'IN 1' 'IN 2' 'IN 3' 'IN 4' 'IN 5' 'IN 6' 'IN 7' 'IN 8' 'IN 9' 'IN 10' 'IN 11' 'IN 12' 'IN 13' 'IN 14' 'IN 15' Item0: 'IN 0' Simple mixer control 'TDMIN_B SRC SEL',0 Capabilities: enum Items: 'IN 0' 'IN 1' 'IN 2' 'IN 3' 'IN 4' 'IN 5' 'IN 6' 'IN 7' 'IN 8' 'IN 9' 'IN 10' 'IN 11' 'IN 12' 'IN 13' 'IN 14' 'IN 15' Item0: 'IN 0' Simple mixer control 'TDMIN_C SRC SEL',0 Capabilities: enum Items: 'IN 0' 'IN 1' 'IN 2' 'IN 3' 'IN 4' 'IN 5' 'IN 6' 'IN 7' 'IN 8' 'IN 9' 'IN 10' 'IN 11' 'IN 12' 'IN 13' 'IN 14' 'IN 15' Item0: 'IN 0' Simple mixer control 'TDMIN_LB SRC SEL',0 Capabilities: enum Items: 'IN 0' 'IN 1' 'IN 2' 'IN 3' 'IN 4' 'IN 5' 'IN 6' 'IN 7' 'IN 8' 'IN 9' 'IN 10' 'IN 11' 'IN 12' 'IN 13' 'IN 14' 'IN 15' Item0: 'IN 0' Simple mixer control 'TDMOUT_B Gain Enable',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [off] Simple mixer control 'TDMOUT_B Lane 0',0 Capabilities: volume Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 255 Front Left: 0 [0%] Front Right: 0 [0%] Simple mixer control 'TDMOUT_B Lane 1',0 Capabilities: volume Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 255 Front Left: 0 [0%] Front Right: 0 [0%] Simple mixer control 'TDMOUT_B Lane 2',0 Capabilities: volume Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 255 Front Left: 0 [0%] Front Right: 0 [0%] Simple mixer control 'TDMOUT_B Lane 3',0 Capabilities: volume Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 255 Front Left: 0 [0%] Front Right: 0 [0%] Simple mixer control 'TDMOUT_B SRC SEL',0 Capabilities: enum Items: 'IN 0' 'IN 1' 'IN 2' Item0: 'IN 0' Simple mixer control 'TDMOUT_C Gain Enable',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [off] Simple mixer control 'TDMOUT_C Lane 0',0 Capabilities: volume Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 255 Front Left: 0 [0%] Front Right: 0 [0%] Simple mixer control 'TDMOUT_C Lane 1',0 Capabilities: volume Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 255 Front Left: 0 [0%] Front Right: 0 [0%] Simple mixer control 'TDMOUT_C Lane 2',0 Capabilities: volume Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 255 Front Left: 0 [0%] Front Right: 0 [0%] Simple mixer control 'TDMOUT_C Lane 3',0 Capabilities: volume Playback channels: Front Left - Front Right Capture channels: Front Left - Front Right Limits: 0 - 255 Front Left: 0 [0%] Front Right: 0 [0%] Simple mixer control 'TDMOUT_C SRC SEL',0 Capabilities: enum Items: 'IN 0' 'IN 1' 'IN 2' Item0: 'IN 1' Simple mixer control 'TOACODEC Lane Select',0 Capabilities: volume volume-joined Playback channels: Mono Capture channels: Mono Limits: 0 - 3 Mono: 0 [0%] Simple mixer control 'TOACODEC OUT EN',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'TOACODEC SRC',0 Capabilities: enum Items: 'I2S A' 'I2S B' 'I2S C' Item0: 'I2S C' Simple mixer control 'TODDR_A SRC SEL',0 Capabilities: enum Items: 'IN 0' 'IN 1' 'IN 2' 'IN 3' 'IN 4' 'IN 5' 'IN 6' 'IN 7' Item0: 'IN 0' Simple mixer control 'TODDR_B SRC SEL',0 Capabilities: enum Items: 'IN 0' 'IN 1' 'IN 2' 'IN 3' 'IN 4' 'IN 5' 'IN 6' 'IN 7' Item0: 'IN 0' Simple mixer control 'TODDR_C SRC SEL',0 Capabilities: enum Items: 'IN 0' 'IN 1' 'IN 2' 'IN 3' 'IN 4' 'IN 5' 'IN 6' 'IN 7' Item0: 'IN 0' Simple mixer control 'TOHDMITX',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'TOHDMITX I2S SRC',0 Capabilities: enum Items: 'I2S A' 'I2S B' 'I2S C' Item0: 'I2S B' Simple mixer control 'TOHDMITX SPDIF SRC',0 Capabilities: enum Items: 'SPDIF A' 'SPDIF B' Item0: 'SPDIF A' System: Armbian 21.02.4 Buster with Linux 5.10.27-meson64 Great project! Thank you all!
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines