Control Video input/ Visualization with Volume and BPM - audio
i build something like automatic VJ program . I have 2 incomig videos signals from 2 webcams and a couple of visualisations(at the moment 2 but i want more). I have a volume in dB of incoming audio signal and bpm of it as a nummbers. What I need is a routing/switchig of video output. For example: if am bpm number changes more then 20-30 bpm then changes a a visualisation or a webcam from first to second. And the same with volume. I would be happy about a quick and dirty solution, please.
Can someone halp me? Thank you.
----------begin_max5_patcher----------
7461.3oc6cktjiibb92ihPuCvcr+XkTOXq6CaMJ1iPgB8CYYGirb3XshIPSB
1M1EjfKH3LyJIOOM9MwuXtN.AAXCBTfDE.mQ6HscSV.jcUeHyrxLq73u8y+Y
u3tGxde7t6B9mC91fW7h+lZjWXFSOxKNLvKtacz6WjFsybi2sKMYYb9c2Wds
2FkuIZcbaWZaTwhmR173axiWTX+ivjjPBiBIx6CnHRn.hQXz8APfLDbe.hFB
B9KG976J9wT6Wb0WY19hz3hhebar866t6Nd6aixUSjh372DuI5A6mDd3ha1u
NYi5itqwnqRyhJTema2WzX7r7j3MEQEIYaN8awNCZ90jrzLKyd36dIlUMW2k
7WsyA0J6vPQuMd4ahJJxSdXeQ7wWsqDwO.4ZbMceb1pCiWcg5qyzrMOdFvuw
8s6or7BWtwC.KtsKlr4sI6RN.rk2v+yO+mYe0gWT9a0ut2YRJMLrOoB3Jhee
wadWxxhmzWkgNhesQQwngxCTTbbHDQfD1QJJ7UPQcFhlrMEUOawGmb5Ug469
8qhVFeW8auB6+p7jnz6F.4D8tKFU2D+N0WQCT0L92kTD1bJ1Crx.7Ph.xDFl
VCpxFJpp9i9l0QJp82e28mGiQshw0H.bFLQs.lPjmPyrsAeo5+9U5+WWfpD.
znGQPBYb.WSlJYSBd5B3PtbvQCBaeWxlkYuqq0ODAfgT0hFiT..gxfpkNQKe
TwH0fQ84bkMWkOjkqjgsHKMK2dCfPNkIX36UuRQzBP0dAr92b67zayi2cPhe
8IL.adfYXyUOkLD+vlOs5GZkD+P18Xdz1mB9xkIqCvHfFccA7EDhA70XN0mD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Yvi6P9Xk.fmQZNWHNQR8gQ7If6lWJwyvwoAcSUR3bL
0.9hV.YqrzbQs5yAVy40xHRxozKki3S5Em2yXParWO5XpELMPLuw9C1w83xC
HbtfvLwmpFvQF0YPQB2hmG4L3hL.ZjT.e7mYtwHwF9lIBk.DHiqs2gwrAjGx
FXdm7VpoT4FHr8I0SdGDXMkFWUCZMC4SVOmieuKmyqrLaEsc6aiy2U9UamS2
sN56rUAY9812mrw9d627c4w5V8dVsSx4tn7EOkTDunXetsVh8dVYK08t0YKi
y2r2zpGgpQJaOgmzmKKAoic8dc6n30l1N+a9CGqG1mzcK+aOuvE+rdaXUke1
d4pFR3I05YhRiKSAVVIoEYK5xpWnE2Bq0hFOoCSRIRcMnsQGlTfvTS0dFb5m
6B5pjmoMPd1R3r5SzZcatd6V79Czis1aNOoub1jFt5wySwoaUPd7aRidHNsp
ljdlGOmzzQaXci9ZG9ZUj1eUdRiRyrtV+03IEsDmZ6UGaEoizxzV3U+5z8w8
sDaokohgbFwzyTYUzIR8P9alZpqiWvTsq5T93OKOoP15FQyy5TsWZWp0GKEz
G2KES6OTWA+u.RGMAMvHKiJQPpYJC8F+3wYJ51Ylp+jpe8+CEEBF8
-----------end_max5_patcher-----------
Related
How do I in FloPy Modflow6 output MAW head values for all timesteps?
I am creating a MAW well and want to use it as an observation well to compare it later to field data, it should be screened over multiple layers. However, I am only getting the head value in the well of the very last timestep in my output file. Any ideas on how to get all timesteps in the output? The FloPy manual says something about it needing to be in Output Control, but I can't figure out how to do that: print_head (boolean) – print_head (boolean) keyword to indicate that the list of multi-aquifer well heads will be printed to the listing file for every stress period in which “HEAD PRINT” is specified in Output Control. If there is no Output Control option and PRINT_HEAD is specified, then heads are printed for the last time step of each stress period. In the MODFLOW6 manual I see that it is possible to make a continuous output: modflow6 My MAW definition looks like this: maw = flopy.mf6.ModflowGwfmaw(gwf, nmawwells=1, packagedata=[0, Rwell, minbot, wellhead,'MEAN',OBS1welllayers], connectiondata=OBS1connectiondata, perioddata=[(0,'STATUS','ACTIVE')], flowing_wells=False, save_flows=True, mover=True, flow_correction=True, budget_filerecord='OBS1wellbudget', print_flows=True, print_head=True, head_filerecord='OBS1wellhead', ) My output control looks like this: oc = flopy.mf6.ModflowGwfoc(gwf, budget_filerecord=budget_file, head_filerecord=head_file, saverecord=[('HEAD', 'ALL'), ('BUDGET', 'ALL'), ], ) Hope this is all clear and someone can help me, thanks!
You need to initialise the MAW observations file... it's not done in the OC package. You can find the scripts for the three MAW examples in the MF6 documentation here: https://github.com/MODFLOW-USGS/modflow6-examples/tree/master/notebooks It looks something like this: obs_file = "{}.maw.obs".format(name) csv_file = obs_file + ".csv" obs_dict = {csv_file: [ ("head", "head", (0,)), ("Q1", "maw", (0,), (0,)), ("Q2", "maw", (0,), (1,)), ("Q3", "maw", (0,), (2,)), ]} maw.obs.initialize(filename=obs_file, digits=10, print_input=True, continuous=obs_dict)
Pull random results from a database?
I have been coding in Python for a 2 months or so, but I mostly ask for help from a more experienced friend when I run in to these kinds of issues. I should also, before I begin, specify that I use Python solely for a personal project; any questions I ask will relate to each other through that. With those two things out of the way, I have a database of weaponry items that I created using the following script, made in Python 3.X: #Start by making a list of every material, weapontype, and upgrade. Materials=("Unobtanium","IvorySilk","BoneLeather","CottonWood","Tin","Copper","Bronze","Gold","Cobalt","Tungsten") WeaponTypes=("Knife","Sword","Greatsword","Polearm","Battlestaff","Claw","Cane","Wand","Talis","Slicer","Rod","Bow","Crossbow","Handbow","Pistol","Mechgun","Rifle","Shotgun") Upgrades=("0","1","2","3","4","5","6","7","8","9","10") ForgeWInputs=[] #Go through every material... for m in Materials: #And in each material, go through every weapontype... for w in WeaponTypes: #And in every weapontype, go through each upgrade... for u in Upgrades: ForgeWInputs.append((m,w,u)) #We now have a list "ForgeWInputs", which contains the 3-element list needed to #Forge any weapon. For example... MAT={} MAT["UnobtaniumPD"]=0 MAT["UnobtaniumMD"]=0 MAT["UnobtaniumAC"]=0 MAT["UnobtaniumPR"]=0 MAT["UnobtaniumMR"]=0 MAT["UnobtaniumWT"]=0 MAT["UnobtaniumBuy"]=0 MAT["UnobtaniumSell"]=0 MAT["IvorySilkPD"]=0 MAT["IvorySilkMD"]=12 MAT["IvorySilkAC"]=3 MAT["IvorySilkPR"]=0 MAT["IvorySilkMR"]=3 MAT["IvorySilkWT"]=6 MAT["IvorySilkBuy"]=10 MAT["IvorySilkSell"]=5 MAT["CottonWoodPD"]=8 MAT["CottonWoodMD"]=8 MAT["CottonWoodAC"]=5 MAT["CottonWoodPR"]=0 MAT["CottonWoodMR"]=3 MAT["CottonWoodWT"]=6 MAT["CottonWoodBuy"]=14 MAT["CottonWoodSell"]=7 MAT["BoneLeatherPD"]=12 MAT["BoneLeatherMD"]=0 MAT["BoneLeatherAC"]=3 MAT["BoneLeatherPR"]=3 MAT["BoneLeatherMR"]=0 MAT["BoneLeatherWT"]=6 MAT["BoneLeatherBuy"]=10 MAT["BoneLeatherSell"]=5 MAT["TinPD"]=18 MAT["TinMD"]=6 MAT["TinAC"]=3 MAT["TinPR"]=5 MAT["TinMR"]=2 MAT["TinWT"]=12 MAT["TinBuy"]=20 MAT["TinSell"]=10 MAT["CopperPD"]=6 MAT["CopperMD"]=18 MAT["CopperAC"]=3 MAT["CopperPR"]=2 MAT["CopperMR"]=5 MAT["CopperWT"]=12 MAT["CopperBuy"]=20 MAT["CopperSell"]=10 MAT["BronzePD"]=10 MAT["BronzeMD"]=10 MAT["BronzeAC"]=5 MAT["BronzePR"]=3 MAT["BronzeMR"]=3 MAT["BronzeWT"]=15 MAT["BronzeBuy"]=30 MAT["BronzeSell"]=15 MAT["GoldPD"]=10 MAT["GoldMD"]=30 MAT["GoldAC"]=0 MAT["GoldPR"]=5 MAT["GoldMR"]=10 MAT["GoldWT"]=25 MAT["GoldBuy"]=50 MAT["GoldSell"]=25 MAT["CobaltPD"]=30 MAT["CobaltMD"]=10 MAT["CobaltAC"]=0 MAT["CobaltPR"]=10 MAT["CobaltMR"]=0 MAT["CobaltWT"]=25 MAT["CobaltBuy"]=50 MAT["CobaltSell"]=25 MAT["TungstenPD"]=20 MAT["TungstenMD"]=20 MAT["TungstenAC"]=0 MAT["TungstenPR"]=7 MAT["TungstenMR"]=7 MAT["TungstenWT"]=20 MAT["TungstenBuy"]=70 MAT["TungstenSell"]=35 WEP={} WEP["KnifePD"]=0.5 WEP["KnifeMD"]=0.5 WEP["KnifeAC"]=1.25 WEP["SwordPD"]=1.0 WEP["SwordMD"]=1.0 WEP["SwordAC"]=1.0 WEP["GreatswordPD"]=1.67 WEP["GreatswordMD"]=0.67 WEP["GreatswordAC"]=0.5 WEP["PolearmPD"]=1.15 WEP["PolearmMD"]=1.15 WEP["PolearmAC"]=1.15 WEP["CanePD"]=1.15 WEP["CaneMD"]=1.15 WEP["CaneAC"]=0.7 WEP["ClawPD"]=1.1 WEP["ClawMD"]=1.1 WEP["ClawAC"]=0.8 WEP["BattlestaffPD"]=1.15 WEP["BattlestaffMD"]=1 WEP["BattlestaffAC"]=1.25 WEP["TalisPD"]=1.15 WEP["TalisMD"]=0.7 WEP["TalisAC"]=1.15 WEP["WandPD"]=0.0 WEP["WandMD"]=1 WEP["WandAC"]=1.33 WEP["RodPD"]=0.0 WEP["RodMD"]=1.67 WEP["RodAC"]=0.67 WEP["SlicerPD"]=0.67 WEP["SlicerMD"]=0.67 WEP["SlicerAC"]=0.67 WEP["BowPD"]=1.15 WEP["BowMD"]=1.15 WEP["BowAC"]=0.85 WEP["CrossbowPD"]=1.4 WEP["CrossbowMD"]=1.4 WEP["CrossbowAC"]=1 WEP["PistolPD"]=0.65 WEP["PistolMD"]=0.65 WEP["PistolAC"]=1.15 WEP["MechgunPD"]=0.2 WEP["MechgunMD"]=0.2 WEP["MechgunAC"]=1.5 WEP["ShotgunPD"]=1.3 WEP["ShotgunMD"]=1.3 WEP["ShotgunAC"]=0.4 WEP["RiflePD"]=0.75 WEP["RifleMD"]=0.75 WEP["RifleAC"]=1.75 WEP["HandbowPD"]=0.8 WEP["HandbowMD"]=0.8 WEP["HandbowAC"]=1.2 UP={} UP["0PD"]=1.0 UP["1PD"]=1.1 UP["2PD"]=1.2 UP["3PD"]=1.3 UP["4PD"]=1.4 UP["5PD"]=1.5 UP["6PD"]=1.6 UP["7PD"]=1.7 UP["8PD"]=1.8 UP["9PD"]=1.9 UP["10PD"]=2.0 UP["0MD"]=1.0 UP["1MD"]=1.1 UP["2MD"]=1.2 UP["3MD"]=1.3 UP["4MD"]=1.4 UP["5MD"]=1.5 UP["6MD"]=1.6 UP["7MD"]=1.7 UP["8MD"]=1.8 UP["9MD"]=1.9 UP["10MD"]=2.0 UP["0AC"]=1.0 UP["1AC"]=1.1 UP["2AC"]=1.2 UP["3AC"]=1.3 UP["4AC"]=1.4 UP["5AC"]=1.5 UP["6AC"]=1.6 UP["7AC"]=1.7 UP["8AC"]=1.8 UP["9AC"]=1.9 UP["10AC"]=2.0 UP["0PR"]=1.0 UP["1PR"]=1.1 UP["2PR"]=1.2 UP["3PR"]=1.3 UP["4PR"]=1.4 UP["5PR"]=1.5 UP["6PR"]=1.6 UP["7PR"]=1.7 UP["8PR"]=1.8 UP["9PR"]=1.9 UP["10PR"]=2.0 UP["0MR"]=1.0 UP["1MR"]=1.1 UP["2MR"]=1.2 UP["3MR"]=1.3 UP["4MR"]=1.4 UP["5MR"]=1.5 UP["6MR"]=1.6 UP["7MR"]=1.7 UP["8MR"]=1.8 UP["9MR"]=1.9 UP["10MR"]=2.0 UP["0WT"]=1.0 UP["1WT"]=0.95 UP["2WT"]=0.9 UP["3WT"]=0.85 UP["4WT"]=0.8 UP["5WT"]=0.75 UP["6WT"]=0.7 UP["7WT"]=0.65 UP["8WT"]=0.6 UP["9WT"]=0.55 UP["10WT"]=0.5 def ForgeW(Material,WeaponType,UpgradeLevel): """The ForgeW function Forges a Weapon from its base components into a lethal tool.""" #Get the appropriate material stats... OrePD=MAT[Material+"PD"] OreMD=MAT[Material+"MD"] OreAC=MAT[Material+"AC"] #And weapon type stats... SmithPD=WEP[WeaponType+"PD"] SmithMD=WEP[WeaponType+"MD"] SmithAC=WEP[WeaponType+"AC"] #And apply the upgrade... UpgradePD=UP[UpgradeLevel+"PD"] UpgradeMD=UP[UpgradeLevel+"MD"] UpgradeAC=UP[UpgradeLevel+"AC"] #Then, add them all together. ProductPD=(OrePD*SmithPD)*UpgradePD ProductMD=(OreMD*SmithMD)*UpgradeMD ProductAC=(OreAC*SmithAC)*UpgradeAC return(ProductPD,ProductMD,ProductAC) #Recall that ForgeW simply needs its three inputs, which we have a list of. So, let's make our #database of weapon information. OmniWeapData={} #Go through every set of inputs we have... for Inputs in ForgeWInputs: #And create a key in the dictionary by combining their three names. Then, set that #key equal to whatever ForgeW returns when those three inputs are put in. OmniWeapData[Inputs[0]+Inputs[1]+Inputs[2]] = ForgeW(Inputs[0],Inputs[1],Inputs[2]) I would like to refer to the database created by this code and pull out weapons at random, and frankly I have no idea how. As an example of what I would like to do... Well, hum. The code in question should spit out a certain number of results based on the complete products of the ForgeW function - if I specify, either within the code or through an input, that I would like 3 outputs, it might output a GoldKnife0, a TinPolearm5, and a CobaltGreatsword10. If I were to run the code again, it should dispense new equipment - not the same three every time. I apologize if this is too much or too little data - it's my first time asking a question here.
"Take this... it may help you on your quest." There is a library called random with a method called choice(). e.g. import random random.choice([1,2,3]) >>> 2 It sounds like you need one item from Materials, one item from WeaponTypes, and one from Upgrades. Also, rarely is there ever a need for a triple nested FOR statement. This should get you started.
Linux ALSA Driver using channel count 3
Am running my ALSA Driver on Ubuntu 14.04, 64bit, 3.16.0-30-generic Kernel. Hardware is proprietary hardware, hence cant give much details. Following is the existing driver implementation: Driver is provided sample format, sample rate, channel_count as input via module parameter. (Due to requirements need to provide inputs via module parameters) Initial snd_pcm_hardware structure for playback path. #define DEFAULT_PERIOD_SIZE (4096) #define DEFAULT_NO_OF_PERIODS (1024) static struct snd_pcm_hardware xxx_playback = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START, .formats = SNDRV_PCM_FMTBIT_S16_LE, .rates = (SNDRV_PCM_RATE_8000 | \ SNDRV_PCM_RATE_16000 | \ SNDRV_PCM_RATE_48000 | \ SNDRV_PCM_RATE_96000), .rate_min = 8000, .rate_max = 96000, .channels_min = 1, .channels_max = 1, .buffer_bytes_max = (DEFAULT_PERIOD_SIZE * DEFAULT_NO_OF_PERIODS), .period_bytes_min = DEFAULT_PERIOD_SIZE, .period_bytes_max = DEFAULT_PERIOD_SIZE, .periods_min = DEFAULT_NO_OF_PERIODS, .periods_max = DEFAULT_NO_OF_PERIODS, }; Similar values for captures side snd_pcm_hardware structure. Please, note that the following below values are replaced in playback open entry point, based on the current audio test configuration: (user provides audio format, audio rate, ch count via module parameters as inputs to the driver, which are refilled in snd_pcm_hardware structure) xxx_playback.formats = user_format_input xxx_playback.rates = xxx_playback.rate_min, xxx_playback.rate_max = user_sample_rate_input xxx_playback.channels_min = xxx_playback.channels_max = user_channel_input Similarly values are re-filled for capture snd_pcm_hardware structure in capture open entry point. Hardware is configured for clocks based on channel_count, format, sample_rate and driver registers successfully with ALSA layer Found aplay/arecord working fine for channel_count = 1 or 2 or 4 During aplay/arecord, in driver when "runtime->channels" value is checked, it reflects the channel_count configured, which sounds correct to me. Record data matches with played, since its a loop back test. But when i use channel_count = 3, Both aplay or arecord reports "Broken configuration for this PCM: no configurations available"!! for a wave file with channel_count '3' ex: Playing WAVE './xxx.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Channels 3 ALSA lib pcm_params.c:2162:(snd1_pcm_hw_refine_slave) Slave PCM not usable aplay: set_params:1204: Broken configuration for this PCM: no configurations available With Following changes I was able to move ahead a bit: ......................... Method1: Driver is provided channel_count '3' as input via module parameter Modified Driver to fill snd_pcm_hardware structure as payback->channels_min = 2 & playback->channels_min = 3; Similar values for capture path aplay/arecord reports as 'channel count not available', though the wave file in use has 3 channels ex: aplay -D hw:CARD=xxx,DEV=0 ./xxx.wav Playing WAVE './xxx.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Channels 3 aplay: set_params:1239: Channels count non available Tried aplay/arecord with plughw, and aplay/arecord moved ahead arecord -D plughw:CARD=xxx,DEV=0 -d 3 -f S16_LE -r 48000 -c 3 ./xxx_rec0.wav aplay -D plughw:CARD=xxx,DEV=0 ./xxx.wav Recording WAVE './xxx_rec0.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Channels 3 Playing WAVE './xxx.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Channels 3 End of Test During aplay/arecord, In driver when "runtime->channels" value is checked it returns value 2!!! But played wavefile has ch count 3... When data in recorded file is checked its all silence ......................... Method2: Driver is provided channel_count '3' as input via module parameter Modified Driver to fill snd_pcm_hardware structure as playback->channels_min = 3 & playback->channels_min = 4; Similar values for capture path aplay/arecord reports as 'channel count not available', though the wave file in use has 3 channels Tried aplay/arecord with plughw, and aplay/arecord moved ahead During aplay/arecord, In driver when "runtime->channels" value is checked it returns value 4!!! But played wavefile has ch count 3... When data in recorded file is checked its all silence ......................... So from above observations, the runtime->channels is either 2 or 4, but never 3 channels was used by alsa stack though requested. When used Plughw, alsa is converting data to run under 2 or 4 channel. Can anyone help why am unable to use channel count 3. Will provide more information if needed. Thanks in Advance.
A period (and the entire buffer) must contain an integral number of frames, i.e., you cannot have partial frames. With three channels, one frame has six bytes. The fixed period size (4096) is not divisible by six without remainder.
Thanks CL. I used period size 4092 for this particular test case with channel count 3, and was able to do loop back successfully (without using plughw). One last question, when I used plughw earlier, and when runtime->channels was either 2 or 4, why was the recorded data not showing?
RaspBerry pi B rev2 - Issue while sampling a LM335 (temp. sensor) thru a MCP3208 ADC via SPI in Python 3
I tried to interface a RaspBerry pi with a LM335 temperature sensor this week-end. I'm using a MCP 3208 micro controller (channel 0) to interface the sensor. My goal is to collect samples data in SPI mode with python 3 scripts (classes). I've checked the wiring and everything seems OK for me, I'but I'am a beginner, not really aware of Electronic concepts. On the software side , I've installed quick2wire that claims to be python 3 compatible. In fact I want to lead the micro-controller with Python 3 API's (not thru shell calls) Components Raspberry pi REV2 model B with Rasbian-wheezy / Quick2wire installed. /dev/spix.y devices are listed. MCP3208 ADC : 12 bits ADC / SPI. I'm using CS0 from the GPIO. The sensor is connected to channel 0 (B). see datasheet. LM335 : temperature sensor. Outputs 10mV / °K. Min 5muA / Max 5 mA. It's connected to the MCP3208 channel #0 (A). see datasheet 220 ohms resistor (C). set up regarding LM335 outputs and desired temperature range coverage with my own calculations : May be a problem ... Schematics extract The LM335 (zener diode like) is connected as : Wiring Components are wired as shown bellow. Note that the yellow link is connected behind the cobbler kit on the CS0 SPI channel. Quick2wire I use the bellow script to query the CS0/Channel 0 GPIO interface. Unfortunately, I've not found usefull informations on the quick2wire-python-api API's. I've just copy/paste an example found as it was written in the same goal. I'm not sure if it really works : #!/usr/bin/env python3 from quick2wire.spi import * import sys, time try: channel = int(sys.argv[1]) except: channel = 0 MCP3208 = SPIDevice(channel, 0) while True: try: response = MCP3208.transaction(writing_bytes(0x41, 0x13), reading(1)) print ("output = %i" % ord(response[0])) time.sleep(1) except KeyboardInterrupt: break The script outputs : output = 0 output = 0 output = 0 output = 0 output = 0 .... The result is the same with the channel 1 ( with argv = 1) As the MCP3208 Din (probe output) receives voltage (see bellow) quick2wire should read at 18°C (rawghly my home inside temperature today) 3,3 V / 2^12 = 805 muA as I understand as "digital step" 18°C + 273°C = 291 => 2,91 V on the micro controller Din pin and then return 2 910 / 0.805 = 3 615 Am I wrong ? Controls I've no oscilloscope, the only measures I can read are : Voltage is 2.529 V at B checkpoint and 0,5 V (+/-5%) on the other MCP3208 channels Note : the adjust pin is not used on the LM335 so results way not be accurate but voltage is here ! Seems to be a problem on the quick2wire side I think. But which ? Code The quick2wire.spi.SPIDevice class lakes of détails on the transfers parameter in terms of structure, content and output response format. def transaction(self, *transfers): """ Perform an SPI I/O transaction. Arguments: *transfers -- SPI transfer requests created by one of the reading, writing, writing_bytes, duplex or duplex_bytes functions. Returns: a list of byte sequences, one for each read or duplex operation performed. """ transfer_count = len(transfers) ioctl_arg = (spi_ioc_transfer*transfer_count)() # populate array from transfers for i, transfer in enumerate(transfers): ioctl_arg[i] = transfers[i].to_spi_ioc_transfer() ioctl(self.fd, SPI_IOC_MESSAGE(transfer_count), addressof(ioctl_arg)) return [transfer.to_read_bytes() for t in transfers if t.has_read_buf] Another question : how to set SPI configuration values like mode, clock speed, bits per word, LSB ... and so on. Thanks in advance for your help.
I know you probably intend to learn how to use the ADC, an so this isn't really an answer to your question (I will use your very rich post for sure - thanks), but I'm aware of temperature sensors that already pack data in GPIO serial line, that are best suited for the raspberry. You really have to read this awesome tutorial, if you haven't already.
When changing a file name, Recording Start is overdue for 3 seconds.
Using Two ASFWriter Filters in a graph.One is making wmv file, Anather is for live streaming. Carrying out streaming, When changing a file name, Recording Start is overdue for 3 seconds. so,The head of a New WMV is missing. It's troubled. CAMERA ------ InfTee Filter --- --- AsfWriter Filter → WMV FIle X Microphone --- InfTee Filter2 --- --- AsfWriter Filter2 → Live Streaming void RecStart() { ... ConnectFilters(pInfTee,"Infinite Pin Tee Filter(1)",L"Output1",pASFWriter,"ASFWriter",L"Video Input 01")); ConnectFilters(pInfTee,"Infinite Pin Tee Filter(2)",L"Output2",pASFWriter2,"ASFWriter",L"Video Input 01")); ConnectFilters(pSrcAudio,"Audio Source",L"Capture",pInfTee2,"Infinite Pin Tee Filter",L"Input")); ConnectFilters(pInfTee2,"Infinite Pin Tee Filter(1)A",L"Output1",pASFWriter,"ASFWriter",L"Audio Input 01")); ConnectFilters(pInfTee2,"Infinite Pin Tee Filter(2)A",L"Output2",pASFWriter2,"ASFWriter",L"Audio Input 01")); pASFWriter2->QueryInterface(IID_IConfigAsfWriter,(void**)&pConfig); pConfig->QueryInterface(IID_IServiceProvider,(void**)&pProvider); pProvider->QueryService(IID_IWMWriterAdvanced2, IID_IWMWriterAdvanced2, (void**)&mpWriter2); mpWriter2->SetLiveSource(TRUE); mpWriter2->RemoveSink(0); WMCreateWriterNetworkSink(&mpNetSink); DWORD dwPort = (DWORD)streamingPortNo; mpNetSink->Open(&dwPort); mpNetSink->GetHostURL(url, &url_len); hr =mpWriter2->AddSink(mpNetSink); pGraph->QueryInterface(IID_IMediaEventEx,(void **)&pMediaIvent); pMediaIvent->SetNotifyWindow((OAHWND)this->m_hWnd,WM_GRAPHNOTIFY,0); pGraph->QueryInterface(IID_IMediaControl,(void **)&pMediaControl); pMediaControl->Run(); } void OnTimer() { pMediaControl->Stop(); CComQIPtr<IFileSinkFilter,&IID_IFileSinkFilter> pIFS = pASFWriter; pIFS->SetFileName(NewFilename,NULL); pMediaControl->Run(); } --------------------------------------------------------------------------- → I think ... In order to wait for starting of streaming, it is missing for 3 seconds in head of New WMV File. Are there any measures? ---------------------------------------------------------------------------
When you restart the graph, you inevitably miss a fragment of data due to initialization overhead. And, it is impossible to switch files without stopping the graph. The solution is to use multiple graphs and keep capturing while the part with file writing is being reinitialized. See DirectShow Bridges for a typical solution addressing this problem.