Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


HifiBerry DAC2 HD support
#21
(03-04-2021, 03:09 PM)Marrahm Wrote: Make sure you use the “sudo” command when you type it in.  I just double checked and it worked fine.  When you do ctl-o, it will show the full name of the file its saving (boot/config...). All you need to do is hit return and it will confirm that it wrote X lines.  Let me know if that doesn’t work.

I am getting somewhere. Got it to save.

In MPD settings it shows as: snd_rpi_hifiberry_dacplushd

In L2S Audio Device, what should I select as Device?

Thanks for your help.
Reply
#22
Why not update Moode to the latest? That alone might fix your airplay issue.
Reply
#23
Great.  I just kept 12s blank since the HD isn’t on the list.  Works just fine.  It does not seem to matter since the other changes set the HD up anyway. To add the HD to the list for I2S, you have to follow that part of Mystic’s instructions.  Since it worked w/o it, i have not tried that option yet.  

Mike
Reply
#24
(03-04-2021, 07:40 PM)agaufres Wrote: Yes, I thought that too. From a technical point, it makes no sense that a device is supported before it is created.

But the documentation says the driver is supported from Linux 4.x or high.
https://www.hifiberry.com/docs/software/...ux-3-18-x/

So I thought the driver was a generic one, already available on some old distributions.

I don't understand this kernel and driver thing.

So I downloaded and loopback mounted moode-531-iso.img

The /boot/overlays directory contains these device tree blob overlays (you can look it up Smile) for hifiberry products.

Code:
hifiberry-amp.dtbo
hifiberry-dac.dtbo
hifiberry-dacplusadc.dtbo
hifiberry-dacplus.dtbo
hifiberry-digi.dtbo
hifiberry-digi-pro.dtbo

 I don't see hifiberry-dacplushd.dtbo among them (which doesn't suprise me).

I understand the desire to go backwards to an old working version of moOde but as was just suggested, going forward seems more appropriate.

Regards,
Kent
Reply
#25
If I reorder entries by id in cfg_audiodev, should I update the hash again? - Answered: yes!!!

I don't like that the new HiFiBerry DAC2 HD entry is at the back of the list, I'd rather prefer to find it with the other HiFiBerry entries, hence I'm in a small python script to do that :-). But once it's done, should the hash be updated?

Thanks

Edit:

ssh into your moode,
sudo nano /tmp/switchid.py

copy paste the code here under :

Code:
#!/usr/bin/python3

# This script helps to reorganize the entries in the cfg_audiodev to place a new
# entry at a given place in MoOde.
# this script assume there are no current ID + 1000 value in the table! You
# should check first this is true!

import sys, getopt, os

def main(argv):
 currentId = ''
 newId = ''
 try:
    opts, args = getopt.getopt(argv,"c:n:",["cid=","nid="])
 except getopt.GetoptError:
    print ('test.py -c <currentId> -n <newId>')
    sys.exit(2)
 for opt, arg in opts:
    if opt == '-h':
       print ('test.py -c <currentId> -n <newId>')
       sys.exit()
    elif opt in ("-c", "--cid"):
       currentId = arg
    elif opt in ("-n", "--nid"):
       newId = arg
 if currentId == '' or newId == '':
    print ('test.py -c <currentId> -n <newId>')
    sys.exit(2)

 print ('Current ID is ', currentId)
 print ('New ID is ', newId)

 tempId = int(currentId) + 1000
 command = os.popen('sudo sqlite3 /var/local/www/db/moode-sqlite3.db " UPDATE cfg_audiodev SET id = %s WHERE id = %s;"' % (tempId, currentId)).read()
 print(command)

 for id in range(int(currentId)-1, int(newId)-1, -1):
    command = os.popen('sudo sqlite3 /var/local/www/db/moode-sqlite3.db " UPDATE cfg_audiodev SET id = %s WHERE id = %s;"' % (id+1, id)).read()
    print(command)

 command = os.popen('sudo sqlite3 /var/local/www/db/moode-sqlite3.db " UPDATE cfg_audiodev SET id = %s WHERE id = %s;"' % (newId, tempId)).read()
 print(command)


if __name__ == "__main__":
 main(sys.argv[1:])

ctrl + x, enter to save and exit nano.

execute it like this:

python switchid.py -c 75 -n 47 (-c the current id of my entry in cfg_audiodev (HiFiBerry DAC2 HD), -n the place I want to find it in the list of devices in audio config GUI).

You'll have to recreate hash as explained by Mystic here on top of the thread like this:

sudo sqlite3 /var/local/www/db/moode-sqlite3.db "SELECT * FROM cfg_audiodev WHERE drvoptions NOT IN ('slave', 'glb_mclk') AND chipoptions = ''" > /tmp/moode-devices-new.txt
php -r 'echo md5(file_get_contents("/tmp/moode-devices-new.txt"));'

copy-paste the output, this should be something like this c8f05964fff3b968a21d09d0f57c1174

sudo sqlite3 /var/local/www/db/moode-sqlite3.db "DROP TRIGGER ro_columns"
sudo sqlite3 /var/local/www/db/moode-sqlite3.db "UPDATE cfg_hash SET value='YOUR_HASH_VALUE_HERE' WHERE id=8"
sudo sqlite3 /var/local/www/db/moode-sqlite3.db "CREATE TRIGGER ro_columns BEFORE UPDATE OF param, value, [action] ON cfg_hash FOR EACH ROW BEGIN SELECT RAISE(ABORT, 'read only'); END"

and then

sudo reboot

It worked for me on MoOde 7.0.1.

Pay attention that the python script assumes there is no entries with ID = currentId + 1000 value!!!

All the best,

Greg
Reply
#26
@Marrahm,

Hi Mike,

I just went over again to this on an untouched SD image of MoOde 7.0.1.
I can confim you now that the Mystic method alone is sufficient to have the DAC2 HD working.

I just wrote the above little python script to find the entry for it in the list with the other HiFiBerry DACs, and not at the end of the list, just for convenience.

In MPD config, I need to put Volume Mixer / mixer type to disabled (0db output) and it plays local files, radios, Spotify connect no problem.

All the best,

Greg
Reply
#27
(03-04-2021, 09:04 PM)Marrahm Wrote: Great.  I just kept 12s blank since the HD isn’t on the list.  Works just fine.  It does not seem to matter since the other changes set the HD up anyway. To add the HD to the list for I2S, you have to follow that part of Mystic’s instructions.  Since it worked w/o it, i have not tried that option yet.  

Mike

I have been using it for a week now and it works great. Will check out Mystic's instructions too.

Thanks again.
Reply
#28
Just ordered the HiFiBerry DAC2 HD. Will this be included in a future update, or do i need to learn to update code myself?
Reply
#29
Just pick the overlay.

   
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#30
(05-18-2021, 10:39 AM)Tim Curtis Wrote: Just pick the overlay.

Tim,
Thanks for rolling this in. Works perfectly. 

Mike
Reply


Forum Jump: