Wednesday, November 06, 2013

Kernel 3.12 Radeon DPM support

1. installed 3.12 on Ubuntu 12.04 using this:

http://lintut.com/how-to-install-kernel-3-12-final-release-on-3264-bit-ubuntu-linux-mint-and-debian-linux/
wget -c kernel.ubuntu.com/~kernel-ppa/mainline/v3.12-saucy/linux-headers-3.12.0-031200-generic_3.12.0-031200.201311031935_amd64.deb
wget -c kernel.ubuntu.com/~kernel-ppa/mainline/v3.12-saucy/linux-image-3.12.0-031200-generic_3.12.0-031200.201311031935_amd64.deb
wget -c kernel.ubuntu.com/~kernel-ppa/mainline/v3.12-saucy/linux-headers-3.12.0-031200_3.12.0-031200.201311031935_all.deb
sudo dpkg -i linux-headers-3.12*.deb linux-image-3.12*.deb
 
  
diego@ruidosa:~$ uname -r
3.12.0-031200-generic


 2. enabled Radeon DPM support using kernel parms:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.dpm=1"
sudo update-grub

3. downloaded new AMD firmware from here:

people.freedesktop.org/~agd5f/radeon_ucode/

diego@ruidosa:~$ cd radeon/
diego@ruidosa:~/radeon$ ls *.bin
RV710_uvd.bin  RV730_smc.bin


4. copied this files to /lib/firmware/radeon:

 diego@ruidosa:~/radeon$ ls /lib/firmware/radeon/RV7*
/lib/firmware/radeon/RV710_me.bin   /lib/firmware/radeon/RV710_uvd.bin  /lib/firmware/radeon/RV730_pfp.bin  /lib/firmware/radeon/RV770_me.bin
/lib/firmware/radeon/RV710_pfp.bin  /lib/firmware/radeon/RV730_me.bin   /lib/firmware/radeon/RV730_smc.bin  /lib/firmware/radeon/RV770_pfp.bin


5. reboot


6. check dmseg:

diego@ruidosa:~/radeon$ dmesg | grep radeon
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.12.0-031200-generic root=UUID=28c7f0a9-f910-4aac-9c20-478055dac758 ro quiet splash radeon.dpm=1 vt.handoff=7
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.12.0-031200-generic root=UUID=28c7f0a9-f910-4aac-9c20-478055dac758 ro quiet splash radeon.dpm=1 vt.handoff=7
[   12.913107] [drm] radeon kernel modesetting enabled.
[   12.916385] radeon 0000:01:00.0: VRAM: 1024M 0x0000000000000000 - 0x000000003FFFFFFF (1024M used)
[   12.916388] radeon 0000:01:00.0: GTT: 1024M 0x0000000040000000 - 0x000000007FFFFFFF
[   12.924061] [drm] radeon: 1024M of VRAM memory ready
[   12.924063] [drm] radeon: 1024M of GTT memory ready.
[   13.341936] radeon 0000:01:00.0: WB enabled
[   13.341941] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000040000c00 and cpu addr 0xffff8800b6029c00
[   13.341944] radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000040000c0c and cpu addr 0xffff8800b6029c0c
[   13.342733] radeon 0000:01:00.0: fence driver on ring 5 use gpu addr 0x000000000005c598 and cpu addr 0xffffc9000521c598
[   13.342768] radeon 0000:01:00.0: irq 48 for MSI/MSI-X
[   13.342785] radeon 0000:01:00.0: radeon: using MSI.
[   13.342817] [drm] radeon: irq initialized.
[   23.691263] [drm:rv770_startup] *ERROR* radeon: failed initializing UVD (-1).
[   23.716039] [drm] radeon atom DIG backlight initialized
[   23.722646] [drm] radeon: dpm initialized
[   24.715909] fbcon: radeondrmfb (fb0) is primary device
[   24.775539] radeon 0000:01:00.0: fb0: radeondrmfb frame buffer device
[   24.775542] radeon 0000:01:00.0: registered panic notifier
[   24.775554] [drm] Initialized radeon 2.34.0 20080528 for 0000:01:00.0 on minor 0



diego@ruidosa:~$ sudo cat /sys/kernel/debug/dri/64/radeon_pm_info
uvd    vclk: 0 dclk: 0
power level 0    sclk: 22000 mclk: 40000 vddc: 1000
diego@ruidosa:~$
diego@ruidosa:~$ cat /sys/class/drm/card0/device/power_dpm_state
balanced



