News for hackers. Stuff that matters.
Re:Norway switches off FM radio, but a station is defying go... by icebraining on Friday December 15, 2017 @11:16AM (#15932817)
Is the lag inherent to the protocol, or just a matter of poor receiver implementation?
Re:Norway switches off FM radio, but a station is defying go... by jimktrains2 on Friday December 15, 2017 @11:28AM (#15932922)
It's probably similar to switching TV channels (which isn't instant anymore either). The receiver needs to wait for a new "key frame" (on that isn't compressed) before it can begin displaying/sounding?/outputting the rest of the compressed stream.
Re:Norway switches off FM radio, but a station is defying go... by yoran on Friday December 15, 2017 @11:34AM (#15932974)
True that. I feel like we've really gone backwards on that aspect concerning TV. I remember a time where I could turn on the TV and be 3 channels further all within the space of 2 seconds. Now my "smart" TV takes 5 seconds just for a first paint, and changing a channel once takes a second. You just can't beat the latency of analog circuits!
Re:Norway switches off FM radio, but a station is defying go... by ryandrake on Friday December 15, 2017 @02:42PM (#15934425)
The radios from my various cars throughout the years are just as bad. My 1970s era radio turned on instantly and there was zero delay as I tuned through channels with a nice smooth analog dial. My 1990s era radio took about 500ms from power on to audio output. The "dial" had steps in it though and was not continuous, and there was a noticeable (again probably around 500ms) delay between when 'click' tactile feedback and when the station was successfully tuned. My current car takes 15 seconds just to boot (WTF), and then I have to navigate some horrible menu just to get to the radio controls. It's like these guys are actively trying to make things worse.
Re:Norway switches off FM radio, but a station is defying go... by userbinator on Friday December 15, 2017 @11:42PM (#15937735)
Even the 1980s car radios with digital controls had no perceptible delay, despite containing microcontrollers with a tiny fraction of the speed and memory of the modern ones.

Maybe it's the whole "let's run Linux on it because we can" phenomenon. The microcontrollers in the old electronic radios didn't run an OS but interacted with the hardware directly. The number of instructions executed from sensing the dial change to updating the tuner and display would probably be less than 100. Now it's half a dozen layers of abstraction and millions of instructions to do the same thing, on a processor which is maybe "only" 1000x faster at most...

Re:Norway switches off FM radio, but a station is defying go... by mark-r on Friday December 15, 2017 @01:45PM (#15934023)
My new car has a radio with a touch-screen interface. When I turn the car on there's a space of about 10 seconds where the radio is operating but I can't change the station or volume or even turn it off. It's quite annoying when you were rocking out last time you were in the car and now you have passengers.
Re:Norway switches off FM radio, but a station is defying go... by wpietri on Friday December 15, 2017 @03:33PM (#15934838)
To me this is symptomatic of a long or broken feedback loop in the development process. E.g., a classic waterfall approach where somebody writes a big spec, a team spends a bunch of time implementing, and then sometime at or after the deadline, a working model is produced.

In that setting, nobody's going to say, "Hey, let's just pop this radio into our cars, live with it for a few weeks, and then figure out where we need to go next." It's too late. Instead I think the thing to do is force convergence early and often in the product timeline, so that the supposedly-little things like this have plenty of time to get noticed and fixed.

A good example of this is Apple. I'm told that in consumer electronics the typical number of iterations with physical prototypes is 3-7. For the first iPod, Apple went through more than 100. The difference was enough for them to crush the competition so thoroughly that people these days are surprised to hear that there were MP3 players before the iPod (and smartphones before the iPhone).

Re:Norway switches off FM radio, but a station is defying go... by userbinator on Friday December 15, 2017 @11:38PM (#15937717)
a classic waterfall approach where somebody writes a big spec, a team spends a bunch of time implementing, and then sometime at or after the deadline, a working model is produced.

...which is actually quite suitable for the safety-critical parts of a car like the ECU and other controllers that control the actual driving aspect, but not for everything else that doesn't need such a level of process.

On the other hand, I suppose it could also be blamed on the lack of "performance is a feature" --- if they specified the radio to be as responsive as the accelerator and brake, for example.

Re:Norway switches off FM radio, but a station is defying go... by wpietri on Sunday December 17, 2017 @10:05AM (#15945996)
I think the choice of process is basically orthogonal. Waterfall and Agile processes done well both have been demonstrated to produce safety-critical software. (See, e.g., Nancy van Schooenderwoert's work in medical devices.) Both can produce dangerous software. (E.g., Toyota's "unintended acceleration" issues.) The question is much more about what practices you put in place to assure quality.

I do think short-cycle methods have some intrinsic advantages, though. By making critical functionality available much earlier for testing, you get more time and more chances to make sure it's really safe. If early versions are bad, you get early warning signs that aren't available in a Waterfall process. And if testing turns up issues early on, it's much cheaper to make fundamental architectural changes: less code to change and more time to change it in. And Waterfall processes aren't at good at dealing with unknown unknowns; some things you only learn by trying them out.

Re:Norway switches off FM radio, but a station is defying go... by FireBeyond on Friday December 15, 2017 @05:52PM (#15935921)
Same, and it's all the more frustrating with the realization that what is effectively a tablet should be able to sleep for an inordinately long time, especially in "airplane mode" (mine has a SIM card, but there's no reason to be running an AP or Bluetooth when off), rather than cold booting, off a car battery.
Re:Norway switches off FM radio, but a station is defying go... by Asooka on Friday December 15, 2017 @11:44AM (#15933058)
You mean uncompressed data. Yes, analogue is uncompressed, but digital could also be uncompressed. However, everyone wants to stuff more video, more audio over the link, so we compress... Bandwidth goes up, latency also goes up, and things get more complicated...
Re:Norway switches off FM radio, but a station is defying go... by blattimwind on Friday December 15, 2017 @01:27PM (#15933884)
Analogue video signals are absolutely compressed (interlacing, PAL, NTSC, SECAM). It's just not as efficient as MPEG-X combined with hyper-aggressive modulation schemes and forward-error correction, channel-capacity wise.
Re:Norway switches off FM radio, but a station is defying go... by BLanen on Friday December 15, 2017 @01:29PM (#15933902)
Audio compression doesn't work that way. It doesn't use keyframes.
Re:Norway switches off FM radio, but a station is defying go... by jimktrains2 on Friday December 15, 2017 @03:15PM (#15934695)
It has some kind of equivalent from my understanding. MP3 has frames https://en.wikipedia.org/wiki/MP3#File_structure and I'd assume all methods do, otherwise how could you start decompression if you don't have a starting point?
Re:Norway switches off FM radio, but a station is defying go... by mortehu on Friday December 15, 2017 @03:27PM (#15934789)
MP3 frames are all full frames, whereas a key frame is a full frame that is followed by incremental updates.
Re:Norway switches off FM radio, but a station is defying go... by TD-Linux on Friday December 15, 2017 @06:22PM (#15936145)
The prediction gain of audio codecs is <1, which basically means that if you start at a random packet, once you play enough packets it'll converge to sound the same as if you had started playing from the beginning. It'll sound bad at the beginning though, so you usually crop off the first bit after seeking (80ms for Opus, much longer for other codecs).

Another source of delay is just the length of audio packets themselves (have to wait for the beginning of one) and radio limitations.

Re:Norway switches off FM radio, but a station is defying go... by georgeglue1 on Friday December 15, 2017 @12:09PM (#15933223)
It sounds like you could build a TV/device that caches key frames for all channels on the client/consumer0side.

Or am I totally misreading this?

Re:Norway switches off FM radio, but a station is defying go... by KSS42 on Friday December 15, 2017 @12:26PM (#15933372)
There are set top boxes that have many tuners. The STB uses the extra tuners to anticipate a channel change and tune ahead to the next channel. (Fast Channel switch).
Re:Norway switches off FM radio, but a station is defying go... by namibj on Friday December 15, 2017 @12:15PM (#15933271)
For sattelite tv you wouls need to handle over a Gigabit mpeg-2. Not easy.
Re:Norway switches off FM radio, but a station is defying go... by mickronome on Friday December 15, 2017 @01:10PM (#15933757)
Caching without decoding would still be a nice boost, wouldn't it ?

Coupled with a decoder that can manage double the actual frame rate, it should cut the switch time with something like on average 1/4, worst case better than 1/2.

Re:Norway switches off FM radio, but a station is defying go... by jimktrains2 on Friday December 15, 2017 @03:17PM (#15934708)
You'd still need the additional tuner(s) to provide the data to cache.
Re:Norway switches off FM radio, but a station is defying go... by danmaz74 on Friday December 15, 2017 @01:47PM (#15934043)
Technical detail: for video, key frames are compressed. And this technique isn't used for audio.
Re:Norway switches off FM radio, but a station is defying go... by jimktrains2 on Friday December 15, 2017 @03:16PM (#15934704)
> for video, key frames are compressed

But they're compressed in such a way that doesn't require any previous frame. It's compressed like a picture would be.

Re:Norway switches off FM radio, but a station is defying go... by reaperducer on Friday December 15, 2017 @11:30AM (#15932938)
I can't speak about the DAB protocol, but the HD Radio scheme that is used for digital in the United States seems to be a protocol problem. I say this because I've owned four HD Radios each from a different manufacturer, and each one had the tuning lag problem.

The sad part is that HD Radio is actually startlingly better on AM, while FM is an incremental improvement. But few AM stations use HD because most AM stations operate on a shoestring, and it ruins your fringe coverage.

But when you find an AM station that's in HD and you hear the receiver switch from analog to digital -- holy cow!

Re:Norway switches off FM radio, but a station is defying go... by pjc50 on Friday December 15, 2017 @11:33AM (#15932965)
Some buffering is probably inherent. The protocol is at http://www.etsi.org/deliver/etsi_en/300400_300499/300401/01.... if anyone wants a long read.

At a guess the critical number is "The transmitted signal has a frame structure of 96 ms duration (Transmission mode I)", which implies that most systems will need to buffer at least that much and probably several times that.

Theoretically you could decode all the signals in a particular DAB multiplex at the same time (e.g. all the BBC stations are on the same multiplex in the UK), and then change instantly between them, but I don't think consumer recievers let you do this. Might be able to try it with SDR.

Re:Norway switches off FM radio, but a station is defying go... by baobrien on Friday December 15, 2017 @01:26PM (#15933876)
It's probably also doing some kind of interleaving along with forward error correction, and would need to collect a few frames before it can start decoding. There's a section on interleaving under convolution coding in the spec, but it looked pretty complicated and I've got no idea how stations are usually configured.
Re:Norway switches off FM radio, but a station is defying go... by icebraining on Friday December 15, 2017 @11:41AM (#15933032)
I'm quite ignorant about wireless signals, but do you know why they chose 96ms? That sounds huge for a single frame.

I guess an optimization the receivers could do is decode all the presets, then at least switching between those would be instant.

Re:Norway switches off FM radio, but a station is defying go... by mikeash on Friday December 15, 2017 @11:50AM (#15933097)
There's a tradeoff between latency and efficiency. Longer frames can compress better, and you amortize any per-frame header over more stuff. Shorter frames incur more overhead from headers, and may not compress as well. 96ms seems like a reasonable choice for a realtimeish system without tight latency requirements, but I couldn't say why they chose exactly that number.
Re:Norway switches off FM radio, but a station is defying go... by rlpb on Friday December 15, 2017 @12:06PM (#15933204)
> ...but I couldn't say why they chose exactly that number.

I would speculate that it's because it's fairly close to 100 and is also divisible by a fairly high power of 2 (32). Buffer management is easier (less arithmetic) when using powers of 2.

I could be completely wrong, but 96 is the kind of number that crops up in computing quite a bit for this reason. Having said that, the number of samples may be more important than the number of milliseconds.

Re:Norway switches off FM radio, but a station is defying go... by mikeash on Friday December 15, 2017 @12:42PM (#15933495)
I dug into the PDF above and and it looks like it's mostly due to the underlying codec. They use MPEG-1 Audio Layer II, which has a frame size of 1152 samples. They support 24kHz or 48kHz sample rates, which means that a 1152 sample frame is either 48ms or 24ms. Apparently they stuff 2 or 4 of these audio frames into each transmission frame.
Re:Norway switches off FM radio, but a station is defying go... by rlpb on Friday December 15, 2017 @12:49PM (#15933568)
That just punts the question. Why does the codec have a frame size of 1152 samples? Is it because that brings the frame size to sums of powers of two milliseconds? :)
Re:Norway switches off FM radio, but a station is defying go... by mikeash on Friday December 15, 2017 @01:23PM (#15933859)
Damn, I was hoping nobody would notice that.

I mean, good point. I dug a bit farther and found this document which discusses the design in some detail:

https://web.archive.org/web/20040919073530/http://www.cs.col...

It looks like MP1 has 32 subbands and works on 12 samples each, which results in a frame size of 384. MP2 works on 3 groups of 12 samples for each subband, resulting in 1152 samples.

Of course this just punts it to the question of why 32, 12, and 3? To which I can only answer: quick, look behind you! <runs away>

At least the mystery numbers are smaller.

But seriously, I'm at (beyond) the limits of my understanding of this stuff, so if anyone with more knowledge would care to chime in and explain those, I'd be most interested to know.

Re:Norway switches off FM radio, but a station is defying go... by geerlingguy on Friday December 15, 2017 @11:45AM (#15933070)
Also, currently, all decoder chips (at least the 'official' ones you need for an 'HD Radio' designation) are controlled/manufactured/sold by one group, 'Xperi'. The protocol itself is closed/proprietary, and it's not trivial to build any kind of receiver/decoder, like you could with analog FM/AM.
Re:Norway switches off FM radio, but a station is defying go... by zebMcCorkle on Friday December 15, 2017 @12:16PM (#15933281)
HD Radio != DAB