Tuesday, 2017-08-22

*** tpb has joined #timvideos00:00
*** sb0 has joined #timvideos02:41
*** rohitksingh_work has joined #timvideos03:50
*** thaytan_ has joined #timvideos04:09
*** thaytan has quit IRC04:13
paddatrappermithro: are you available in about 2 hours or so to help debug that Opsis audio issue?04:20
mithropaddatrapper: should be04:25
*** cr1901_modern1 has joined #timvideos05:31
*** cr1901_modern has quit IRC05:34
*** thaytan_ is now known as thaytan06:07
*** ChanServ sets mode: +v thaytan06:07
paddatrappermithro: ping?06:16
paddatrappermithro: wireshark's output is interesting. Looks like the SET_INTERFACE response is only being sent much later (around 5ms I think, could be 5s)06:33
mithropaddatrapper: pong06:34
mithropaddatrapper: Lets get me exactly what you have first?06:34
paddatrappermithro: loading the audio-data branch of the audio firmware to the Opsis: dmesg returns, after enumerating the device:06:36
paddatrapper[54530.562008] usb 2-3: 1:1: usb_set_interface failed (-110)06:36
mithropaddatrapper: Okay - what am I checking out and what am I building?06:36
paddatrappermithro: checkout audio-data branch from my repo, cd audio && make06:37
mithropaddatrapper: Which version of sdcc are you using?06:38
paddatrappermithro: SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/TININative/ds400/hc08/s08/stm8 3.5.0 #9253 (Mar 19 2016) (Linux)06:38
mithropaddatrapper: How did you get that?06:38
paddatrappermithro: Debian repos06:38
paddatrapperfor unstable06:39
mithroThe version I get is "SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.3.0 #8604 (Dec 30 2013) (Linux)"06:39
mithropaddatrapper: So, we should probably both use the sdcc version in conda06:39
paddatrappermithro: but would that be the issue when the Atlys and FX2 both work fine?06:40
paddatrapperhow do I get the version you are running?06:40
mithropaddatrapper: I'm not going to try and debug an issue unless we have an identical setup first06:40
paddatrapperok06:40
mithropaddatrapper: I guess we should have a script to setup the conda env?06:41
paddatrappermithro: what is the conda env?06:41
mithropaddatrapper: Like a Python virtualenv but with binaries06:42
paddatrappermithro: ah cool. there are no scripts like that in the FX2 firmware repo06:42
mithropaddatrapper: I'm adding one now - hold on a second06:42
mithropaddatrapper: https://github.com/timvideos/HDMI2USB-fx2-firmware/pull/3906:53
tpbTitle: Adding conda environment. by mithro · Pull Request #39 · timvideos/HDMI2USB-fx2-firmware · GitHub (at github.com)06:53
mithropaddatrapper: How does that look?06:55
paddatrappermithro: running it at the moment06:55
paddatrapperdownloading SDCC version 3.6.0.96106:56
Ishan_Bansalmithro : ping06:57
paddatrapperSDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/TININative/ds400/hc08/s08/stm8 3.6.0 #9615 (Linux)06:58
paddatrappermithro: though it probably should be in the common Makefile06:59
mithroHi Ishan_Bansal07:13
mithroI'm just helping paddatrapper at the moment07:13
Ishan_Bansalmithro : NP07:13
Ishan_BansalI am free till 2:00 PM07:13
mithroIshan_Bansal: I will look at your pull request again soon.07:13
mithropaddatrapper: Take a look at the pull request now?07:14
Ishan_Bansalmithro : thanks :)07:14
mithropaddatrapper: It that looks good we can go onto trying to fix your bug :-P07:17
paddatrappermithro: looks good to me07:17
paddatrapper\o/07:17
mithropaddatrapper: You should also be able to do a "make clean; make" now and get everything built....07:18
mithropaddatrapper: Can you push the latest version of audio-data with the stuff merged?07:18
paddatrappermithro: yeah I saw that, very handy07:18
paddatrappermithro: rebased07:19
paddatrappermithro: so I'm now building using sdcc v3.6.007:23
mithropaddatrapper: Hopefully, if we have things working correctly...07:23
mithropaddatrapper: It comes from -> https://github.com/timvideos/conda-hdmi2usb-packages07:23
tpbTitle: GitHub - timvideos/conda-hdmi2usb-packages: Conda build recipes for the toolchains needed by LiteX / MiSoC firmware (at github.com)07:23
paddatrappermithro: I had the Makefile print the version out for each file compiled07:24
mithropaddatrapper: Okay, so what next? I'm at commit f7419256579e9940ba7cca1fc6f51fab4b411a2f07:26
mithropaddatrapper: make firmware-audio-fx2 ?07:26
paddatrappermithro: cd audio && make load07:26
paddatrapperor that works too07:26
paddatrapperby default it builds for Opsis07:26
mithropaddatrapper: So what should be happening? http://pastebin.ubuntu.com/25368012/07:34
tpbTitle: Ubuntu Pastebin (at pastebin.ubuntu.com)07:34
paddatrappermithro: that is more promising than what I get: http://paste.debian.net/982476/07:39
tpbTitle: debian Pastezone (at paste.debian.net)07:39
paddatrapperand I'm working off the same commit, with a clean working tree07:40
mithropaddatrapper: Still seems to be working for me?07:44
paddatrappermithro: any idea why we would get different results?07:45
mithropaddatrapper: I can think of plenty of reasons07:45
mithroLinux tansell.syd.corp.google.com 4.4.0-83-generic #106~14.04.1-Ubuntu SMP Mon Jun 26 18:10:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux07:45
mithroBut kernel version differences are the most likely07:46
mithropaddatrapper: How do you capture the wireshark output?07:46
mithropaddatrapper: Should we compare them?07:46
paddatrapperLinux kyle-laptop 4.12.0-1-amd64 #1 SMP Debian 4.12.6-1 (2017-08-12) x86_64 GNU/Linux07:46
mithropaddatrapper: Could also be that I'm using a hub07:46
paddatrappermithro: wireshark I do using usbmon as the interface07:47
mithropaddatrapper: Sure, I just want to make sure that I'm doing the same thing you are...07:47
paddatrappermithro: cool. yeah I do that and add filters as necessary (generally USB.address)07:47
mithropaddatrapper: Assume I know nothing and tell me what to do07:48
paddatrappermithro: sudo modprobe usbmon07:48
paddatrappersudo wireshark07:48
paddatrapperOnce open, start capture on usbmonX, where X is the bus number that the Opsis is on07:49
paddatrapperWith capture running: make load from the audio directory07:49
paddatrapperonce loaded and a little time has passed, stop capture and examine07:49
mithropaddatrapper: Should I restart my opsis in some way?07:49
paddatrappermithro: before capture, yes07:50
mithropaddatrapper: Oh - my Opsis doesn't have working firmware on it at the moment, the device just comes up as the failsafe device - 544007:50
paddatrappermithro: ah ok. I'm currently working off one flashed with debconf17 firmware07:51
*** Joelw has quit IRC07:52
mithropaddatrapper: Well, maybe you should get me to flash the debconf17 firmware first?07:52
paddatrapperSo I wait for it to come up as an HDMI2USB video device fully before loading07:52
*** Joelw has joined #timvideos07:52
paddatrappermithro: that is probably a good idea. debconf17 branch: https://github.com/timvideos/HDMI2USB-litex-firmware/tree/debconf1707:53
tpbTitle: GitHub - timvideos/HDMI2USB-litex-firmware at debconf17 (at github.com)07:53
mithropaddatrapper: I assume I want the prebuilt version?07:53
paddatrappermithro: I wasn't aware there was one07:54
mithropaddatrapper: https://github.com/timvideos/HDMI2USB-firmware-prebuilt/tree/master/archive/debconf1707:54
tpbTitle: HDMI2USB-firmware-prebuilt/archive/debconf17 at master · timvideos/HDMI2USB-firmware-prebuilt · GitHub (at github.com)07:55
mithropaddatrapper: I assume your using one of them?07:55
paddatrappermithro: v0.0.3-742-g9eb83b407:55
mithrohttps://github.com/timvideos/HDMI2USB-firmware-prebuilt/tree/master/archive/debconf17/v0.0.3-742-g9eb83b4/opsis/hdmi2usb/lm32 ?07:56
tpbTitle: HDMI2USB-firmware-prebuilt/archive/debconf17/v0.0.3-742-g9eb83b4/opsis/hdmi2usb/lm32 at master · timvideos/HDMI2USB-firmware-prebuilt · GitHub (at github.com)07:56
paddatrappermithro: version run off Opsis: http://paste.debian.net/982477/07:56
tpbTitle: debian Pastezone (at paste.debian.net)07:56
paddatrappermithro: I'm not sure... tumbleweed built and managed the version we ran07:57
paddatrappermithro: I would guess it would be https://github.com/timvideos/HDMI2USB-firmware-prebuilt/tree/master/archive/debconf17/v0.0.3-742-g9eb83b4/opsis/hdmi2usb/lm32/software/firmware07:58
tpbTitle: HDMI2USB-firmware-prebuilt/archive/debconf17/v0.0.3-742-g9eb83b4/opsis/hdmi2usb/lm32/software/firmware at master · timvideos/HDMI2USB-firmware-prebuilt · GitHub (at github.com)07:58
mithroOkay, reflashing with that firmware08:00
mithropaddatrapper: Now I need to find a jumper, apparently I have my FX2 disconnected from the reset...08:09
paddatrappermithro: if it worked with your unflashed opsis, then it must be something that the video firmware sets that I don't unset or reset properly. That explains why the dev board and atlys worked - they start up by default unflashed08:10
mithropaddatrapper: http://pastebin.ubuntu.com/25368180/08:11
tpbTitle: Ubuntu Pastebin (at pastebin.ubuntu.com)08:11
mithropaddatrapper: That look right?08:11
paddatrappermithro: nope, both gateware and firmware have different hashes08:13
paddatrapperlooking again at the pre-built repo, none of those versions correspond with the one flashed on this Opsis08:13
mithropaddatrapper: Well, that is unfortunate. Maybe you should flash this version too?08:14
paddatrappermithro: yeah. will do08:14
paddatrappermithro: how do I flash using the mode-switch?08:14
mithrohdmi2usb-mode-switch --flash-image flash.bin08:15
mithroyou'll need openocd08:15
paddatrappermithro: ok cool. yeah I have openocd08:16
paddatrappermithro: --flash-image isn't a valid option08:18
paddatrappermithro: never mind, conda version has it08:19
paddatrappermithro: OpenOCD -  Error: Can't find board/numato_opsis.cfg08:24
mithropaddatrapper: "conda install openocd"08:24
mithropaddatrapper: still seems to work?08:26
mithrooh wait, no it doesn't....08:26
mithropaddatrapper: http://pastebin.ubuntu.com/25368236/08:27
tpbTitle: Ubuntu Pastebin (at pastebin.ubuntu.com)08:27
mithropaddatrapper: So today you learn that initial conditions matter :-P08:27
mithropaddatrapper: When I plug in the opsis, my audio goes away :-)08:28
mithropaddatrapper: I'm going to head to dinner08:29
mithropaddatrapper: I'll be back in an hour08:30
paddatrappermithro: ok cool08:30
paddatrappermithro: seems my flash was unsuccessful08:31
mithropaddatrapper: Oh? did you power cycle after flashing?08:31
paddatrappermithro: yup, trying again08:31
mithropaddatrapper: https://github.com/timvideos/HDMI2USB-litex-firmware/blob/master/getting-started.md#common-errors08:32
tpbTitle: HDMI2USB-litex-firmware/getting-started.md at master · timvideos/HDMI2USB-litex-firmware · GitHub (at github.com)08:32
paddatrappermithro: Flash still failing, tried the jtag/serial suggestion08:40
paddatrapperhttp://paste.debian.net/982486/08:40
tpbTitle: debian Pastezone (at paste.debian.net)08:40
*** aeroaks has joined #timvideos08:58
*** aeroaks has quit IRC08:59
*** rohitksingh_work has quit IRC09:13
mithropaddatrapper: Back now09:18
paddatrappermithro: cool09:19
mithropaddatrapper: https://github.com/timvideos/HDMI2USB-litex-firmware/blob/master/getting-started.md#warn-bypassing-jtag-setup-events-due-to-errors09:19
tpbTitle: HDMI2USB-litex-firmware/getting-started.md at master · timvideos/HDMI2USB-litex-firmware · GitHub (at github.com)09:19
paddatrappermithro: did that, didn't help09:20
mithropaddatrapper: How many times did you try?09:20
paddatrappermithro: 2 or 309:20
mithropaddatrapper: Did you try power cycling the board?09:23
paddatrappermithro: yup09:23
mithropaddatrapper: Are you working inside a VM?09:23
paddatrappermithro: no, bare metal09:24
mithropaddatrapper: Can you give me a log of exactly what you did?09:24
mithroAnd make sure you are not using the debian packaged version09:24
mithroplease uninstall that09:24
paddatrapperuninstalled, just waiting for flash-image to finish running09:28
mithropaddatrapper: You can tell if it is working by the DNA it prints09:28
paddatrappermithro: it hasn't got that far yet09:28
paddatrappermithro: currently the only output is WARNING:root:unbind-helper not found, will have to run as root!09:29
mithropaddatrapper: Did you run with --verbose?09:29
*** rohitksingh_work has joined #timvideos09:32
paddatrappermithro: http://paste.debian.net/982495/09:34
tpbTitle: debian Pastezone (at paste.debian.net)09:34
mithropaddatrapper: Can you run each step with --verbose and also you should try doing the flash, then switch to serial, then try the flash again09:35
paddatrappermithro: yay, that seems to be working (switching to serial and then flashing)09:40
paddatrappermithro: ok. flashed09:43
paddatrapperversion matches yours09:43
mithropaddatrapper: Okay09:46
mithropaddatrapper: You might also want to try moving jumper JFX2-RST from Pins 2-3 to Pins 1-2 and then loading your audio09:46
paddatrappermithro: just pushed an update to how the enpoint config is writen. Doesn't fix the issue, but the TRM recommends not changing the config when invalidating an endpoint09:47
paddatrappermithro: ok will try that09:47
paddatrappermithro: and it is working!09:48
paddatrapperwhat does that reset jumper do?09:48
mithropaddatrapper: That jumper prevents the gateware from loading firmware onto the FX209:48
paddatrappermithro: ok. So there is still something that the video firmware is configuring that I am not resetting09:49
mithropaddatrapper: Sounds like it09:49
mithropaddatrapper: You could try loading the video firmware onto the FX2 board and then loading your audio firmware and see if you get the same behaviour...09:50
paddatrappermithro: good idea. Will try that09:50
paddatrappermithro: it fails to set the interface09:52
mithropaddatrapper: Well that is good I guess?09:52
paddatrappermithro: yup, means I don't have to go insane while debugging this :)09:52
mithropaddatrapper: What do you mean go? ;-)09:53
paddatrappermithro: good point...09:53
*** rohitksingh_wor1 has joined #timvideos09:57
mithropaddatrapper: So where are we at with everything?09:57
paddatrappermithro: I need to start working on the final report. audio firmware - works on everything as long as there is no previous firmware on the chip. loopback device - need to figure out how to write to the slave FIFO, my code for reading from it _should_ work09:59
*** rohitksingh_work has quit IRC09:59
paddatrapperaudio firmware works meaning that it generates a tone09:59
mithropaddatrapper: So you haven't gotten the master fifo stuff working?10:24
*** Kripton has quit IRC11:01
*** nikivi has quit IRC11:02
*** shenki has quit IRC11:02
*** jea has quit IRC11:03
*** jea has joined #timvideos11:04
*** Kripton has joined #timvideos11:05
*** nikivi has joined #timvideos11:06
*** shenki has joined #timvideos11:10
*** ChanServ sets mode: +v shenki11:10
paddatrappermithro: sorry got pulled into a meeting. No I haven't11:21
mithropaddatrapper: And you haven't worked on any of the other ideas?11:25
paddatrappermithro: haven't had a chance. DebConf has set me back a lot...11:34
mithrookay, you didn't get much done project wise at DebConf?11:35
*** twoolie has joined #timvideos11:41
paddatrappermithro: I got to test on various pieces of hardware and then equipment arrived, setup happened and I had to fight fires11:44
mithropaddatrapper: What fires did you guys end up with?11:44
paddatrappermithro: We had the venue providing audio in the main talk room, so battled with levels in there a lot. general lack of volunteers and the usual dead batteries and people forgetting to turn things on11:46
paddatrappermithro: could you explain this #define to me?11:49
paddatrapperhttps://github.com/timvideos/HDMI2USB-fx2-firmware/blob/master/hdmi2usb/cdc-config.h#L811:49
tpbTitle: HDMI2USB-fx2-firmware/cdc-config.h at master · timvideos/HDMI2USB-fx2-firmware · GitHub (at github.com)11:49
paddatrapperused with https://github.com/timvideos/HDMI2USB-fx2-firmware/blob/master/hdmi2usb/to-uart.c#L5911:50
tpbTitle: HDMI2USB-fx2-firmware/to-uart.c at master · timvideos/HDMI2USB-fx2-firmware · GitHub (at github.com)11:50
mithropaddatrapper: https://gcc.gnu.org/onlinedocs/cpp/Concatenation.html11:50
tpbTitle: The C Preprocessor: Concatenation (at gcc.gnu.org)11:50
paddatrapperah thanks11:51
*** twoolie has quit IRC11:51
*** sb0 has quit IRC11:55
*** twoolie has joined #timvideos12:18
paddatrappermithro: fixed the firmware - switched to endpoint 8, as that is what will be used in the final firmware anyway and found a off by one error in the set_interface handler12:21
*** twoolie has quit IRC12:22
*** tsglove has quit IRC12:38
*** rohitksingh_wor1 has quit IRC12:43
mithropaddatrapper: When building on travis, which boards do you build for?12:50
paddatrappermithro: Opsis13:10
paddatrappermithro: can be changed using BORD={atlys,fx2miniboard}13:11
paddatrapperI've got to head out for a site visit. I'll be back later13:11
mithroWe should build for all 313:12
cr1901_modern1mithro: API is fully documented (phew) https://www.wdj-consulting.com/libmodem/13:26
tpbTitle: libmodem: Main Page (at www.wdj-consulting.com)13:26
*** cr1901_modern1 is now known as cr1901_modern13:26
cr1901_modernmithro: So the reason for doing this is so whenever we get to this point, it's "simple" to add PIC and FX2 support13:29
cr1901_modernNow to work on SFL receiver13:30
*** tsglove has joined #timvideos14:12
*** rohitksingh has joined #timvideos14:21
paddatrappermithro: working on the final report here: https://docs.google.com/document/d/16eDShtKzo70vBi_XYxIYivrKqvq-xRCOFcRqp2E75Yc/edit?usp=sharing14:38
tpbTitle: GSoC Project Report - Google Docs (at docs.google.com)14:38
*** sb0 has joined #timvideos15:43
*** CarlFK has quit IRC16:24
tumbleweedpaddatrapper: that version should have been the one that was flashed16:52
paddatrappertumbleweed: git hashes didn't match. Maybe commits that didn't make it upstream or something was upstreamed after it was flashed17:13
tumbleweedit could have been an earlier build of that branch17:13
tumbleweedbut then that should have made the prebuilt repo...17:14
*** sb0 has quit IRC17:37
*** rohitksingh has quit IRC18:22
*** sb0 has joined #timvideos19:39
*** CarlFK has joined #timvideos21:21
*** ChanServ sets mode: +v CarlFK21:21
mithrocr1901_modern: so where is the xmodem functionality at?22:22
mithrocr1901_modern: did you get distracted by build systems?22:23
cr1901_modernmithro: It's functional on mimasv222:23
cr1901_modernThe plan was to write the SFL loader tonight22:23
cr1901_modernmithro: I spent the last day writing documentation lol22:23
cr1901_modernmithro: https://www.wdj-consulting.com/libmodem/22:24
tpbTitle: libmodem: Main Page (at www.wdj-consulting.com)22:24
mithropaddatrapper: btw if you write up a specification for how the FPGA side of the FIFO should work, I'll write you FPGA  gateware that follows it22:24
mithropaddatrapper: I basically need "these pins should toggle in this order and have this data" (I think it should be as simple as, provide data on the port X, toggle clock, check if FIFO full flag is set, otherwise repeat - where the data is some type of PCM audio?)22:26
cr1901_modernmithro: The last things to work on are SFL, and quad SPI flash, and QEMU timer (I get xmodem support for free if the latter two work.)22:30
mithrocr1901_modern: so, with your libmodem - I wanted to mention that on the PIC / FX2 you don't really have any RAM so you have to do the decoding "in place" basically reading from the data store in the USB buffer RAM and use it right away22:32
mithro(you also don't want to be dynamically allocating ram either - IE no malloc)22:33
mithrocr1901_modern: dunno if that fits with what your lib can do?22:33
cr1901_modernmithro: The library doesn't malloc22:34
mithrocr1901_modern: oh, you also need to compile with sdcc..22:34
cr1901_modernmithro: Define in-place. For instance, if I use xmodem, I need to accept 128 (+4) bytes at once before writing them. There's no way around that w/ xmodem, since only 128 byte packets are verified22:35
cr1901_modernmithro: I don't need _more_ than 128+4 bytes for buffers, but if I can't buffer at least that much data, then we need a new, smaller protocol.22:36
cr1901_modern(one that only buffers, say, 16 bytes or something before writing them)22:36
mithroWhy do you need to buffer 128 bytes?22:37
cr1901_modernmithro: Oh wait... I don't, you're right.22:37
cr1901_modernmithro: Give me a minute to think please22:38
mithrocr1901_modern: no worries - I think you need 128 bytes if you want to do something like check the packet before writing it - but if you are happy to write it and then just report the error and start again you should only need a couple of bytes, right?22:39
cr1901_modernmithro: Yes, and that's fine as long as I'm not writing to flash I imagine. Nothing in principle prevents supporting this, but right now the xmodem impl doesn't support what you're asking for. The impl expects to receive a full buffer of data and verify it before writing.22:41
cr1901_modernI figured 128 bytes would be small enough for this not to be a concern. Guess not lol22:41
mithroI think the pic only has order of 256 bytes of data memory IIRC22:43
cr1901_modernHow much of it is used?22:44
mithroDunno, but I'm pretty sure that we don't want to use 128 of 256 on an xmodem buffer..22:45
mithroThe FX2 has 16k of ram but all the code has to fit in that too22:46
mithroStupid low memory devices :-P22:46
cr1901_modernWell, prob the easiest method to do this is to add a "size hint" parameter to xmodem_rx (only do rx for now)22:47
cr1901_modernand each time the data_out callback is called, it receives a "buf_size" of "size_hint"22:48
cr1901_modernOnly problem is I don't know how to calculate CRC16 "n" bytes at a time22:49
cr1901_modernmithro: Again I need to think about this. It would be potentially very ugly to attempt to graft these features into the current working implementation.22:53
mithrocr1901_modern: the crc16 function just loops over the bytes updating a couple of values22:55
mithroYou just hoist the values into globals and call the crc calc as you get the bytes22:56
mithropaddatrapper: is your report mostly empty at the moment?22:56
mithrocr1901_modern: so, how do I test the mimasv2 stuff?23:01
*** sb0 has quit IRC23:05
mithroBblr23:06

Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!