This works also for kernel 3.11.
I've tested it using a 3.11 kernel compiled by me.



References:

http://askubuntu.com/questions/324733/how-to-enable-the-radeon-dynamic-power-management-feature-in-ubuntu-13-04

http://www.phoronix.com/scan.php?page=news_item&px=MTQyNDE


 

Tuesday, January 29, 2013


Controlling Linux audio plugins using touchOSC for Android


I was thinking to control some of the audio plugins that I have on my linux machine using an Android OEM tablet sending OSC messages to the PC.

My first attempt was to use some of the existing OSC apps that are available on Google Play such as:

1. touchOSC for Android: I was very impressed for nice GUIs included in the app and the responsiveness on the tablet, but I was realized that at the moment (January 2013) there no was a way to create customized layouts and synchronize them easily, such as in touchOSC for iPad/Iphone.
2. Control: very promise app but for some reason I cannot run it smoothly in my tablet, it just goes incredible slow.
3. quickOSC: very promise app also, and some that I was looking for since It permit modify the OSC path!. Unfortunately every time that I selected a button or an slider an "Error sending message" appeared that forbid me to send OSC messages to the host.

Frustrated, I dropped this idea for some while...

Just a few weeks I restarted this idea, searching again on the touchOSC site and I reached the touchOSC editor and one app (OSCPad) that allowed me to load the edited layout. It was very promising but I realized that OSCPad still has some to-do features yet that allowed me to control plugins in a more flexible way.

I found then this handy page that explains some hacks to do on the touchOSC apk to include the modified layout in the apk before it gets installed in Android.

So, at that moment I had a way to create a custom layout, creating custom knobs, sliders and buttons trying to emulate the plugin on the linux machine.

After some tests, I realized that I was able to create a custom layout BUT incredible, the OSC path for that new layout was NOT updated, just sending the one that is included by default in the touchOSC Editor, not the one that I modified in order to match the OSC Path on the host running on the PC.

One note aside for the plugin host:

In my first attempt, I tried to control the plugin just sending direct OSC messages to a DSSI plugin running jack-dssi-host; my intention was to send OSC control messages to the UDP port that is initialized when the plugin is started:

jack-dssi-host /usr/lib/dssi/nekobee.so

jack-dssi-host: OSC URL is:
osc.udp://ruidosa:10409/dssi//usr/lib/dssi/nekobee/nekobee/chan00

host: Ready
nekobee_gtk starting (pid 3276)...


In this case the UDP port is 10409.

The first attempts to send OSC messages using 'oscsend', 'oscdump' from liblo and 'dssi_osc_send', 'dssi_osc_update' were satisfactory showing that was possible to modify the parameter sending control messages to the DSSI host.
One thing that I realized is that the plugin GUI was not updated after parameter modification, since the normal operation is the opposite of this, you just control the GUI and send OSC messages to the DSSI plugin engine.

Then, thanks to LAU/LAD lists (Robin Gareus, Michael Noble, among others, thank you very much!), I've found the Cadence/Carla software application that allowed me to host any type of plugin, not only DSSI, but LADSPA, LV2, VST, and of course DSSI, controlling them using a OSC Path customized for every plugin, as indicated in the Carla 'Help' tab:



I just need to translate the OSC messages that I was receiving from the custom layout (but with the default OSC Path) in Android to the Carla OSC commands to control the plugin.

This is where PD comes in action. The main idea was to receive in some port the UDP messages from touchOSC in android, translate them to the Carla nomenclature and send to Carla host using its UDP port.

I must say that I'm not an PD expert so it take me some time to understand how to do that. After some test I was able to understand the OSC functionality in PD and I was able to create this patch:



This patch receive OSC messages in UDP port 9001 from touchOSC, route and translate the messages using routeOSC object and send them to Carla.

The whole idea as a test case was to control Nekobee plugin (TB303 emulator) on Carla using a touchOSC custom layout in android translating the OSC messages in PD.











 Links to files:

touchOSC Layout Editor
touchOSC Layout Encoder
touchOSC Custom Layout to control Nekobee
PD Translator Patch
Nekobee GIT
Cadence GIT