Sunday, 2017-04-02

*** tpb has joined #timvideos00:00
*** CarlFK has quit IRC00:17
*** CarlFK has joined #timvideos00:42
*** ChanServ sets mode: +v CarlFK00:42
*** arcticShadow has quit IRC01:24
mithrocr1901_modern: ping?02:32
cr1901_modernmithro: pong02:42
mithrocr1901_modern: I'm working on the qemu emulation of the bitbanging spi flash02:42
cr1901_modernmithro: That sounds like fun. Need help?02:42
cr1901_modernOh wait...02:43
mithrocr1901_modern: Well, I don't have any actual software which I know works :-P02:43
* cr1901_modern is on a broken operating system. I couldn't run QEMU even if I wanted to02:43
cr1901_modernmithro: You mean you want an XMODEM impl I assume?02:43
mithrocr1901_modern: I mean I would like your bitbanging test code in a repo I can use :-)02:44
cr1901_modernCan you be more specific? What platform is QEMU emulating?02:45
cr1901_modernis it emulating, say, a mimasv2?02:45
mithrocr1901_modern: Sure, or an Opsis02:46
cr1901_modernmithro: The test code I'm using was just an extra file compiled into HDMI2USB. I *could* create a minimal firmware whose sole purpose is to be loaded into RAM and then test SPI flash writes if that's what you wish02:47
mithrocr1901_modern: The rest of the firmware boots fine, so if you just added your test code to be able to be called from the ci, that would work?02:47
cr1901_modernthat's exactly what I did to test anyway :)02:48
tpbTitle: GitHub - cr1901/HDMI2USB-litex-firmware: A version of the HDMI2USB firmware based around the misoc+migen tools produced by m-labs. (at
tpbTitle: GitHub - cr1901/litex: Build your hardware, easily! (at
cr1901_modernmithro: The actual modification to litex is very minimal. In fact, libbase, spiflash.c is unaltered!02:49
cr1901_modernwait... let's back up. Let me know when you caught up.02:49
cr1901_modern"The rest of the firmware boots fine" <-- I'm confused. Was there a point recently (sans the RAM bug on mimasv2) that the firmware didn't boot?02:52
mithrocr1901_modern: In QEmu02:53
cr1901_modernmithro: Ahhh, I see. In any case, my fork of HDMI2USB added a "debug spiflash" to the ci (what does that stand for?) that reads, the flash, writes the inverse value, and the erases the flash. All of this takes place in an unused portion of flash memory.02:55
cr1901_modernThere's no bounds checking, and tbh, "writes the inverse value" is an oversight (AIUI, in flash memory you can only turn ones into zeros, not vice versa). I should prob add those02:56
mithrocommandline interface02:57
*** arcticShadow has joined #timvideos03:33
mithrocr1901_modern: So this should work on the mimasv2 right?03:34
cr1901_modernmithro: Yes. I would certainly hope so, since I tested it on my mimasv203:38
mithrocr1901_modern: testing now03:38
cr1901_modernmithro: Did you use my copy of litex/hdmi2usb?03:39
mithrocr1901_modern: So, if I understand correctly there are 3 CSR registers03:50
cr1901_modernmithro: Yes03:53
mithroBit0 == MOSI, Bit1 == CLK, Bit2 == CS_N, Bit3 == MOSI Enable?03:54
*** arcticShadow has quit IRC03:54
cr1901_modernmithro: H/o my swapfile is having a stroke03:54
mithroActually looks like Bit3 was only used on spi_width > 103:55
cr1901_modernmithro: Yes, that's correct. It is ignored on spi_width == 1.03:56
cr1901_modernI just wanted the same code to be usable regardless of spi_width03:56
mithrocr1901_modern: So the spiflash command should start out at all ff and then end up at all 00 ?03:56
cr1901_modernmithro: Yes03:56
mithrocr1901_modern: Can you write something more interesting then 00?03:56
cr1901_modernmithro: Sure, but you'll need to wait 5-10 minutes for me to reprogram my board :)03:57
mithrocr1901_modern: You should just be able to load different firmware, right?03:58
cr1901_modernright... LOADING the firmware takes 5 minutes :D03:58
cr1901_modernThe free space is also inaccurate b/c I didn't calculate it properly (arithmetic error)03:59
cr1901_modernI'll fix that in a bit03:59
mithrocr1901_modern: Do you read any data from the spiflash using the bitbanging?04:03
cr1901_modernmithro: No, although I could add such a command04:04
mithrocr1901_modern: Could you? I'd like to verify writing and then reading via the bitbanging before checking from the memory interface04:04
cr1901_modernmithro: This was quick and dirty, so whatever extra you need, just let me know :)04:04
cr1901_modern(In a word: sure, I'll add it)04:05
mithroWhat CPOL/CPHA are we using?04:05
cr1901_modernWe could also support 1/1 with bitbanging04:05
cr1901_modernBut the MISO CSR only clocks in a new bit when the clk goes from 0 => 1. So that implies either 0/0 or 1/104:06
cr1901_modernI'm not aware of 1/0 or 0/1 flash mems04:06
cr1901_modernmithro: Pushed. Try now04:16
*** madgoat has joined #timvideos04:19
*** madgoat has left #timvideos04:22
mithroI'm still trying to figure out the CS line in QEmu04:35
cr1901_modernI can't help you unfortunately :(. I've never actually played with QEMU much04:37
mithroI'm confused about the SPI flash modes05:27
cr1901_modernwhat do you mean?05:28
mithrocr1901_modern: when to sample / write the MISO/MOSI05:29
cr1901_modernCPOL == Which logic level is the "idle level"05:30
mithroFor CPHA0 -  on the IDLE->ACTIVE, MOSI is set and on ACTIVE->IDLE MISO is read05:34
mithroOh, I need to merge your read stuff05:39
mithroI seem to be getting the commands through...05:39
mithro: flash_erase: offset = 0xb0000, len = 6553605:39
mithro: m25p80_transfer8: page program cur_addr=0xbafc8 data=ff05:39
mithrocr1901_modern: Your not reading from the flash via bit banging yet?05:42
*** Ishan_Bansal has joined #timvideos05:42
mithroIshan_Bansal: Hi05:43
mithroIshan_Bansal: Your message from yesterday didn't make any sense05:43
cr1901_modernmithro: You asked me that an hour ago (no) :P.05:43
mithrocr1901_modern: Oh, it looks like there are not any reading functions in libbase/spiflash.c ...05:43
cr1901_modernmithro: Sorry I got distracted. CPHA == Which clock edge should we sample MISO on?05:44
cr1901_modern0 == first edge, 1 == second edge, regardless of the clock polarity05:44
*** Ishan_Bansal has quit IRC05:45
*** Ishan_Bansal has joined #timvideos05:51
cr1901_modernmithro: I didn't add the read functions yet. I'll do those after I sleep.05:51
mithroflash.o: In function `bitbang_test':05:51
mithroflash.c:(.text+0x220): undefined reference to `write_to_flash'05:51
mithroflash.c:(.text+0x220): relocation truncated to fit: R_LM32_CALL against undefined symbol `write_to_flash'05:51
mithroflash.c:(.text+0x23c): undefined reference to `erase_flash_sector'05:51
mithroflash.c:(.text+0x23c): relocation truncated to fit: R_LM32_CALL against undefined symbol `erase_flash_sector'05:51
cr1901_modernmithro: Recompile libbase?05:53
mithroOh, it's because my litex reset itself back to the committed module05:54
cr1901_modernmithro: How's the GSoC coming along, btw?05:55
mithrocr1901_modern: Need a compiler guard for the bitbanging interface05:55
cr1901_modern ?05:56
tpbTitle: litex/spiflash.c at master · cr1901/litex · GitHub (at
mithrocr1901_modern: need the same in firmware/flash.c05:58
mithrocr1901_modern: It might be good to read the flash ID and stuff too06:17
mithrocr1901_modern: These ->
tpbTitle: chibios-netvcr/cmd-spinor.c at netvcr · xobs/chibios-netvcr · GitHub (at
Ishan_Bansalmithro: On execution of '' during setup you got the error '' saying file not found06:21
tpbTitle: Screenshot from 2017-04-02 11:36:18.png - Google Drive (at
cr1901_modernmithro: Ack.06:22
mithroIshan_Bansal: Do you know how to use a pastebin?06:22
mithroIshan_Bansal: I'm pretty sure the information I need to diagnose what your real error is, is further up06:23
cr1901_modernssk1328 isn't in the room it seems?06:27
mithrocr1901_modern: For doing things like PIP we need to finish merging ssk1328's work06:27
cr1901_modernWhat does his work do, high level overview?06:28
mithrocr1901_modern: We merged his stuff into "16bit floating point pixels" into litevideo recently06:28
mithrocr1901_modern: We need 16bit floating point pixels to do proper color merging06:28
mithroIshan_Bansal: I'm adding some more information into the script to make it easier to understand what it is doing06:29
cr1901_modernfair. But isn't PIP just an overlay?06:29
cr1901_modern(well for *my* use-case anyway)06:29
cr1901_modernmithro: ^06:42
mithrocr1901_modern: You need to scale the image first?06:42
cr1901_modernmithro: Oh, I wasn't planning on doing that :D06:43
mithrocr1901_modern: What about blending?06:43
cr1901_modernBlending? If I'm displaying, say, a raw NTSC signal, 256x224, on an LCD monitor as-is, do I need blending? (contrived example)06:44
cr1901_modernit would just be an RGB int triple, right?06:44
cr1901_modernIn any case, I assume even if the output is RGB int, it's still useful to have float as intermediate results06:47
cr1901_modernpity FPGA multipliers can't handle floating point well06:47
mithrocr1901_modern: If you want the color to not look like poo brown :-)06:48
cr1901_modernmithro: Can you elaborate? Why would an overlay, where you choose to blit the pixels of one video source vs another, look like poo brown?06:49
* cr1901_modern thinks he has some learning to do about actually drawing stuff to the screen :D06:49
mithrocr1901_modern: You need to do blending in linear gamma domain otherwise things don't work correctly06:51
mithroAlmost all RGB color spaces are not linear06:52
cr1901_modernOh, I thought that was gamma correction. Blending is "combining two colors to make a third", right?06:53
mithroBlending is doing anything to the pixels values06:55
cr1901_modernoh... I'm an idiot06:55
cr1901_modernmithro: In any case, I understand now06:56
cr1901_moderngamma's nonlinear, so floating point precision makes sense for dynamic range purposes I assume06:56
mithrocr1901_modern: When converting from rgb to 16bit floating point you do gamma correction to make the output linear06:57
mithrocr1901_modern: Then when converting back from 16bit floating point to the output, you do gamma correction again06:57
mithroYou need >8bits for this operation to be a no-op06:58
mithro16bit-floating point gives you enough precision that you don't lose detail doing this06:58
cr1901_modern"You need >8bits for this operation to be a no-op" <-- by no-op you mean "single cycle in h/w"?06:59
mithrocr1901_modern: No I mean that if you do A->X->B, then for all values of A, A==B07:04
mithroI'm going to get some food, be back in 30 minutes07:04
cr1901_modernI will prob be asleep by that time07:13
*** Ishan_Bansal has quit IRC07:24
tpbTitle: debian Pastezone (at
mithrocr1901_modern: Why is it every 4th value?11:06
*** Ishan_Bansal has joined #timvideos12:59
Ishan_Bansalmithro: Hi12:59
Ishan_Bansalmithro : I am hoping to work on the project '[HDMI2USB] Convert the JPEG encoder from VHDL to Migen/MiSoC' during my summer and for this I have submitted my draft ( on GSOC website yesterday , kindly review the draft and give your valuable suggestions for the further improvement required in the doc.13:07
tpbTitle: Project Proposal_JPEG_encoder - Google Docs (at
cr1901_modernmithro: Because the buffer that I write to flash is an array of ints:
tpbTitle: HDMI2USB-litex-firmware/flash.c at master · cr1901/HDMI2USB-litex-firmware · GitHub (at
*** Ishan_Bansal has quit IRC15:22
*** sb0 has quit IRC17:27
CarlFKmithro: im trying to follow the build instructions..19:34
tpbTitle: HDMI2USB-litex-firmware/ at master · mithro/HDMI2USB-litex-firmware · GitHub (at
CarlFKwhere does  third_party come from?19:35
*** danielki has joined #timvideos20:24
*** Guest83532 has joined #timvideos21:19
*** Guest83532 has quit IRC21:30
*** samsagaz__ has joined #timvideos23:04
*** samsagaz__ has quit IRC23:06
mithroCarlFK: it should clone it for you if you don't already have it?23:48
CarlFKmithro: it clones qemu-litex23:52
CarlFKbut that doesn't create third_party23:52
CarlFKah, it errors before the git clone line.  I bet you wanted a mkdir somewhere... or something.23:53
CarlFK./ line 41: cd: /home/juser/temp/third_party: No such file or directory23:53
CarlFKbbl - dinner time23:57

Generated by 2.13.1 by Marius Gedminas - find it at!