Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > sci.electronics.design > #541062 > unrolled thread
| Started by | bitrex <user@example.net> |
|---|---|
| First post | 2019-04-28 15:11 -0400 |
| Last post | 2019-05-14 13:45 +0100 |
| Articles | 20 on this page of 46 — 14 participants |
Back to article view | Back to sci.electronics.design
Video data compression for serial link bitrex <user@example.net> - 2019-04-28 15:11 -0400
Re: Video data compression for serial link whit3rd <whit3rd@gmail.com> - 2019-04-28 13:12 -0700
Re: Video data compression for serial link Hul Tytus <ht@panix.com> - 2019-04-28 20:25 +0000
Re: Video data compression for serial link bitrex <user@example.net> - 2019-04-28 16:31 -0400
Re: Video data compression for serial link Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2019-04-29 14:16 +0300
Re: Video data compression for serial link gnuarm.deletethisbit@gmail.com - 2019-04-29 04:10 -0700
Re: Video data compression for serial link bitrex <user@example.net> - 2019-04-29 13:04 -0400
Re: Video data compression for serial link Joe Chisolm <jchisolm6@earthlink.net> - 2019-04-29 13:20 -0500
Re: Video data compression for serial link dplatt@coop.radagast.org (Dave Platt) - 2019-04-29 11:21 -0700
Re: Video data compression for serial link DecadentLinuxUserNumeroUno@decadence.org - 2019-04-29 18:56 +0000
Re: Video data compression for serial link DecadentLinuxUserNumeroUno@decadence.org - 2019-04-29 19:13 +0000
Re: Video data compression for serial link Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2019-04-29 22:41 +0300
Re: Video data compression for serial link DecadentLinuxUserNumeroUno@decadence.org - 2019-04-30 00:53 +0000
Re: Video data compression for serial link Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2019-04-30 10:24 +0300
Re: Video data compression for serial link DecadentLinuxUserNumeroUno@decadence.org - 2019-04-30 09:59 +0000
Re: Video data compression for serial link Rick C <gnuarm.deletethisbit@gmail.com> - 2019-05-08 17:59 -0700
Re: Video data compression for serial link dplatt@coop.radagast.org (Dave Platt) - 2019-05-09 10:42 -0700
Re: Video data compression for serial link upsidedown@downunder.com - 2019-05-09 06:56 +0300
Re: Video data compression for serial link dplatt@coop.radagast.org (Dave Platt) - 2019-04-29 12:58 -0700
Re: Video data compression for serial link bitrex <user@example.net> - 2019-04-29 16:33 -0400
Re: Video data compression for serial link dplatt@coop.radagast.org (Dave Platt) - 2019-04-30 18:02 -0700
Re: Video data compression for serial link bitrex <user@example.net> - 2019-04-30 21:13 -0400
Re: Video data compression for serial link Lasse Langwadt Christensen <langwadt@fonz.dk> - 2019-04-30 18:32 -0700
Re: Video data compression for serial link DecadentLinuxUserNumeroUno@decadence.org - 2019-04-30 00:59 +0000
Re: Video data compression for serial link Lasse Langwadt Christensen <langwadt@fonz.dk> - 2019-04-29 18:27 -0700
Re: Video data compression for serial link Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2019-04-30 10:22 +0100
Re: Video data compression for serial link bitrex <user@example.net> - 2019-04-30 12:20 -0400
Re: Video data compression for serial link upsidedown@downunder.com - 2019-04-30 20:19 +0300
Re: Video data compression for serial link DecadentLinuxUserNumeroUno@decadence.org - 2019-04-30 22:04 +0000
Re: Video data compression for serial link whit3rd <whit3rd@gmail.com> - 2019-04-30 16:30 -0700
Re: Video data compression for serial link Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2019-05-01 08:49 +0100
Re: Video data compression for serial link bitrex <user@example.net> - 2019-05-01 10:28 -0400
Re: Video data compression for serial link upsidedown@downunder.com - 2019-04-30 13:50 +0300
Re: Video data compression for serial link david eather <eatDELETEher@tpg.com.au> - 2019-05-01 13:45 +1000
Re: Video data compression for serial link bitrex <user@example.net> - 2019-05-08 16:57 -0400
Re: Video data compression for serial link Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2019-05-08 22:22 +0100
Re: Video data compression for serial link bitrex <user@example.net> - 2019-05-08 22:09 -0400
Re: Video data compression for serial link bitrex <user@example.net> - 2019-05-08 22:11 -0400
Re: Video data compression for serial link Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2019-05-09 08:44 +0100
Re: Video data compression for serial link bitrex <user@example.net> - 2019-05-09 10:41 -0400
Re: Video data compression for serial link bitrex <user@example.net> - 2019-05-09 10:52 -0400
Re: Video data compression for serial link david eather <eatDELETEher@tpg.com.au> - 2019-05-10 14:30 +1000
Re: Video data compression for serial link jrwalliker@gmail.com - 2019-05-10 04:30 -0700
Re: Video data compression for serial link Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2019-05-14 11:17 +0100
Re: Video data compression for serial link upsidedown@downunder.com - 2019-05-14 14:51 +0300
Re: Video data compression for serial link Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2019-05-14 13:45 +0100
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
| From | dplatt@coop.radagast.org (Dave Platt) |
|---|---|
| Date | 2019-04-30 18:02 -0700 |
| Message-ID | <1q7npf-gch.ln1@coop.radagast.org> |
| In reply to | #541178 |
In article <KcJxE.768986$Z%2.2694@fx48.iad>, bitrex <user@example.net> wrote: >Yes, the device we're using is ACM. on linux the uP's port is accessed >thru /dev/ttyACM0. On a Mac its identifier is some bizarre gibberish but >works the same. > >On the API side of things however there does seem to be a concept of >'baud rate' as one still has to define a link speed in software prior to >transmitting or receiving data. I sent back and re-checked this, and you're right - that sort of negotiation is supported, although not mandatory. The endpoint is what's known as a CDC (Communications Device Class). This class has commands defined which allow the host to query, and set, the line coding (bits per character, stop bits, baud rate) and the hardware handshaking. In effect, you _can_ do to a full-featured CDC, what you can do to a normal host-attached serial port. I recall now that I have a small USB-attached faxmodem at home which works this way. You could, if you wish, actually implement an RS-232 serial port via such a CDC endpoint, with full hardware handshaking. In effect, this class is capable of being a standards-conforming equivalent to the sorts of proprietary USB implementations that FTDI and Prologix and etc. do in their serial-to-USB converters. It's also possible to implement a CDC which does not implement these line-related commands at all - they're optional. You'd do this if you want a CDC which behaves very much like a speed-independent, hardware-independent serial port... that is, you can send a string of bytes to it, read bytes back, operate in full or half duplex, etc., but without having to worry about the concept of baud rate. You might, for example, implement a speed-less CDC inside a microcontroller, creating a "console" or "terminal" interface. This would be more efficient and reliable, in some ways, than using the micro's own RX and TX serial port pins, because the traffic between host and micro would be carried directly in USB "URBs" as sequences of bytes with full flow control. There would never be a need to do RS-232-serial-like conversion between bytes, and individual bits flowing over a single serial line. You could read or write hundreds of bytes per operation, rather than having to take individual interrupts every character or every few characters.
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-04-30 21:13 -0400 |
| Message-ID | <Ao6yE.150197$7y4.47822@fx25.iad> |
| In reply to | #541335 |
On 4/30/19 9:02 PM, Dave Platt wrote: > In article <KcJxE.768986$Z%2.2694@fx48.iad>, bitrex <user@example.net> wrote: > > >> Yes, the device we're using is ACM. on linux the uP's port is accessed >> thru /dev/ttyACM0. On a Mac its identifier is some bizarre gibberish but >> works the same. >> >> On the API side of things however there does seem to be a concept of >> 'baud rate' as one still has to define a link speed in software prior to >> transmitting or receiving data. > > I sent back and re-checked this, and you're right - that sort of > negotiation is supported, although not mandatory. > > The endpoint is what's known as a CDC (Communications Device Class). > This class has commands defined which allow the host to query, and > set, the line coding (bits per character, stop bits, baud rate) and > the hardware handshaking. In effect, you _can_ do to a full-featured > CDC, what you can do to a normal host-attached serial port. > > I recall now that I have a small USB-attached faxmodem at home which > works this way. > > You could, if you wish, actually implement an RS-232 serial port via > such a CDC endpoint, with full hardware handshaking. In effect, this > class is capable of being a standards-conforming equivalent to the > sorts of proprietary USB implementations that FTDI and Prologix and > etc. do in their serial-to-USB converters. > > It's also possible to implement a CDC which does not implement these > line-related commands at all - they're optional. You'd do this if you > want a CDC which behaves very much like a speed-independent, > hardware-independent serial port... that is, you can send a string of > bytes to it, read bytes back, operate in full or half duplex, etc., > but without having to worry about the concept of baud rate. > > You might, for example, implement a speed-less CDC inside a > microcontroller, creating a "console" or "terminal" interface. This > would be more efficient and reliable, in some ways, than using the > micro's own RX and TX serial port pins, because the traffic between > host and micro would be carried directly in USB "URBs" as sequences of > bytes with full flow control. There would never be a need to do > RS-232-serial-like conversion between bytes, and individual bits > flowing over a single serial line. You could read or write hundreds > of bytes per operation, rather than having to take individual > interrupts every character or every few characters. > > > This looks like an example of what you're talking about: <https://mcuoneclipse.com/2015/04/15/usb-cdc-with-the-teensy-3-1-board/> Seems promising; strict serial is more appropriate for intermittent async communication what I really need is higher bandwidth continuous transmission
[toc] | [prev] | [next] | [standalone]
| From | Lasse Langwadt Christensen <langwadt@fonz.dk> |
|---|---|
| Date | 2019-04-30 18:32 -0700 |
| Message-ID | <f858dbeb-9a50-4622-a4af-8af4ab2b1762@googlegroups.com> |
| In reply to | #541335 |
onsdag den 1. maj 2019 kl. 03.02.36 UTC+2 skrev Dave Platt: > In article <KcJxE.768986$Z%2.2694@fx48.iad>, bitrex <user@example.net> wrote: > > > >Yes, the device we're using is ACM. on linux the uP's port is accessed > >thru /dev/ttyACM0. On a Mac its identifier is some bizarre gibberish but > >works the same. > > > >On the API side of things however there does seem to be a concept of > >'baud rate' as one still has to define a link speed in software prior to > >transmitting or receiving data. > > I sent back and re-checked this, and you're right - that sort of > negotiation is supported, although not mandatory. > > The endpoint is what's known as a CDC (Communications Device Class). > This class has commands defined which allow the host to query, and > set, the line coding (bits per character, stop bits, baud rate) and > the hardware handshaking. In effect, you _can_ do to a full-featured > CDC, what you can do to a normal host-attached serial port. > > I recall now that I have a small USB-attached faxmodem at home which > works this way. > > You could, if you wish, actually implement an RS-232 serial port via > such a CDC endpoint, with full hardware handshaking. In effect, this > class is capable of being a standards-conforming equivalent to the > sorts of proprietary USB implementations that FTDI and Prologix and > etc. do in their serial-to-USB converters. > > It's also possible to implement a CDC which does not implement these > line-related commands at all - they're optional. You'd do this if you > want a CDC which behaves very much like a speed-independent, > hardware-independent serial port... that is, you can send a string of > bytes to it, read bytes back, operate in full or half duplex, etc., > but without having to worry about the concept of baud rate. > > You might, for example, implement a speed-less CDC inside a > microcontroller, creating a "console" or "terminal" interface. This > would be more efficient and reliable, in some ways, than using the > micro's own RX and TX serial port pins, because the traffic between > host and micro would be carried directly in USB "URBs" as sequences of > bytes with full flow control. There would never be a need to do > RS-232-serial-like conversion between bytes, and individual bits > flowing over a single serial line. You could read or write hundreds > of bytes per operation, rather than having to take individual > interrupts every character or every few characters. but then the MCU has to handle USB instead of just DMAing bytes to a UART so it isn't necessarily any better
[toc] | [prev] | [next] | [standalone]
| From | DecadentLinuxUserNumeroUno@decadence.org |
|---|---|
| Date | 2019-04-30 00:59 +0000 |
| Message-ID | <qa86mf$8df$1@gioia.aioe.org> |
| In reply to | #541175 |
dplatt@coop.radagast.org (Dave Platt) wrote in
news:gk1kpf-pk6.ln1@coop.radagast.org:
> In article <qa7hca$1brk$1@gioia.aioe.org>,
> <DecadentLinuxUserNumeroUno@decadence.org> wrote:
>>dplatt@coop.radagast.org (Dave Platt) wrote in
>>news:jurjpf-fm5.ln1@coop.radagast.org:
>>
>>> In article <B8GxE.398358$oy5.350898@fx06.iad>,
>>> bitrex <user@example.net> wrote:
>>>
>>>>The KISS communication implementation works perfectly fine for a
>>>>while and then both the uP and PC app lock and it fails utterly.
>>>>transmission stops. annoying problem to diagnose. Logging the
>>>>data on the link doesn't show anything unusual just prior to it
>>>>happening.
>>>
>>> What USB-to-serial adapter/dongle are you using?
>>>
>>> I had somewhat-similar problems when trying to run a Bitscope
>>> from a PC... it would work for a while and then the
>>> communication would freeze up.
>>>
>>> The problem appeared to be the USB adapter I was using. It was
>>> one of the inexpensive "translucent blue" adapters, that claim
>>> to have a Prologix PL-2303 serial-to-USB bridge inside... but
>>> very probably had a clone/counterfeit chip instead. I've heard
>>> other reports of these counterfeit chips locking up under heavy
>>> load... timing or chip-firmware problem, I suspect.
>>>
>>> I swapped the adapter for a known-good FTDI serial adapter
>>> (Mouser and Digi-Key are both authorized FTDI distributors, so
>>> you can be pretty confident that they aren't selling
>>> counterfeits) and the problem went away.
>>>
>>> As to compression: A simple logarithmic-encoding scheme (akin
>>> to A-law or u-law), followed by a run-length-encoding, might do
>>> what you want, without introducing too many artifacts (although
>>> there will be some). Another approach would be a 16-to-8-bit
>>> quantization with Floyd-Steinberg error diffusion... this will
>>> give you a fixed 2:1 compression with (I think) fairly decent
>>> visual quality, and it would be quite fast to implement.
>>>
>>>
>>
>>USB is a serial interface. Doesn't putty interface directly to a
>>usb port without a serial adapter?
>
> No, in general it does not.
>
> USB is a serial bus. It's not either electrically- or
> protocol-compatible with a "serial port" in the sense that most
> people have used the term historically (an asynchonous serial
> port, using either RS-232 voltage levels or a TTL-voltage
> sort-of-approximation of same). Instead, a device plugged into a
> USB bus adopts a device address, and then presents the host with a
> flexible set of "USB endpoints" which can receive, and send,
> various sorts of packetized data.
>
> "putty" and similar terminal emulators assume the existence of a
> kernel device interface which "looks like" a PC serial port
> interface at the software level... that is, it supports
> arbitrary-length reads and writes, it has a concept of "baud
> rate", it implements (or pretends to implement) normal RS-232
> handshaking, and so forth. A "real" serial port will present such
> an interface as (e.g.) /dev/ttyS0. The Linux console emulates
> such a device as (e.g.) /dev/tty0, /dev/tty1, and so forth.
>
> If you try to tell putty to (e.g.) "open up and talk to whatever
> is plugged into USB port 2 on the front of my machine" it will
> have no idea what you're talking about. It can't talk to USB
> ports per se, nor to arbitrary USB devices. It can only talk to
> thinks that "look like" RS-232 serial ports at the programming
> level.
>
> USB serial adapters have one or more data endpoints, that can be
> recognized by their device drivers. The device driver then
> presents a programming interface such as (e.g.) /dev/ttyUSB0. The
> driver translates between the kernel's normal "serial port"
> programming API, and the necessary packet-oriented communication
> with the USB serial adapter (and this packetized communication is
> usually manufacturer- specific and often device-specific).
>
> These days, when you hook a PC to a microcontrollers via a
> "serial" connection, it's common to use such a USB serial adapter
> (and the necessary driver on the PC side). On the
> microcontrollers side, the communication is often "TTL serial",
> using TTL or CMOS voltage levels, and inverted in polarity from
> what RS-232 requires. Most microprocessors which have "serial
> port" pins, expect this sort of signaling. Some have the
> necessary USB-to-serial chip on the micro board (it's often called
> a "USB bridge" in this case), and these micros can be cabled
> directly to a USB port on a computer. The USB-to-serial adapter
> is still present (you just don't see it as a separate piece of
> hardware) and you still need a serial-port- emulation driver on
> the PC.
>
> There are a few microcontrollers which provide their own "native
> USB" communication interface and endpoint... usually using a newer
> standard called ACM ("asynchronous communication module" I
> believe... could be wrong). Linux will show these as (e.g.)
> /dev/ttyACM0, /dev/ttyACM1, and so forth. You can think of these
> as "built-in USB-to-serial-like protocol, which provides buffered
> bidirectional communication at USB speeds, doesn't have the
> concept of 'baud rate', and doesn't pretend to implement RS-232
> hardware handshaking or flow control pins." You still need a
> driver on the PC side for such devices, but Linux (for one)
> provides a standard driver which should work with any such device.
>
> putty and similar programs will work with ACMs just as they work
> with RS-232 serial ports, Linux consoles, and vendor-proprietary
> USB-to-serial adapters.
>
> There are also "USB gadgets", which is a whole different level of
> complexity. The BeagleBone Black board takes on the role of a
> network-interface-like gadget when you plug it into a PC - the
> kernel sees what appears to be an Ethernet-like interface and can
> run normal networking protocols over the cable.
>
Very nice and succinct. Thanks for that.
I have a small computer that has a USB tty interface for attaching
a keyboard to I think. So I think the USB spec has some kind of
proviso for adopting one of the ports in some sort of psuedo
addressable port. But I definitely do not know.
I think it is the same thing the USB to serial dongle guys use.
[toc] | [prev] | [next] | [standalone]
| From | Lasse Langwadt Christensen <langwadt@fonz.dk> |
|---|---|
| Date | 2019-04-29 18:27 -0700 |
| Message-ID | <19512d19-5e3c-4a22-ba2b-ae0e437f0287@googlegroups.com> |
| In reply to | #541195 |
tirsdag den 30. april 2019 kl. 03.00.06 UTC+2 skrev DecadentLinux...@decadence.org:
> dplatt@coop.radagast.org (Dave Platt) wrote in
> news:gk1kpf-pk6.ln1@coop.radagast.org:
>
> > In article <qa7hca$1brk$1@gioia.aioe.org>,
> > <DecadentLinuxUserNumeroUno@decadence.org> wrote:
> >>dplatt@coop.radagast.org (Dave Platt) wrote in
> >>news:jurjpf-fm5.ln1@coop.radagast.org:
> >>
> >>> In article <B8GxE.398358$oy5.350898@fx06.iad>,
> >>> bitrex <user@example.net> wrote:
> >>>
> >>>>The KISS communication implementation works perfectly fine for a
> >>>>while and then both the uP and PC app lock and it fails utterly.
> >>>>transmission stops. annoying problem to diagnose. Logging the
> >>>>data on the link doesn't show anything unusual just prior to it
> >>>>happening.
> >>>
> >>> What USB-to-serial adapter/dongle are you using?
> >>>
> >>> I had somewhat-similar problems when trying to run a Bitscope
> >>> from a PC... it would work for a while and then the
> >>> communication would freeze up.
> >>>
> >>> The problem appeared to be the USB adapter I was using. It was
> >>> one of the inexpensive "translucent blue" adapters, that claim
> >>> to have a Prologix PL-2303 serial-to-USB bridge inside... but
> >>> very probably had a clone/counterfeit chip instead. I've heard
> >>> other reports of these counterfeit chips locking up under heavy
> >>> load... timing or chip-firmware problem, I suspect.
> >>>
> >>> I swapped the adapter for a known-good FTDI serial adapter
> >>> (Mouser and Digi-Key are both authorized FTDI distributors, so
> >>> you can be pretty confident that they aren't selling
> >>> counterfeits) and the problem went away.
> >>>
> >>> As to compression: A simple logarithmic-encoding scheme (akin
> >>> to A-law or u-law), followed by a run-length-encoding, might do
> >>> what you want, without introducing too many artifacts (although
> >>> there will be some). Another approach would be a 16-to-8-bit
> >>> quantization with Floyd-Steinberg error diffusion... this will
> >>> give you a fixed 2:1 compression with (I think) fairly decent
> >>> visual quality, and it would be quite fast to implement.
> >>>
> >>>
> >>
> >>USB is a serial interface. Doesn't putty interface directly to a
> >>usb port without a serial adapter?
> >
> > No, in general it does not.
> >
> > USB is a serial bus. It's not either electrically- or
> > protocol-compatible with a "serial port" in the sense that most
> > people have used the term historically (an asynchonous serial
> > port, using either RS-232 voltage levels or a TTL-voltage
> > sort-of-approximation of same). Instead, a device plugged into a
> > USB bus adopts a device address, and then presents the host with a
> > flexible set of "USB endpoints" which can receive, and send,
> > various sorts of packetized data.
> >
> > "putty" and similar terminal emulators assume the existence of a
> > kernel device interface which "looks like" a PC serial port
> > interface at the software level... that is, it supports
> > arbitrary-length reads and writes, it has a concept of "baud
> > rate", it implements (or pretends to implement) normal RS-232
> > handshaking, and so forth. A "real" serial port will present such
> > an interface as (e.g.) /dev/ttyS0. The Linux console emulates
> > such a device as (e.g.) /dev/tty0, /dev/tty1, and so forth.
> >
> > If you try to tell putty to (e.g.) "open up and talk to whatever
> > is plugged into USB port 2 on the front of my machine" it will
> > have no idea what you're talking about. It can't talk to USB
> > ports per se, nor to arbitrary USB devices. It can only talk to
> > thinks that "look like" RS-232 serial ports at the programming
> > level.
> >
> > USB serial adapters have one or more data endpoints, that can be
> > recognized by their device drivers. The device driver then
> > presents a programming interface such as (e.g.) /dev/ttyUSB0. The
> > driver translates between the kernel's normal "serial port"
> > programming API, and the necessary packet-oriented communication
> > with the USB serial adapter (and this packetized communication is
> > usually manufacturer- specific and often device-specific).
> >
> > These days, when you hook a PC to a microcontrollers via a
> > "serial" connection, it's common to use such a USB serial adapter
> > (and the necessary driver on the PC side). On the
> > microcontrollers side, the communication is often "TTL serial",
> > using TTL or CMOS voltage levels, and inverted in polarity from
> > what RS-232 requires. Most microprocessors which have "serial
> > port" pins, expect this sort of signaling. Some have the
> > necessary USB-to-serial chip on the micro board (it's often called
> > a "USB bridge" in this case), and these micros can be cabled
> > directly to a USB port on a computer. The USB-to-serial adapter
> > is still present (you just don't see it as a separate piece of
> > hardware) and you still need a serial-port- emulation driver on
> > the PC.
> >
> > There are a few microcontrollers which provide their own "native
> > USB" communication interface and endpoint... usually using a newer
> > standard called ACM ("asynchronous communication module" I
> > believe... could be wrong). Linux will show these as (e.g.)
> > /dev/ttyACM0, /dev/ttyACM1, and so forth. You can think of these
> > as "built-in USB-to-serial-like protocol, which provides buffered
> > bidirectional communication at USB speeds, doesn't have the
> > concept of 'baud rate', and doesn't pretend to implement RS-232
> > hardware handshaking or flow control pins." You still need a
> > driver on the PC side for such devices, but Linux (for one)
> > provides a standard driver which should work with any such device.
> >
> > putty and similar programs will work with ACMs just as they work
> > with RS-232 serial ports, Linux consoles, and vendor-proprietary
> > USB-to-serial adapters.
> >
> > There are also "USB gadgets", which is a whole different level of
> > complexity. The BeagleBone Black board takes on the role of a
> > network-interface-like gadget when you plug it into a PC - the
> > kernel sees what appears to be an Ethernet-like interface and can
> > run normal networking protocols over the cable.
> >
>
> Very nice and succinct. Thanks for that.
>
> I have a small computer that has a USB tty interface for attaching
> a keyboard to I think. So I think the USB spec has some kind of
> proviso for adopting one of the ports in some sort of psuedo
> addressable port. But I definitely do not know.
>
> I think it is the same thing the USB to serial dongle guys use.
the driver talks USB on one side and pretends to be a seriel port (tty)
on the other side, the various USB-serial port adapters all do it differently
though there is afaik a standard for it
[toc] | [prev] | [next] | [standalone]
| From | Martin Brown <'''newspam'''@nezumi.demon.co.uk> |
|---|---|
| Date | 2019-04-30 10:22 +0100 |
| Message-ID | <qa943s$67m$1@gioia.aioe.org> |
| In reply to | #541159 |
On 29/04/2019 18:04, bitrex wrote: > On 4/29/19 7:10 AM, gnuarm.deletethisbit@gmail.com wrote: >> On Sunday, April 28, 2019 at 3:11:55 PM UTC-4, bitrex wrote: >>> I have a client who needs to send 10 bit greyscale video data >>> over a serial link from a PC to an ARM Cortex uP. Right now just using a >>> KISS implementation, constant-overhead-byte-stuffing protocol, two bytes >>> per value, with a simple CRC-type checksum appended to each scanline the >>> link needs to be around 384kbps to support the amount of >>> data required to transmit. >>> >>> the hardware is on-paper capable of that but in practice the lash up is >>> unstable, there's a bottleneck somewhere, most likely on the PC side as >>> it's not a "real" hardware serial port but virtualized via USB and it >>> has to go thru all the multiple layers of abstraction from the >>> application until it finally gets spit out; the application code isn't >>> even complied it's from a scripting language. Windoze is nothing like an RTOS and has always been dodgy at fast serial data since forever. My money is on a FIFO buffer overflow whilst the PC is off doing something "more important" - screen updating or disk IO. >>> >>> Using compiled C/C++ that can do system calls directly will probably >>> help but I'm also looking for ways to compress the serial stream >>> bandwidth. For 10 bit greyscale data I was thinking that just something >>> like u-law or A-law encoding could significantly reduce the bandwidth >>> without resorting to more compute-intensive bespoke video compression >>> algorithms. Primary requirement is that the link needs to be very >>> fault-tolerant and reliable for long term operation >> >> What does "unstable" mean? Do you loose data or are there simply >> variable delays? Do you buffer up data in the CPU for display? I >> would think you'd want to understand the problem before you try to >> find a cure. > > The KISS communication implementation works perfectly fine for a while > and then both the uP and PC app lock and it fails utterly. transmission > stops. annoying problem to diagnose. Logging the data on the link > doesn't show anything unusual just prior to it happening. OK the first thing to try is drop the most significant bytes entirely and live with bullseye effects on the highlights to see if as a proof of concept halving the volume of data will bring it back under control. If that works then you have two basic KISS choices: Transform the 10 bit data into 8 bit data using a lookup table y' = INT(8*sqrt(y)+0.5) would do for a start Or since you know you must have an average step of 4 and have 1024 levels to transform into 256 output levels choose something like if (y<65) y' = y else y' = A + (y-64)/5 As a piecewise linear approximation to a nonlinear tranform that preserves all the dynamic range at the low end at the expense of highlight detail. Better approximations are available and you might want to think carefully about rounding rules to preserve details. The other option if you have a bit more time to spare on the encoding side is for each line OR the high bytes together and based on that result send a scaled version and a tag in the line CRC to say whether the line scaling is 1x, 2x or 4x. > About all I can say at this point is that it doesn't happen (at least > not over the course of a day's runtime) at lower data rates. And that > since the transmission is only one-way I don't see any good reason for > the PC application to lock up other than the issue originating on that > side of things. How locked up it is? Is it just the user application that is unresponsive or has the thing really gone AWOL inside a driver? How fast are you running the serial link? >> I don't think the eye has the same sensitivity to light as the ear >> does to sound. uLaw works by approximating a log relationship which >> matches human sensitivity to sound. More resolution is given to soft >> sounds extending the effective number of bits than what is transmitted. > > all human senses are more-or-less logarithmic in response. the > difference in actual brightness between walking outside into a bright > spring morning like today, from say an office lit in a usual office-way > with ceiling fluorescents is like, a million times brighter outside > (sorry not really an optics-guy I don't know the appropriate unit to > use, here.) but we don't go blind > >> If you are convinced the problem is too high bandwidth, I agree with >> Hul, you are adding 6 bits of overhead by having empty bits on each >> word. With Hul's packing you can shove the CRC and a sync bit into a >> 32 bit word and get a 60% bandwidth increase. If you need to, do the >> data reshuffling and CRC check in a small FPGA and present the CPU a >> FIFO interface via SPI like signals where the overhead isn't important. >> > > In any case it was just an idea on how two bytes of data could be > stuffed into one, in fact since the data is only 10 bits I'd first just > try right shifting 2 on the way out then left shifting on reception. > > It may be that the re-write of the transmission code in C solves the > immediate problem so some of my request is just for my reference if > further optimization should be necessary. Byte-packing, at the very > least, doesn't seem like premature optimization regardless. I think making the transmission code go even faster will almost certainly make things worse if the problem is due to buffer overflow in the PC end serial receiver. > > I've been doing a CRC for each line rather than each frame as the client > doesn't need pixel-by-pixel correctness, if a line is wrong then just > dump it and wait for the next frame. Quick and dirty test is send only the least significant byte and see if that ever locks up. At least then you have a working baseline again. The other trick might be to run the PC side in a debugger and hope to catch the trap inside the errant driver. There may be options on the fake serial implementation driver to make its IO buffers deeper. Good serial drivers are possible on a PC but not in Windoze. The OS/2 serial driver was capable of implementing full 16550 hardware FIFO behaviour on the crudest bare metal original stone age serial ports. -- Regards, Martin Brown
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-04-30 12:20 -0400 |
| Message-ID | <MB_xE.1039424$VB3.619629@fx45.iad> |
| In reply to | #541237 |
On 4/30/19 5:22 AM, Martin Brown wrote: > On 29/04/2019 18:04, bitrex wrote: >> On 4/29/19 7:10 AM, gnuarm.deletethisbit@gmail.com wrote: >>> On Sunday, April 28, 2019 at 3:11:55 PM UTC-4, bitrex wrote: >>>> I have a client who needs to send 10 bit greyscale video data >>>> over a serial link from a PC to an ARM Cortex uP. Right now just >>>> using a >>>> KISS implementation, constant-overhead-byte-stuffing protocol, two >>>> bytes >>>> per value, with a simple CRC-type checksum appended to each scanline >>>> the >>>> link needs to be around 384kbps to support the amount of >>>> data required to transmit. >>>> >>>> the hardware is on-paper capable of that but in practice the lash up is >>>> unstable, there's a bottleneck somewhere, most likely on the PC side as >>>> it's not a "real" hardware serial port but virtualized via USB and it >>>> has to go thru all the multiple layers of abstraction from the >>>> application until it finally gets spit out; the application code isn't >>>> even complied it's from a scripting language. > > Windoze is nothing like an RTOS and has always been dodgy at fast serial > data since forever. My money is on a FIFO buffer overflow whilst the PC > is off doing something "more important" - screen updating or disk IO. >>>> >>>> Using compiled C/C++ that can do system calls directly will probably >>>> help but I'm also looking for ways to compress the serial stream >>>> bandwidth. For 10 bit greyscale data I was thinking that just something >>>> like u-law or A-law encoding could significantly reduce the bandwidth >>>> without resorting to more compute-intensive bespoke video compression >>>> algorithms. Primary requirement is that the link needs to be very >>>> fault-tolerant and reliable for long term operation >>> >>> What does "unstable" mean? Do you loose data or are there simply >>> variable delays? Do you buffer up data in the CPU for display? I >>> would think you'd want to understand the problem before you try to >>> find a cure. >> >> The KISS communication implementation works perfectly fine for a while >> and then both the uP and PC app lock and it fails utterly. >> transmission stops. annoying problem to diagnose. Logging the data on >> the link doesn't show anything unusual just prior to it happening. > > OK the first thing to try is drop the most significant bytes entirely > and live with bullseye effects on the highlights to see if as a proof of > concept halving the volume of data will bring it back under control. > > If that works then you have two basic KISS choices: > > Transform the 10 bit data into 8 bit data using a lookup table > > y' = INT(8*sqrt(y)+0.5) would do for a start > > Or since you know you must have an average step of 4 and have 1024 > levels to transform into 256 output levels choose something like > > if (y<65) y' = y > else y' = A + (y-64)/5 > > As a piecewise linear approximation to a nonlinear tranform that > preserves all the dynamic range at the low end at the expense of > highlight detail. Better approximations are available and you might want > to think carefully about rounding rules to preserve details. > > The other option if you have a bit more time to spare on the encoding > side is for each line OR the high bytes together and based on that > result send a scaled version and a tag in the line CRC to say whether > the line scaling is 1x, 2x or 4x. > >> About all I can say at this point is that it doesn't happen (at least >> not over the course of a day's runtime) at lower data rates. And that >> since the transmission is only one-way I don't see any good reason for >> the PC application to lock up other than the issue originating on that >> side of things. > > How locked up it is? Is it just the user application that is > unresponsive or has the thing really gone AWOL inside a driver? > > How fast are you running the serial link? > >>> I don't think the eye has the same sensitivity to light as the ear >>> does to sound. uLaw works by approximating a log relationship which >>> matches human sensitivity to sound. More resolution is given to soft >>> sounds extending the effective number of bits than what is transmitted. >> >> all human senses are more-or-less logarithmic in response. the >> difference in actual brightness between walking outside into a bright >> spring morning like today, from say an office lit in a usual >> office-way with ceiling fluorescents is like, a million times brighter >> outside (sorry not really an optics-guy I don't know the appropriate >> unit to use, here.) but we don't go blind >> >>> If you are convinced the problem is too high bandwidth, I agree with >>> Hul, you are adding 6 bits of overhead by having empty bits on each >>> word. With Hul's packing you can shove the CRC and a sync bit into a >>> 32 bit word and get a 60% bandwidth increase. If you need to, do the >>> data reshuffling and CRC check in a small FPGA and present the CPU a >>> FIFO interface via SPI like signals where the overhead isn't important. >>> >> >> In any case it was just an idea on how two bytes of data could be >> stuffed into one, in fact since the data is only 10 bits I'd first >> just try right shifting 2 on the way out then left shifting on reception. >> >> It may be that the re-write of the transmission code in C solves the >> immediate problem so some of my request is just for my reference if >> further optimization should be necessary. Byte-packing, at the very >> least, doesn't seem like premature optimization regardless. > > I think making the transmission code go even faster will almost > certainly make things worse if the problem is due to buffer overflow in > the PC end serial receiver. >> >> I've been doing a CRC for each line rather than each frame as the >> client doesn't need pixel-by-pixel correctness, if a line is wrong >> then just dump it and wait for the next frame. > > Quick and dirty test is send only the least significant byte and see if > that ever locks up. At least then you have a working baseline again. > > The other trick might be to run the PC side in a debugger and hope to > catch the trap inside the errant driver. There may be options on the > fake serial implementation driver to make its IO buffers deeper. > > Good serial drivers are possible on a PC but not in Windoze. The OS/2 > serial driver was capable of implementing full 16550 hardware FIFO > behaviour on the crudest bare metal original stone age serial ports. > Thank you Martin, you have good suggestions here that will take me some time to explore but I'll update when I have more answers. The good news is this design will be talking to Macs or Linux machines only - no Windows here.
[toc] | [prev] | [next] | [standalone]
| From | upsidedown@downunder.com |
|---|---|
| Date | 2019-04-30 20:19 +0300 |
| Message-ID | <chvgceptjabvns9b4h6049ogl10ui76mjt@4ax.com> |
| In reply to | #541237 |
On Tue, 30 Apr 2019 10:22:03 +0100, Martin Brown <'''newspam'''@nezumi.demon.co.uk> wrote: >On 29/04/2019 18:04, bitrex wrote: >> On 4/29/19 7:10 AM, gnuarm.deletethisbit@gmail.com wrote: >>> On Sunday, April 28, 2019 at 3:11:55 PM UTC-4, bitrex wrote: >>>> I have a client who needs to send 10 bit greyscale video data >>>> over a serial link from a PC to an ARM Cortex uP. Right now just using a >>>> KISS implementation, constant-overhead-byte-stuffing protocol, two bytes >>>> per value, with a simple CRC-type checksum appended to each scanline the >>>> link needs to be around 384kbps to support the amount of >>>> data required to transmit. >>>> >>>> the hardware is on-paper capable of that but in practice the lash up is >>>> unstable, there's a bottleneck somewhere, most likely on the PC side as >>>> it's not a "real" hardware serial port but virtualized via USB and it >>>> has to go thru all the multiple layers of abstraction from the >>>> application until it finally gets spit out; the application code isn't >>>> even complied it's from a scripting language. > >Windoze is nothing like an RTOS and has always been dodgy at fast serial >data since forever. My money is on a FIFO buffer overflow whilst the PC While Windows is not a hard RTOS, this affects mainly half duplex causing large latencies, if some protocol is done in user mode. Assuming a half duplex slave protocol, the kernel mode driver receives the request and tries to wake up the user mode protocol processing. The user mode activates after some undefined amount of time, generates a response, which is sent by the kernel mode driver back to the serial line. The foreign master sees this as a greatly varying response time and if the master timeout is set too tightly, may eve timeout, before the response from Windows arrives. Last century, some bad PC hardware caused a lot of lost interrupts on serial lines by disabling interrupts. Some floppy and CD controllers, some Ethernet adapters and some display adapters were particularity bad. By avoiding these bad apples, the Windows serial handler can capture all received bytes, before any UART hardware with reasonable sized hardware FIFO overflows. I haven't seen such problems with modern hardware. The next problematic point is the kernel mode to user mode transition. By using SetupComm() quite large kernel mode buffers can be allocated, into which the kernel driver inserts more bytes, until the user mode code wakes up and handles the received bytes. If the user mode protocol code doesn't call SetupComm(), at least previously, the default kernel mode Rx buffer was quite small, increasing the risk of overflowing the kernel mode buffer.
[toc] | [prev] | [next] | [standalone]
| From | DecadentLinuxUserNumeroUno@decadence.org |
|---|---|
| Date | 2019-04-30 22:04 +0000 |
| Message-ID | <qaagpi$nr9$2@gioia.aioe.org> |
| In reply to | #541290 |
upsidedown@downunder.com wrote in news:chvgceptjabvns9b4h6049ogl10ui76mjt@4ax.com: > On Tue, 30 Apr 2019 10:22:03 +0100, Martin Brown > <'''newspam'''@nezumi.demon.co.uk> wrote: > >>On 29/04/2019 18:04, bitrex wrote: >>> On 4/29/19 7:10 AM, gnuarm.deletethisbit@gmail.com wrote: >>>> On Sunday, April 28, 2019 at 3:11:55 PM UTC-4, bitrex wrote: >>>>> I have a client who needs to send 10 bit greyscale video data >>>>> over a serial link from a PC to an ARM Cortex uP. Right now >>>>> just using a KISS implementation, >>>>> constant-overhead-byte-stuffing protocol, two bytes per value, >>>>> with a simple CRC-type checksum appended to each scanline the >>>>> link needs to be around 384kbps to support the amount of >>>>> data required to transmit. >>>>> >>>>> the hardware is on-paper capable of that but in practice the >>>>> lash up is unstable, there's a bottleneck somewhere, most >>>>> likely on the PC side as it's not a "real" hardware serial >>>>> port but virtualized via USB and it has to go thru all the >>>>> multiple layers of abstraction from the application until it >>>>> finally gets spit out; the application code isn't even >>>>> complied it's from a scripting language. >> >>Windoze is nothing like an RTOS and has always been dodgy at fast >>serial data since forever. My money is on a FIFO buffer overflow >>whilst the PC > > While Windows is not a hard RTOS, this affects mainly half duplex > causing large latencies, if some protocol is done in user mode. > Assuming a half duplex slave protocol, the kernel mode driver > receives the request and tries to wake up the user mode protocol > processing. The user mode activates after some undefined amount of > time, generates a response, which is sent by the kernel mode > driver back to the serial line. The foreign master sees this as a > greatly varying response time and if the master timeout is set too > tightly, may eve timeout, before the response from Windows > arrives. > > Last century, some bad PC hardware caused a lot of lost interrupts > on serial lines by disabling interrupts. Some floppy and CD > controllers, some Ethernet adapters and some display adapters were > particularity bad. By avoiding these bad apples, the Windows > serial handler can capture all received bytes, before any UART > hardware with reasonable sized hardware FIFO overflows. > > I haven't seen such problems with modern hardware. > > The next problematic point is the kernel mode to user mode > transition. By using SetupComm() quite large kernel mode buffers > can be allocated, into which the kernel driver inserts more bytes, > until the user mode code wakes up and handles the received bytes. > If the user mode protocol code doesn't call SetupComm(), at least > previously, the default kernel mode Rx buffer was quite small, > increasing the risk of overflowing the kernel mode buffer. > > RTMP Real Time Messaging Protocol. It buffers things and reduces dropped frames. Made for streaming.
[toc] | [prev] | [next] | [standalone]
| From | whit3rd <whit3rd@gmail.com> |
|---|---|
| Date | 2019-04-30 16:30 -0700 |
| Message-ID | <6a39953a-cf8d-4b40-892e-095cb772c296@googlegroups.com> |
| In reply to | #541318 |
On Tuesday, April 30, 2019 at 3:04:43 PM UTC-7, DecadentLinux...@decadence.org wrote: > >>>> On Sunday, April 28, 2019 at 3:11:55 PM UTC-4, bitrex wrote: > >>>>> I have a client who needs to send 10 bit greyscale video data > RTMP Real Time Messaging Protocol. It buffers things and reduces > dropped frames. Made for streaming. So, a different networking protocol? As long as USB is universally available, though, a hardware solution (first-in-first-out memory buffer) is as easy to add as replacing the USB/serial dongle with a USB connection through a FT245 interface chip. Involving a full network of switches and wires, just doesn't seem useful when a short-distance one-computer-one-peripheral link is wanted. There's too many points-of-failure.
[toc] | [prev] | [next] | [standalone]
| From | Martin Brown <'''newspam'''@nezumi.demon.co.uk> |
|---|---|
| Date | 2019-05-01 08:49 +0100 |
| Message-ID | <qabj2d$18pm$1@gioia.aioe.org> |
| In reply to | #541322 |
On 01/05/2019 00:30, whit3rd wrote: > On Tuesday, April 30, 2019 at 3:04:43 PM UTC-7, DecadentLinux...@decadence.org wrote: > >>>>>> On Sunday, April 28, 2019 at 3:11:55 PM UTC-4, bitrex wrote: >>>>>>> I have a client who needs to send 10 bit greyscale video data > >> RTMP Real Time Messaging Protocol. It buffers things and reduces >> dropped frames. Made for streaming. > > So, a different networking protocol? > > As long as USB is universally available, though, a hardware solution > (first-in-first-out memory buffer) is as easy to add as replacing the > USB/serial dongle with a USB connection through a FT245 interface chip. > > Involving a full network of switches and wires, just doesn't seem useful > when a short-distance one-computer-one-peripheral link is wanted. > There's too many points-of-failure. Cross over network cables are available for point to point connections. I still have one somewhere - it is purple to avoid confusion. -- Regards, Martin Brown
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-05-01 10:28 -0400 |
| Message-ID | <o2iyE.110832$nx7.83418@fx28.iad> |
| In reply to | #541369 |
On 5/1/19 3:49 AM, Martin Brown wrote: > On 01/05/2019 00:30, whit3rd wrote: >> On Tuesday, April 30, 2019 at 3:04:43 PM UTC-7, >> DecadentLinux...@decadence.org wrote: >> >>>>>>> On Sunday, April 28, 2019 at 3:11:55 PM UTC-4, bitrex wrote: >>>>>>>> I have a client who needs to send 10 bit greyscale video data >> >>> RTMP Real Time Messaging Protocol. It buffers things and reduces >>> dropped frames. Made for streaming. >> >> So, a different networking protocol? >> >> As long as USB is universally available, though, a hardware solution >> (first-in-first-out memory buffer) is as easy to add as replacing the >> USB/serial dongle with a USB connection through a FT245 interface chip. >> >> Involving a full network of switches and wires, just doesn't seem useful >> when a short-distance one-computer-one-peripheral link is wanted. >> There's too many points-of-failure. > > Cross over network cables are available for point to point connections. > I still have one somewhere - it is purple to avoid confusion. > > Ah, the "good ol' days" I remember owning some of those. Not since either 100 mbit or Gigabit Ethernet became common on just about everything, whatever the standard was where the port hardware itself was able to auto-negotiate that stuff. In college I worked for the IT department helping setting up other student's networking, in 1997 it was still common for students to be bringing machines from home from the mid-late 80s like the Macintosh SE and wanting them on the campus network. It was possible using aftermarket equipment like Ethernet to Appletalk bridges, but it was pain.
[toc] | [prev] | [next] | [standalone]
| From | upsidedown@downunder.com |
|---|---|
| Date | 2019-04-30 13:50 +0300 |
| Message-ID | <qc9gce1groi5opah33fmq16ot4acvn43b8@4ax.com> |
| In reply to | #541062 |
On Sun, 28 Apr 2019 15:11:50 -0400, bitrex <user@example.net> wrote: >I have a client who needs to send 10 bit greyscale video data >over a serial link from a PC to an ARM Cortex uP. Right now just using a >KISS implementation, constant-overhead-byte-stuffing protocol, two bytes >per value, with a simple CRC-type checksum appended to each scanline the >link needs to be around 384kbps to support the amount of >data required to transmit. Since some variants o ARM Cortex also support Ethernet, did you considered using such part and thus, simplify the connectivity to the external world ? Implementing UDP on a device supporting Ethernet is trivial. Put three 10 bit samples into four bytes and at least 1024 horizontal pixels fits nicely into a single Ethernet or UDP telegram. Add frame and line numbers and the receiver can take appropriate actions, if it fails to catch some of the telegrams sent.
[toc] | [prev] | [next] | [standalone]
| From | david eather <eatDELETEher@tpg.com.au> |
|---|---|
| Date | 2019-05-01 13:45 +1000 |
| Message-ID | <4E8yE.187821$iy4.135150@fx06.am4> |
| In reply to | #541062 |
On 29/04/2019 5:11 am, bitrex wrote:
> I have a client who needs to send 10 bit greyscale video data
> over a serial link from a PC to an ARM Cortex uP. Right now just using a
> KISS implementation, constant-overhead-byte-stuffing protocol, two bytes
> per value, with a simple CRC-type checksum appended to each scanline the
> link needs to be around 384kbps to support the amount of
> data required to transmit.
>
> the hardware is on-paper capable of that but in practice the lash up is
> unstable, there's a bottleneck somewhere, most likely on the PC side as
> it's not a "real" hardware serial port but virtualized via USB and it
> has to go thru all the multiple layers of abstraction from the
> application until it finally gets spit out; the application code isn't
> even complied it's from a scripting language.
>
> Using compiled C/C++ that can do system calls directly will probably
> help but I'm also looking for ways to compress the serial stream
> bandwidth. For 10 bit greyscale data I was thinking that just something
> like u-law or A-law encoding could significantly reduce the bandwidth
> without resorting to more compute-intensive bespoke video compression
> algorithms. Primary requirement is that the link needs to be very
> fault-tolerant and reliable for long term operation
you want a look up table like this. It might not solve all your problems
but at least it will halve the required bit rate which should improve
things. Note the darkness details (up to 63) are not compressed at all.
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 60, 61, 62, 63, 65, 67, 69, 71, 73, 75, 78, 80,
82, 84, 87, 89, 91, 94, 96, 99, 101, 104, 106, 109, 112,
114, 117, 120, 122, 125, 128, 131, 134, 137, 140, 143, 146,
149, 152, 155, 158, 161, 164, 167, 171, 174, 177, 181, 184,
187, 191, 194, 198, 201, 205, 208, 212, 216, 219, 223, 227,
231, 234, 238, 242, 246, 250, 254, 258, 262, 266, 270, 274,
278, 283, 287, 291, 295, 300, 304, 308, 313, 317, 322, 326,
331, 335, 340, 345, 349, 354, 359, 363, 368, 373, 378, 383,
388, 393, 398, 403, 408, 413, 418, 423, 428, 433, 438, 444,
449, 454, 460, 465, 470, 476, 481, 487, 492, 498, 503, 509,
515, 520, 526, 532, 538, 543, 549, 555, 561, 567, 573, 579,
585, 591, 597, 603, 609, 616, 622, 628, 634, 641, 647, 653,
660, 666, 673, 679, 686, 692, 699, 706, 712, 719, 726, 732,
739, 746, 753, 760, 767, 774, 781, 788, 795, 802, 809, 816,
823, 830, 837, 845, 852, 859, 867, 874, 881, 889, 896, 904,
911, 919, 926, 934, 942, 949, 957, 965, 973, 980, 988, 996,
1004, 1012, 1020}
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-05-08 16:57 -0400 |
| Message-ID | <4pHAE.8376$bW5.4409@fx47.iad> |
| In reply to | #541365 |
On 4/30/19 11:45 PM, david eather wrote: > > > On 29/04/2019 5:11 am, bitrex wrote: >> I have a client who needs to send 10 bit greyscale video data >> over a serial link from a PC to an ARM Cortex uP. Right now just using >> a KISS implementation, constant-overhead-byte-stuffing protocol, two >> bytes per value, with a simple CRC-type checksum appended to each >> scanline the link needs to be around 384kbps to support the amount of >> data required to transmit. >> >> the hardware is on-paper capable of that but in practice the lash up >> is unstable, there's a bottleneck somewhere, most likely on the PC >> side as it's not a "real" hardware serial port but virtualized via USB >> and it has to go thru all the multiple layers of abstraction from the >> application until it finally gets spit out; the application code isn't >> even complied it's from a scripting language. >> >> Using compiled C/C++ that can do system calls directly will probably >> help but I'm also looking for ways to compress the serial stream >> bandwidth. For 10 bit greyscale data I was thinking that just >> something like u-law or A-law encoding could significantly reduce the >> bandwidth without resorting to more compute-intensive bespoke video >> compression algorithms. Primary requirement is that the link needs to >> be very fault-tolerant and reliable for long term operation > > you want a look up table like this. It might not solve all your problems > but at least it will halve the required bit rate which should improve > things. Note the darkness details (up to 63) are not compressed at all. Hi David, sorry for the delay in my reply - if you're around can you tell me how you came up with that table? And/or how to adapt to a different bit depth?
[toc] | [prev] | [next] | [standalone]
| From | Martin Brown <'''newspam'''@nezumi.demon.co.uk> |
|---|---|
| Date | 2019-05-08 22:22 +0100 |
| Message-ID | <qavhah$13t9$1@gioia.aioe.org> |
| In reply to | #542498 |
On 08/05/2019 21:57, bitrex wrote: > On 4/30/19 11:45 PM, david eather wrote: >> >> >> On 29/04/2019 5:11 am, bitrex wrote: >>> I have a client who needs to send 10 bit greyscale video data >>> over a serial link from a PC to an ARM Cortex uP. Right now just >>> using a KISS implementation, constant-overhead-byte-stuffing >>> protocol, two bytes per value, with a simple CRC-type checksum >>> appended to each scanline the link needs to be around 384kbps to >>> support the amount of >>> data required to transmit. >>> >>> the hardware is on-paper capable of that but in practice the lash up >>> is unstable, there's a bottleneck somewhere, most likely on the PC >>> side as it's not a "real" hardware serial port but virtualized via >>> USB and it has to go thru all the multiple layers of abstraction from >>> the application until it finally gets spit out; the application code >>> isn't even complied it's from a scripting language. >>> >>> Using compiled C/C++ that can do system calls directly will probably >>> help but I'm also looking for ways to compress the serial stream >>> bandwidth. For 10 bit greyscale data I was thinking that just >>> something like u-law or A-law encoding could significantly reduce the >>> bandwidth without resorting to more compute-intensive bespoke video >>> compression algorithms. Primary requirement is that the link needs to >>> be very fault-tolerant and reliable for long term operation >> >> you want a look up table like this. It might not solve all your >> problems but at least it will halve the required bit rate which should >> improve things. Note the darkness details (up to 63) are not >> compressed at all. > > > Hi David, sorry for the delay in my reply - if you're around can you > tell me how you came up with that table? And/or how to adapt to a > different bit depth? A formula that will work to give the same transform approximately is: x = int( 0.5 + 0.998*y*(4096+y)/(4096+16*y)) maps 0<y<1024 onto 0<x<255 linearly at first and then sort of log. Did it behave OK when you halved the datarate? -- Regards, Martin Brown
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-05-08 22:09 -0400 |
| Message-ID | <7ZLAE.2892$GV5.2707@fx46.iad> |
| In reply to | #542500 |
On 5/8/19 5:22 PM, Martin Brown wrote: > On 08/05/2019 21:57, bitrex wrote: >> On 4/30/19 11:45 PM, david eather wrote: >>> >>> >>> On 29/04/2019 5:11 am, bitrex wrote: >>>> I have a client who needs to send 10 bit greyscale video data >>>> over a serial link from a PC to an ARM Cortex uP. Right now just >>>> using a KISS implementation, constant-overhead-byte-stuffing >>>> protocol, two bytes per value, with a simple CRC-type checksum >>>> appended to each scanline the link needs to be around 384kbps to >>>> support the amount of >>>> data required to transmit. >>>> >>>> the hardware is on-paper capable of that but in practice the lash up >>>> is unstable, there's a bottleneck somewhere, most likely on the PC >>>> side as it's not a "real" hardware serial port but virtualized via >>>> USB and it has to go thru all the multiple layers of abstraction >>>> from the application until it finally gets spit out; the application >>>> code isn't even complied it's from a scripting language. >>>> >>>> Using compiled C/C++ that can do system calls directly will probably >>>> help but I'm also looking for ways to compress the serial stream >>>> bandwidth. For 10 bit greyscale data I was thinking that just >>>> something like u-law or A-law encoding could significantly reduce >>>> the bandwidth without resorting to more compute-intensive bespoke >>>> video compression algorithms. Primary requirement is that the link >>>> needs to be very fault-tolerant and reliable for long term operation >>> >>> you want a look up table like this. It might not solve all your >>> problems but at least it will halve the required bit rate which >>> should improve things. Note the darkness details (up to 63) are not >>> compressed at all. >> >> >> Hi David, sorry for the delay in my reply - if you're around can you >> tell me how you came up with that table? And/or how to adapt to a >> different bit depth? > > A formula that will work to give the same transform approximately is: > > x = int( 0.5 + 0.998*y*(4096+y)/(4096+16*y)) > > maps 0<y<1024 onto 0<x<255 linearly at first and then sort of log. > > Did it behave OK when you halved the datarate? > > I'm testing it out this week. The requirement was the final deliverable be written in C++ anyway so that was the priority and almost finished, now. The client's own scripting-language template for what they want was kinda kludge-y it's been re-written in a modular way such that it's easy to "plug-in" various encodings and compression schemes to test
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-05-08 22:11 -0400 |
| Message-ID | <X_LAE.2893$GV5.2850@fx46.iad> |
| In reply to | #542534 |
On 5/8/19 10:09 PM, bitrex wrote: > On 5/8/19 5:22 PM, Martin Brown wrote: >> On 08/05/2019 21:57, bitrex wrote: >>> On 4/30/19 11:45 PM, david eather wrote: >>>> >>>> >>>> On 29/04/2019 5:11 am, bitrex wrote: >>>>> I have a client who needs to send 10 bit greyscale video data >>>>> over a serial link from a PC to an ARM Cortex uP. Right now just >>>>> using a KISS implementation, constant-overhead-byte-stuffing >>>>> protocol, two bytes per value, with a simple CRC-type checksum >>>>> appended to each scanline the link needs to be around 384kbps to >>>>> support the amount of >>>>> data required to transmit. >>>>> >>>>> the hardware is on-paper capable of that but in practice the lash >>>>> up is unstable, there's a bottleneck somewhere, most likely on the >>>>> PC side as it's not a "real" hardware serial port but virtualized >>>>> via USB and it has to go thru all the multiple layers of >>>>> abstraction from the application until it finally gets spit out; >>>>> the application code isn't even complied it's from a scripting >>>>> language. >>>>> >>>>> Using compiled C/C++ that can do system calls directly will >>>>> probably help but I'm also looking for ways to compress the serial >>>>> stream bandwidth. For 10 bit greyscale data I was thinking that >>>>> just something like u-law or A-law encoding could significantly >>>>> reduce the bandwidth without resorting to more compute-intensive >>>>> bespoke video compression algorithms. Primary requirement is that >>>>> the link needs to be very fault-tolerant and reliable for long term >>>>> operation >>>> >>>> you want a look up table like this. It might not solve all your >>>> problems but at least it will halve the required bit rate which >>>> should improve things. Note the darkness details (up to 63) are not >>>> compressed at all. >>> >>> >>> Hi David, sorry for the delay in my reply - if you're around can you >>> tell me how you came up with that table? And/or how to adapt to a >>> different bit depth? >> >> A formula that will work to give the same transform approximately is: >> >> x = int( 0.5 + 0.998*y*(4096+y)/(4096+16*y)) >> >> maps 0<y<1024 onto 0<x<255 linearly at first and then sort of log. >> >> Did it behave OK when you halved the datarate? >> >> > > I'm testing it out this week. The requirement was the final deliverable > be written in C++ anyway so that was the priority and almost finished, now. > > The client's own scripting-language template for what they want was > kinda kludge-y it's been re-written in a modular way such that it's easy > to "plug-in" various encodings and compression schemes to test > That is to say the scripting language implementation behaved erratically in general, not stable enough to tell anything for sure. It's not really appropriate tool for the task and the data rates involved
[toc] | [prev] | [next] | [standalone]
| From | Martin Brown <'''newspam'''@nezumi.demon.co.uk> |
|---|---|
| Date | 2019-05-09 08:44 +0100 |
| Message-ID | <qb0lom$1ua9$1@gioia.aioe.org> |
| In reply to | #542534 |
On 09/05/2019 03:09, bitrex wrote: > On 5/8/19 5:22 PM, Martin Brown wrote: >> On 08/05/2019 21:57, bitrex wrote: >>> On 4/30/19 11:45 PM, david eather wrote: >>>> >>>> >>>> On 29/04/2019 5:11 am, bitrex wrote: >>>>> I have a client who needs to send 10 bit greyscale video data >>>>> over a serial link from a PC to an ARM Cortex uP. Right now just >>>>> using a KISS implementation, constant-overhead-byte-stuffing >>>>> protocol, two bytes per value, with a simple CRC-type checksum >>>>> appended to each scanline the link needs to be around 384kbps to >>>>> support the amount of >>>>> data required to transmit. >>>>> >>>>> the hardware is on-paper capable of that but in practice the lash >>>>> up is unstable, there's a bottleneck somewhere, most likely on the >>>>> PC side as it's not a "real" hardware serial port but virtualized >>>>> via USB and it has to go thru all the multiple layers of >>>>> abstraction from the application until it finally gets spit out; >>>>> the application code isn't even complied it's from a scripting >>>>> language. >>>>> >>>>> Using compiled C/C++ that can do system calls directly will >>>>> probably help but I'm also looking for ways to compress the serial >>>>> stream bandwidth. For 10 bit greyscale data I was thinking that >>>>> just something like u-law or A-law encoding could significantly >>>>> reduce the bandwidth without resorting to more compute-intensive >>>>> bespoke video compression algorithms. Primary requirement is that >>>>> the link needs to be very fault-tolerant and reliable for long term >>>>> operation >>>> >>>> you want a look up table like this. It might not solve all your >>>> problems but at least it will halve the required bit rate which >>>> should improve things. Note the darkness details (up to 63) are not >>>> compressed at all. >>> >>> >>> Hi David, sorry for the delay in my reply - if you're around can you >>> tell me how you came up with that table? And/or how to adapt to a >>> different bit depth? >> >> A formula that will work to give the same transform approximately is: >> >> x = int( 0.5 + 0.998*y*(4096+y)/(4096+16*y)) >> >> maps 0<y<1024 onto 0<x<255 linearly at first and then sort of log. >> >> Did it behave OK when you halved the datarate? >> >> > > I'm testing it out this week. The requirement was the final deliverable > be written in C++ anyway so that was the priority and almost finished, now. There are a whole family of such curves of the form x = int( 0.5+k*y*(A+By)/(A+Cy)) for 0<y<Y and linear for small y and to scale by 1/N at the top end requires Y/N = Y*(A+BY)/(A+CY) A+CY = AN+NBY hence C = (N-1)A/Y + NB Making A bigger extends linearity at the low end, increasing C extends linearity at the high end. Beware of C<-1 where it isn't monotonic any more. > The client's own scripting-language template for what they want was > kinda kludge-y it's been re-written in a modular way such that it's easy > to "plug-in" various encodings and compression schemes to test The simplest one would be to drop the most significant byte. TBH I'm surprised a scripting language can keep up with a video stream at all. -- Regards, Martin Brown
[toc] | [prev] | [next] | [standalone]
| From | bitrex <user@example.net> |
|---|---|
| Date | 2019-05-09 10:41 -0400 |
| Message-ID | <b_WAE.5265$VI3.2176@fx27.iad> |
| In reply to | #542566 |
On 5/9/19 3:44 AM, Martin Brown wrote: > On 09/05/2019 03:09, bitrex wrote: >> On 5/8/19 5:22 PM, Martin Brown wrote: >>> On 08/05/2019 21:57, bitrex wrote: >>>> On 4/30/19 11:45 PM, david eather wrote: >>>>> >>>>> >>>>> On 29/04/2019 5:11 am, bitrex wrote: >>>>>> I have a client who needs to send 10 bit greyscale video data >>>>>> over a serial link from a PC to an ARM Cortex uP. Right now just >>>>>> using a KISS implementation, constant-overhead-byte-stuffing >>>>>> protocol, two bytes per value, with a simple CRC-type checksum >>>>>> appended to each scanline the link needs to be around 384kbps to >>>>>> support the amount of >>>>>> data required to transmit. >>>>>> >>>>>> the hardware is on-paper capable of that but in practice the lash >>>>>> up is unstable, there's a bottleneck somewhere, most likely on the >>>>>> PC side as it's not a "real" hardware serial port but virtualized >>>>>> via USB and it has to go thru all the multiple layers of >>>>>> abstraction from the application until it finally gets spit out; >>>>>> the application code isn't even complied it's from a scripting >>>>>> language. >>>>>> >>>>>> Using compiled C/C++ that can do system calls directly will >>>>>> probably help but I'm also looking for ways to compress the serial >>>>>> stream bandwidth. For 10 bit greyscale data I was thinking that >>>>>> just something like u-law or A-law encoding could significantly >>>>>> reduce the bandwidth without resorting to more compute-intensive >>>>>> bespoke video compression algorithms. Primary requirement is that >>>>>> the link needs to be very fault-tolerant and reliable for long >>>>>> term operation >>>>> >>>>> you want a look up table like this. It might not solve all your >>>>> problems but at least it will halve the required bit rate which >>>>> should improve things. Note the darkness details (up to 63) are not >>>>> compressed at all. >>>> >>>> >>>> Hi David, sorry for the delay in my reply - if you're around can you >>>> tell me how you came up with that table? And/or how to adapt to a >>>> different bit depth? >>> >>> A formula that will work to give the same transform approximately is: >>> >>> x = int( 0.5 + 0.998*y*(4096+y)/(4096+16*y)) >>> >>> maps 0<y<1024 onto 0<x<255 linearly at first and then sort of log. >>> >>> Did it behave OK when you halved the datarate? >>> >>> >> >> I'm testing it out this week. The requirement was the final >> deliverable be written in C++ anyway so that was the priority and >> almost finished, now. > > There are a whole family of such curves of the form > > x = int( 0.5+k*y*(A+By)/(A+Cy)) > > for 0<y<Y and linear for small y and to scale by 1/N at the top end > > requires > > Y/N = Y*(A+BY)/(A+CY) > > A+CY = AN+NBY > > hence C = (N-1)A/Y + NB > > Making A bigger extends linearity at the low end, increasing C extends > linearity at the high end. > > Beware of C<-1 where it isn't monotonic any more. > >> The client's own scripting-language template for what they want was >> kinda kludge-y it's been re-written in a modular way such that it's >> easy to "plug-in" various encodings and compression schemes to test > > The simplest one would be to drop the most significant byte. TBH I'm > surprised a scripting language can keep up with a video stream at all. > It was some Java code, so not exactly the proper terminology it was not interpreted but compiled for the Java virtual machine. I was a little surprised that Java could access a USB serial interface as well and it does okay but the transmission must have to propagate down thru many layers of abstraction to the actual hardware. It's probably fine for logging stuff at a few dozen kbps intermittently but trying to send a continual stream of dummy data at a hundred kbps will intermittently hang the app, even on a very recent high performance laptop. It's not the interface's problem it can push that amount of async data no problem when C code on Linux is driving it directly from a /dev handle to it.
[toc] | [prev] | [next] | [standalone]
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
Back to top | Article view | sci.electronics.design
csiph-web