It seems to be relatively a simple question. I have two mount points on bacula-sd (storage) server- one for local drive and one for s3 bucket (off side backup) and what I need is start two concurrent job at the same time on both drives. So far I have something like that in bacula devices.conf
Device {
Name = "example.prod.com"
Device Type = File
Media Type = File
Archive Device = "/data/bacula/example.prod.com"
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
Maximum Network Buffer Size = 65536
}
Device {
Name = example.prod.com-s3
Device Type = File
Media Type = File
Archive Device = "/mnt/bacula-backup-storage/example.prod.com-s3"
LabelMedia = yes
Random Access = Yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
Maximum Network Buffer Size = 65536
}
but it's probably not enough because the job started only on the first device. Do I need disk autochanger or something?
You have to change Media Type = ... parameter to be different for both Devices, i.e.
Device {
Name = "example.prod.com"
Device Type = File
Media Type = File
...
}
Device {
Name = example.prod.com-s3
Device Type = File
Media Type = S3
...
}
It won't work otherwise.
I'm using NAudio to output audio files to both the speaker and a headset on a window 10 laptop. I created two WaveOut and assigned the corresponding device number. But I cannot here the audio from the speaker when the headset is plugged in. Can anyone let me know how to solve this? Here's my code (it works fine on the headset or the speaker separately, but I want to hear the sound from both of them at the same time):
var input1 = new Mp3FileReader(PATH + "left.mp3");
var input2 = new Mp3FileReader(PATH + "right.mp3");
var waveProvider = new MultiplexingWaveProvider(new IWaveProvider[] { input1, input2 }, 2);
var input3 = new Mp3FileReader(PATH + "left.mp3");
int channel = ((Mp3FileReader)input1).Mp3WaveFormat.Channels;
Debug.WriteLine(channel);
waveProvider.ConnectInputToOutput(0, 0);
waveProvider.ConnectInputToOutput(3, 1);
WaveOut wave = new WaveOut();
wave.DeviceNumber = 1;
wave.Init(waveProvider);
WaveOut wave1 = new WaveOut();
wave1.DeviceNumber = 0;
wave1.Init(input3);
wave.Play();
wave1.Play();
I think the issue is that you don't have two soundcards, you have one soundcard that is switching between playing sound out of the speakers and headphones. If you bought a USB headset then you'd have two soundcards, and should be able to play different sounds through each one separately.
I'm not very familiar with Swift/Objective-C or the Cocoa environment and I've been having a lot of trouble figuring out how to send or listen for data from a USB device with CoreMIDI. I'm trying to send the message (144, 36, 5) to my MIDI controller (an Ableton Push) which I have accomplished before using the Bitwig Studio Scripting API. I haven't been able to find much on this other than Apple's docs and they haven't been particularly helpful for me. So far I've figured out how to get a list of devices and check out their names, but beyond that I'm stuck.
What I've written so far trying to send MIDI:
var pushDevice = MIDIGetDevice(2)
var secondEntity = MIDIDeviceGetEntity(pushDevice, 1)
var pushDestination = MIDIEntityGetDestination(secondEntity, 0)
var midiPort = MIDIPortRef()
let myData : [Byte] = [ Byte(144), Byte(36), Byte(5) ]
var packet = UnsafeMutablePointer<MIDIPacket>.alloc(1)
var pkList = UnsafeMutablePointer<MIDIPacketList>.alloc(1)
packet = MIDIPacketListInit(pkList)
packet = MIDIPacketListAdd(pkList, 1024, packet, 0, 3, myData)
MIDISend(midiPort, pushDestination, pkList)
I feel like a bit of a goof for not being able to figure this out, I imagine it has to be a simple solution that I'm just not able to figure out for some reason. I don't think I'm properly constructing the MIDIPacketList or the MIDIPort, and I have no idea how to go about creating a callback and listening for MIDI messages.
I figured out how to send MIDI data by grabbing the device via it's unique ID. I'm not sure how memory management works in Swift, so keep that in mind. I will check back in later if I figure out how to properly create a callback and listen for MIDI input.
import Foundation
import CoreMIDI
var midiClient = MIDIClientRef()
var result = MIDIClientCreate("Foo Client", nil, nil, &midiClient)
var outputPort = MIDIPortRef()
result = MIDIOutputPortCreate(midiClient, "Output", &outputPort);
var endPoint = MIDIObjectRef()
var foundObj = MIDIObjectType()
result = MIDIObjectFindByUniqueID(UNIQUE_ID, &endPoint, &foundObj)
var pkt = UnsafeMutablePointer<MIDIPacket>.alloc(1)
var pktList = UnsafeMutablePointer<MIDIPacketList>.alloc(1)
let midiData : [Byte] = [Byte(144), Byte(36), Byte(5)]
pkt = MIDIPacketListInit(pktList)
pkt = MIDIPacketListAdd(pktList, 1024, pkt, 0, 3, midiData)
MIDISend(outputPort, endPoint, pktList)
How do I configure the UART's in the OLinuXino Lime using a DTB file? I'm using the image from http://eewiki.net/display/linuxonarm/A10-OLinuXino-LIME.
UART 0 is already configured. This is the relevant part from the DTS file, if I understand correctly:
uart0: serial#01c28000 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins_a>;
status = "okay";
};
From http://linux-sunxi.org/Memory_map I can get the memory space for the other UART's. But where do I get the syntax for the pinctrl-0 field, for instance?
Can we configure the hardware with the DTB file only with no need for Allwinner's FEX file?
In an "ideal" situation, should the DTB files be configured by the hardware manufacturer or should they be configured by the developer (is there a manual)?
We can either use Allwinner's FEX file or Open Firmware's Device Tree (DT).
Add these lines to the DT source file (DTS) and compile with dtc.
uart2: serial#01c28800 {
pinctrl-names = "default";
pinctrl-0 = <&uart2_pins_a>;
status = "okay";
};
I am having trouble with AutoIt's DLLCall.
I am trying to control a Delcom USB Indicator LED Light using AutoIT. To do this, I have a .dll which includes the following functions:
DelcomGetDeviceCount: returns the number of Delcom USB devices
DelcomGetNthDevice: searches for specified device type, gets string of device name
DelcomOpenDevice: takes device name and returns handle to the USB device
DelcomLEDControl: takes USB handle, sets state of the LED
Here is a link to the documentation on these DLL functions.
I think my problem is not formatting the pointer to the device name correctly, because my call to DelcomGetNthDevice returns 0, failure to find device, even though I detect one device using DelcomGetDeviceCount.
I have tried
Local $handleDLL = DLLOpen("C:\DelcomDLL.dll")
Local $stString = DllStructCreate("wchar Name[512]")
Local $devices = DllCall($handleDLL,"dword","DelcomGetDeviceCount","dword",0)
Local $result = DllCall($handleDLL,"dword","DelcomGetNthDevice","dword",1,"dword",0,"ptr",DllStructGetPtr($stString))
Local $handleUSB = DllCall($handleDLL,"handle","DelcomOpenDevice","str",DllStructGetData($stString,"Name"),"dword",0)
Local $result2 = DllCall($handleDLL,"dword","DelcomLEDControl","handle",$handleUSB[0],"dword",0,"dword",1)
MsgBox(0,"# of Devices",$devices[0])
MsgBox(0,"Bool Found Device",$result[0])
DllClose($handleDLL)
and
Local $handleDLL = DLLOpen("C:\Users\b46020\Documents\Asher Project\DelcomDLL.dll")
Local $stString
Local $devices = DllCall($handleDLL,"dword","DelcomGetDeviceCount","dword",0)
Local $result = DllCall($handleDLL,"dword","DelcomGetNthDevice","dword",1,"dword",0,"str*",$stString)
Local $handleUSB = DllCall($handleDLL,"handle","DelcomOpenDevice","str*",$stString,"dword",0)
Local $result2 = DllCall($handleDLL,"dword","DelcomLEDControl","handle",$handleUSB[0],"dword",0,"dword",1)
MsgBox(0,"# of Devices",$devices[0])
MsgBox(0,"Bool Found Device",$result[0])
DllClose($handleDLL)
but in each case I turn up 1 device but cannot get its name.
I would greatly appreciate your help.
Thanks,
Jonathan
Solved it:
Local $handleDLL = DllOpen("C:\DelcomDLL.dll")
$strName = DllStructCreate("char Name[512]")
$ptrName = DllStructGetPtr($strName)
Local $result = DllCall($handleDLL, "dword", "DelcomGetNthDevice", "dword", 0, "dword", 0, "ptr", $ptrName)
Local $handleUSB = DllCall($handleDLL, "handle", "DelcomOpenDevice", "str", DllStructGetData($strName, "Name"), "dword", 0)
Local $result2 = DllCall($handleDLL, "dword", "DelcomLEDControl", "handle", $handleUSB[0], "dword", $color, "dword", $state)
Local $closed = DllCall($handleDLL,"dword","DelcomCloseDevice","handle",$handleUSB[0])
DllClose($handleDLL)