Skip to content
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

i2s_dacs/index.js always overwrites existing /boot/config.txt #946

Closed
protenhan opened this issue Jan 10, 2017 · 4 comments
Closed

i2s_dacs/index.js always overwrites existing /boot/config.txt #946

protenhan opened this issue Jan 10, 2017 · 4 comments

Comments

@protenhan
Copy link

I think it is not a good idea to fully overwrite the /boot/config.txt when switching i2s_dacs settings.

Here an example to illustrate my problem:
I have a RPI2 with the official RPI touch screen and an Hifiberry AMP +. I mounted the touch screen in a way that needs the /boot/config.txt to contain lcd_rotate=2 to rotate the screen content 180 degree to be right sight up. I also increased the gpu memory to 64MB for the touch screen to work smoothly. Now every time I change the i2c_dacs settings the whole /boot/config.txt gets overwritten.

My suggestion for fixing this would be that the volumio app contains some sort of API that can be also be accessed by Plugins (e.g. the TouchScreen Plugin) to modify, add or delete existing values of the /boot/config.txt.

Disclaimer: I'm not familiar with node.js so I have no idea how something like this would be implemented.

@macmpi
Copy link
Contributor

macmpi commented Jan 16, 2017

Indeed writeI2SDAC and disableI2SDAC should apply dtoverlay= changes with sed-like search/replace rather than rewriting config.txt as a whole.

@macmpi
Copy link
Contributor

macmpi commented Mar 29, 2017

@xipmix wrote:

Is it possible for there to be more than one dtoverlay= line in a /boot/config.txt file?

Yes, in general there can be dtoverlay= lines for multiple different Pi features, not just audio-related. However, the only part of Volumio2 altering /boot/config.txt currently is that one, and is focused on audio-only parameters.

The only 2 modifying sources I find are writeI2SDAC and disableI2SDAC I think.
writeI2SDAC it's probably easy, as routine exactly knows what to add as a complete line.
disableI2SDAC can be more tricky indeed, but actually it can only refer to a DAC listed in dacs.json, so search/replace of exact line dtoverlay=targettedDAC is probably relevant, testing all possible ones (not that many).

Other option could be to put a sort of dedicated Audio section in /boot/config.txt, between #***Volumio Audio output settings***
#***Volumio specific do not alter***
markers for instance (to be added here in Build in case), and nail-down adds & searches in-between those lines?
Then it's just a 1 one-line "easy" replacement/removal as, at a maximum, only one sound-out dtoverlay= DAC directive can be present in there at a time.

@macmpi
Copy link
Contributor

macmpi commented May 14, 2017

addressed in #1176

@macmpi
Copy link
Contributor

macmpi commented May 30, 2017

With merged fix, you may close this issue

@volumio volumio closed this as completed May 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants