-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving i2s_dacs detection ? #871
Comments
For some reasons (DAC eventually not having proper eeprom), Volumio implements 2 methods:
Looking at the supported DAC list, address detection method does not account for many cases: 2 of them listed at this time, only 1 for which really depending on that method (other one has eeprom info). Then, instead of scanning the whole bus with Wouldn't this be much quicker than scanning the whole bus address space, and would then release the bus much sooner, in case some plugins might need it?... |
I think we can solve it just by using timeout... |
Happy to test any suggested line change. |
Ok! Give me a couple of days, and many thanks for your help and suggestions! |
Happy if it can help: I wish I could just contribute PRs so that it's even easier for you, but I'm afraid not fluent enough in js and node to do that. Besides this "scheduling" problem during DAC detection, I'm actually wondering why it is necessary to go for such detection at each boot, if audio settings do not care about DACs... So you may want to improve that test a bit, so that it is evaluated only if DAC UI switch is set to ON within Playback Option / Audio output (alsa_controller .json I guess) This will definitely reduce occurrences of such DAC detection, while the earlier measures (i2c probe timeout & START PLUGINS dependency) will help ensure detection process is optimal when used. Makes sense? |
We use this to enable I2S DAC autodetection: it means that if a compatible i2s dac is found, it's enabled without user intervention (which I think is a cool feature). |
From a user perspective, it looks strange to have the system trying to detect i2s DAC, if user positively sets i2s DAC to OFF, and other audio routes are indeed saved (such as HDMI or jack,...or possibly USB DAC) by user intervention. It is indeed a cool feature that system tries to detect i2s DAC when nothing has been set for audio route (and conf file is "empty"), but once user decides to use other audio path, doing such i2s detection seems a bit overruling user's decision. |
On a side note, I tried auto detection of Hifiberry DAC+ (pro) on raspi3: Volumio did report entering into detection in log I then flashed DAC EEPROM with Hifiberry's provided method, and had no more detection success, although the device did show-up in |
Hifiberry told me that their eeprom is what we have in dacs.json... |
Here is what /proc contains with eeprom-flashed Hifiberry DAC+ pro (maybe @hifiberry can confirm):
Indeed, what you have in dacs.json is concatenation of |
Trying to summaries this issue to make it clearer and hopefully more actionable: 1- i2S DAC autodetection happens even when i2S is set to OFF (and setting saved as such): 2- When no DAC (and actually no i2C HAT) is connected to Pi, reading i2C bus can take very long time (about 115sec), due to clock stretching on SCL pin (GPIO 3). Therefore it may be a good measure to set a time-out (1sec should be ok) on 3- When HAT EEPROM-based detection is successful, there is no need to alter 4- EEPROM-based detection is failing on (at least) Hifiberry DAC+ (pro). This is due to the fact that Hifiberry DAC+ (pro) identification string in 5- Address-based detection is less reliable than EEPROM-based detection, as different DACS may use same address (observed in Hope this helps. |
I'm following-up from here as it ends-up more as a Volumio 2 topic.
While I was suggesting to initiate START PLUGINS only after
i2sDetect()
(inControllerI2s.prototype.onVolumioStart
) is finished by re-arranging the promises & defer chain, I did some further reading on HAT EEPROM and i2c0 and i2c1.It seems to turn out that actually eeprom read should normaly happen on i2c0 (rather than i2c1) as ID_SC and ID_SD (GPIO0/SCL and GPIO1/SDA) are reserved for board detection / identification.
Actually one can find different methods to extract EEPROM info (sample code in earlier link), but the following is quite promising:
Then it's just a matter of reading
/proc/device-tree/hat
which is definitely simpler, immediate and won't delay things (as i2cdetect does) when nothing is connected. It seems information is also dynamically updated on 4.4.y.Wouldn't that be sufficient for Volumio DAC detection?
The text was updated successfully, but these errors were encountered: