Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

bcm283x: Implement bit stream functions, not enabled yet. #207

Merged
merged 18 commits into from
Dec 25, 2017

Conversation

simokawa
Copy link
Contributor

@simokawa simokawa commented Dec 25, 2017

@codecov-io
Copy link

Codecov Report

Merging #207 into master will decrease coverage by 3.69%.
The diff coverage is 14.01%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #207     +/-   ##
=========================================
- Coverage   83.97%   80.27%   -3.7%     
=========================================
  Files          66       68      +2     
  Lines        5515     5811    +296     
=========================================
+ Hits         4631     4665     +34     
- Misses        761     1021    +260     
- Partials      123      125      +2
Impacted Files Coverage Δ
host/bcm283x/dma.go 32.59% <0%> (-20.87%) ⬇️
host/bcm283x/pcm.go 0% <0%> (ø)
conn/gpio/gpiostream/gpiostream.go 100% <100%> (ø) ⬆️
host/bcm283x/pwm.go 62.06% <31.25%> (-3.32%) ⬇️
host/bcm283x/streams.go 41.37% <41.37%> (ø)
host/bcm283x/gpio.go 55.27% <50%> (-0.42%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 551e0e5...0ae9732. Read the comment docs.

return err
}

// The first channel must be a full bandwidth one.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maruel Could you explain why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the "light" ones are effectively a single one, which means that they are interleaved. If both are "light" then the jitter is largely increased.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I experimented dual channel method but it seems that two channels easily get out of sync. I guess it DREQ clock can be missed.

@maruel maruel changed the title Impelment bit stream functions for bcm283x, not enabled yet. Implement bit stream functions for bcm283x, not enabled yet. Dec 25, 2017
@maruel maruel changed the title Implement bit stream functions for bcm283x, not enabled yet. bcm283x: Implement bit stream functions, not enabled yet. Dec 25, 2017
runIO(pCB, l <= maxLite)
// We have to wait PCM to be finished even after DMA finished.
for pcmMemory.cs&pcmTXErr == 0 {
Nanospin(10 * time.Nanosecond)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory it should try to wait the exact right amount of time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I just wanted avoid a busy loop. Maybe, we should wait 1 PCM clock.
dmaChannel.wait() is a busy loop now.

for i, ch := range dmaMemory.channels {
fmt.Println(i, ch.cs.String())
if ch.cs&dmaActive != 0 {
fmt.Printf("%x: %s", ch.cbAddr, ch.GoString())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer log instead of fmt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #209.

@maruel maruel merged commit 59f4f2b into google:master Dec 25, 2017
@simokawa simokawa deleted the dmapull1 branch December 26, 2017 00:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants