Commit Graph

17 Commits

Author SHA1 Message Date
Dean Lee 757cb2eb6c mcid.py: optimize FFT and A-weighting calculations (#33057)
* Precomputing weighting

* add comments back

* use cache

* spacing

spacing

* clean up

* lower by diff

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 313a2826c2
2024-07-25 13:36:44 -07:00
Justin Newberry b914f0a27f soundd/micd: retry getting stream (#30701)
retry soundd/micd
old-commit-hash: 4f3a186a6f
2023-12-12 15:58:24 -08:00
Justin Newberry 6601d7d8b5 soundd/micd: increase stream buffer size (#30685)
* increase buffer

* update cpu refs

* go to 100ms

* correct spot
old-commit-hash: b0831fb117
2023-12-11 17:25:37 -08:00
Justin Newberry 2d50661b94 soundd/micd: more robust setup procedure (#30640)
* just use the default device :/

* Ruff

* this seems like the most reliable way

* Ruff

* move comments too

* wait for devices

* fix that

* and that

* ruff

* add logging for avaliable devices

---------

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: bc70c94f75
2023-12-08 17:59:31 -08:00
Adeeb Shihadeh 59eb2988de swaglog.py goes in common/ (#30631)
* swaglog.py goes in common/

* all of these go in release

* we'll even include the pyx
old-commit-hash: 35f819c823
2023-12-06 17:27:51 -08:00
Justin Newberry db3fbdae18 Soundd: only update ambient db when not playing an alert (#30620)
* move to soundd + only when quiet

* not filtered
old-commit-hash: 5600a82889
2023-12-06 14:59:16 -08:00
Adeeb Shihadeh 1cc4f1a634 new msgs default to invalid (#30587)
* new msgs default to invalid

* fix lm

* set more valid

* update rest

* update refs

* fix logMessage

* more valids

* cleanup

* fix llk test

* pigeond is also valid

* more valids
old-commit-hash: a1d36961cf
2023-12-03 10:50:17 -08:00
Adeeb Shihadeh 4b78e52e34 cleanup old sm pm args (#30241)
* cleanup sm pm

* fix controlsd

* fix
old-commit-hash: b68cfbb332
2023-10-13 23:27:04 -07:00
Justin Newberry c4f322ce2d Linter: remove pylint (#29611)
remove pylint
old-commit-hash: 1ee6ed4b16
2023-08-24 16:30:54 -07:00
Adeeb Shihadeh 16ec56398c add openpilot prefix to imports (#29498)
* add openpilot prefix to imports

* more

* more

* fix docs

* fix linter

* bump submodules

* fix patched tests

* update dynamic imports

* debug

* Revert "debug"

This reverts commit db5e13b9911cc74438bee123bc3430da6c31b24b.

* fix pm test
old-commit-hash: a9626f95b6
2023-08-20 20:49:55 -07:00
Cameron Clough cc0090c8d2 fix micd input device (#27160)
* try no device

* unused

* move sounddevice import
old-commit-hash: feba2f3fe5
2023-01-30 17:41:42 -08:00
Shane Smiskol 43a80f7dd8 Micd: update sound levels in callback (#26674)
* update once reached 4096

* update once reached 4096

* reduce

* debug & cmt

* fix

* fifo again

* fix

* clean that up

* update filter on demand

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
old-commit-hash: 20dba2f33d
2022-12-02 18:38:04 -08:00
Shane Smiskol 16859211f5 micd: revert check playing sound (high cpu usage) (#26672)
* don't use hardware

* check micd proc

* use pactl package

* cleanup

* Revert "cleanup"

This reverts commit baf9887e2d3e7dce8c24a93e970bb5a2d3609d50.

* Revert "use pactl package"

This reverts commit 0c1f3a4b865e44052affa57323ae4a21d274d6e3.

* Revert "micd: don't update filtered sound level if playing sound (#26652)"

This reverts commit 6703f6fa0297ad587ce80fcf1af432c402ba4e7e.

* Revert "check micd proc"

This reverts commit 9ebbe2aa42bdfd2f7f8bf226978a518d984fb154.

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
old-commit-hash: 060b69ee2f
2022-12-02 15:25:34 -08:00
Shane Smiskol 4548cf9592 soundd: lower max volume breakpoint (#26673)
* revert tune

* remove hanning window

* retune from hanning window

* add hanning back

* update once reached 4096

* Revert "update once reached 4096"

This reverts commit 0898cbeec736916ffaee5e963df048b48636ece5.
old-commit-hash: de061eacbe
2022-12-02 02:23:51 -08:00
Shane Smiskol 4dfeb1ddeb micd: apply A-weighting to the sound pressure level (#26668)
* record

* record

* draft

* some clean up

* some clean up

* wishful tuning

* log pressure level (db) for debugging

* fix

* tuning

* ignore complex to real warning

* remove this

* Update selfdrive/ui/soundd/sound.cc

* Update system/micd.py

* remove warning supp

* bump cereal to master

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
old-commit-hash: d087fab2c0
2022-12-02 00:11:29 -08:00
Cameron Clough 8242a86d96 micd: don't update filtered sound level if playing sound (#26652)
* add is_sound_playing to hardware.py

* micd: don't update filtered sound level if playing sound
old-commit-hash: 86cd919a57
2022-12-01 12:52:06 -08:00
Cameron Clough 9bcf83f493 micd: scale sound volume with ambient noise level (#26399)
* test changing sound volume

* test changing sound volume

* create system/hardware/pc/hardware.h

* implement Hardware::set_volume using pactl

* soundd: use Hardware::set_volume

* add sounddevice dependency

* sounddevice example

* simple micd

* cleanup

* remove this

* fix process config

* add to release files

* hardware: get sound input device

* no more offroad

* debug

* calculate volume from all measurements since last update

* use microphone noise level to update sound volume

* fix scale

* mute microphone during alerts

* log raw noise level

* hardware: reduce tici min volume

* improve scale

* add package

* clear measurements on muted

* change default to min volume and respond quicker

* fixes

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* logarithmic scaling

* fix

* respond quicker

* fixes

* tweak scaling

* specify default device

* Revert "hardware: get sound input device"

This reverts commit 50f594f7a3bab005023482bc793147a8c8dae5d7.

* tuning

* forgot to update submaster

* tuning

* don't mute microphone, and clip measurement

* remove submaster

* fixes

* tuning

* implement Hardware::set_volume using pactl

* Revert "test changing sound volume"

This reverts commit 4bbd870746ec86d1c9871a6175def96cf7f751a6.

* draft

* draft

* calculate sound pressure level in dB

* fix setting

* faster filter

* start at initial value

* don't run command in background

* pactl: use default sink

* use sound pressure db

* tuning

* bump up max volume threshold

* update filter slower

* fix divide by zero

* bump cereal

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 108ff15f5d
2022-11-30 21:56:03 -08:00