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

Support for I2S DACs etc #1333

Closed
shawaj opened this issue Jul 18, 2016 · 21 comments
Closed

Support for I2S DACs etc #1333

shawaj opened this issue Jul 18, 2016 · 21 comments

Comments

@shawaj
Copy link

shawaj commented Jul 18, 2016

Hi,

Got a new I2S DAC for Raspberry Pi we're developing and want to make sure it will work with Sonic Pi. Just wanted to see if there was anything to be aware of? And to understand the best way to ensure support?

Know this is probably not the right place to ask but couldn't find any other way to contact.

Thanks in advance

@samaaron
Copy link
Collaborator

Hi,

I have an iquaudio hat which works just fine with i2s on the latest Sonic Pi. All I need to do is enable the device tree overlay with /boot/config.txt.

If you want to send me one to play with I can make sure it works. Does your hat have audio in?

@rbnpi
Copy link
Contributor

rbnpi commented Jul 19, 2016

just as a passing comment, one dac that I haven't got to work yet (with Sonic Pi) is the Pimoroni pHat Audio hat. Based on HiFiBerry (uses same chip). Anyone else had any luck with this?

@shawaj
Copy link
Author

shawaj commented Jul 19, 2016

@samaaron can you email me your address ( shawaj at gmail dot com) and I will send over one of each of the cards when they are available (Amp, DAC, Digi HATs and a standalone Amp that stacks).

We don't have audio in on any of these boards, but possibly on a future product.

@TomWhitwell
Copy link

Is there any update on this @shawaj @rbnpi ? I was actually about to buy a pi zero & pHat to run Sonic Pi!

@shawaj
Copy link
Author

shawaj commented Aug 12, 2016

Not sure about our new range yet but I believe the iqaudio and HiFiberry boards already work with Sonic Pi?

Not sure about the DAC pHAT from Pimoroni though. Is that the one you're looking at?

@TomWhitwell
Copy link

@shawaj This is the one I was looking at: https://shop.pimoroni.com/products/phat-dac
I haven't done anything on Pi before, but this looked nice for something along these lines.

@shawaj
Copy link
Author

shawaj commented Aug 12, 2016

Hmm... Looks like someone's been having problems - https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=152417

But also someone having success - "Andrea's advice is spot on about adding dtoverlay=i2s-mmap which is needed to run sonic pi, on Jessie anyway.
sudo nano /boot/config.txt
and add the line: dtoverlay=i2s-mmap
Sound quality is so much better than the default, which is, frankly, unusable.
Wish I'd got the long pins female socket to be able to stack hats:
https://shop.pimoroni.com/collections/prototyping/products/2x20-pin-gpio-header-for-raspberry-pi-2-b-a"

From here...
https://shop.pimoroni.com/products/phat-dac#shopify-product-reviews

@TomWhitwell
Copy link

@shawaj Brilliant, thanks - that's good enough to risk £30 or whatever...

The other platform I'm interested in is PocketCHIP - I'm not sure anyone has yet got it running there https://bbs.nextthing.co/t/sonic-pi-on-the-chip/3847/10

@rbnpi
Copy link
Contributor

rbnpi commented Aug 12, 2016

I still haven't got the pimoroni board to work with so. I also have the iqaudio board which works fine. I think the berry bosrd also works.

Sent from my iPhone

On 12 Aug 2016, at 22:12, Tom Whitwell notifications@github.com wrote:

@shawaj Brilliant, thanks - that's good enough to risk £30 or whatever...

The other platform I'm interested in is PocketCHIP - I'm not sure anyone has yet got it running there https://bbs.nextthing.co/t/sonic-pi-on-the-chip/3847/10


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@shawaj
Copy link
Author

shawaj commented Aug 12, 2016

Yeah that would be great actually. What's the audio like on the pocketchip?

@TomWhitwell
Copy link

It comes with Sunvox installed, sounds pretty good to me

@shawaj
Copy link
Author

shawaj commented Aug 12, 2016

It uses the same chip as the original HiFiberry DAC so should work if that
one does. Which I'm not sure of as haven't tested it.

There is a report on that Pimoroni review of someone getting it to work.

Thanks

On 12 Aug 2016 10:47 p.m., "Robin Newman" notifications@github.com wrote:

I still haven't got the pimoroni board to work with so. I also have the
iqaudio board which works fine. I think the berry bosrd also works.

Sent from my iPhone

On 12 Aug 2016, at 22:12, Tom Whitwell notifications@github.com wrote:

@shawaj Brilliant, thanks - that's good enough to risk £30 or whatever...

The other platform I'm interested in is PocketCHIP - I'm not sure anyone
has yet got it running there https://bbs.nextthing.co/t/
sonic-pi-on-the-chip/3847/10


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1333 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADNCuiwp6MhgxjBvMPJfficCXX73JCMUks5qfOoJgaJpZM4JPPq9
.

@rbnpi
Copy link
Contributor

rbnpi commented Aug 13, 2016

I know the phat dac from pimoroni uses the same chip as the HiFi Berry board, but the installation is a bit odd. It does not appear in the audio prefs in raspbian which Sonic Pi uses to select the appropriate output, and I haven't managed to get SP to recognise its existence, even by trying some of the hacks I had to use when the IQAudio board first came out. Otherwise the board works fine: I use it in an air play project, playing music from my iPhone to speakers. I am posting a query on the pimoroni forum to ask about this. Will report back.

@shawaj
Copy link
Author

shawaj commented Aug 13, 2016

Did you do the manual setup or did you use the auto setup script?

On 13 Aug 2016 10:02 a.m., "Robin Newman" notifications@github.com wrote:

I know the phat dac from pimoroni uses the same chip as the HiFi Berry
board, but the installation is a bit odd. It does not appear in the audio
prefs in raspbian which Sonic Pi uses to select the appropriate output, and
I haven't managed to get SP to recognise its existence, even by trying some
of the hacks I had to use when the IQAudio board first came out. Otherwise
the board works fine: I use it in an air play project, playing music from
my iPhone to speakers. I am posting a query on the pimoroni forum to ask
about this. Will report back.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1333 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADNCulqpJDSqPueOe6SR1Q5_LKTDI34cks5qfYgbgaJpZM4JPPq9
.

@rbnpi
Copy link
Contributor

rbnpi commented Aug 13, 2016

I think I’ve tried both. It was some time ago...
I bought the dac principally to use with SP. Now I use it in an Air play project on a pizero and it works well with that playing music from my iPhone.

On 13 Aug 2016, at 10:26, Aaron Shaw notifications@github.com wrote:

Did you do the manual setup or did you use the auto setup script?

On 13 Aug 2016 10:02 a.m., "Robin Newman" notifications@github.com wrote:

I know the phat dac from pimoroni uses the same chip as the HiFi Berry
board, but the installation is a bit odd. It does not appear in the audio
prefs in raspbian which Sonic Pi uses to select the appropriate output, and
I haven't managed to get SP to recognise its existence, even by trying some
of the hacks I had to use when the IQAudio board first came out. Otherwise
the board works fine: I use it in an air play project, playing music from
my iPhone to speakers. I am posting a query on the pimoroni forum to ask
about this. Will report back.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1333 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADNCulqpJDSqPueOe6SR1Q5_LKTDI34cks5qfYgbgaJpZM4JPPq9
.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@shawaj
Copy link
Author

shawaj commented Aug 13, 2016

It's odd because the setup instructions are almost identical. The only
difference with the pHAT and the current HiFiberry boards is the lack of an
EEPROM for auto config and no hardware volume control.

I wouldn't have thought this would make any difference though.

On 13 Aug 2016 10:28 a.m., "Robin Newman" notifications@github.com wrote:

I think I’ve tried both. It was some time ago...

On 13 Aug 2016, at 10:26, Aaron Shaw notifications@github.com wrote:

Did you do the manual setup or did you use the auto setup script?

On 13 Aug 2016 10:02 a.m., "Robin Newman" notifications@github.com
wrote:

I know the phat dac from pimoroni uses the same chip as the HiFi Berry
board, but the installation is a bit odd. It does not appear in the
audio
prefs in raspbian which Sonic Pi uses to select the appropriate
output, and
I haven't managed to get SP to recognise its existence, even by trying
some
of the hacks I had to use when the IQAudio board first came out.
Otherwise
the board works fine: I use it in an air play project, playing music
from
my iPhone to speakers. I am posting a query on the pimoroni forum to
ask
about this. Will report back.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1333
issuecomment-239611048>,
or mute the thread
<https://github.com/notifications/unsubscribe-
auth/ADNCulqpJDSqPueOe6SR1Q5_LKTDI34cks5qfYgbgaJpZM4JPPq9>
.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1333 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADNCurhPsnt8SE4SmGNvaRXGm0po6J3dks5qfY49gaJpZM4JPPq9
.

@MichaelZP
Copy link

https://volumio.org/forum/volume-control-issues-volumio1-rpi-zero-dac-phat-t4319.html

MZP

2016-08-13 11:30 GMT+02:00 Aaron Shaw notifications@github.com:

It's odd because the setup instructions are almost identical. The only
difference with the pHAT and the current HiFiberry boards is the lack of an
EEPROM for auto config and no hardware volume control.

I wouldn't have thought this would make any difference though.

On 13 Aug 2016 10:28 a.m., "Robin Newman" notifications@github.com
wrote:

I think I’ve tried both. It was some time ago...

On 13 Aug 2016, at 10:26, Aaron Shaw notifications@github.com wrote:

Did you do the manual setup or did you use the auto setup script?

On 13 Aug 2016 10:02 a.m., "Robin Newman" notifications@github.com
wrote:

I know the phat dac from pimoroni uses the same chip as the HiFi
Berry
board, but the installation is a bit odd. It does not appear in the
audio
prefs in raspbian which Sonic Pi uses to select the appropriate
output, and
I haven't managed to get SP to recognise its existence, even by
trying
some
of the hacks I had to use when the IQAudio board first came out.
Otherwise
the board works fine: I use it in an air play project, playing music
from
my iPhone to speakers. I am posting a query on the pimoroni forum to
ask
about this. Will report back.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1333
issuecomment-239611048>,
or mute the thread
<https://github.com/notifications/unsubscribe-
auth/ADNCulqpJDSqPueOe6SR1Q5_LKTDI34cks5qfYgbgaJpZM4JPPq9>
.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1333 (comment)
,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/
ADNCurhPsnt8SE4SmGNvaRXGm0po6J3dks5qfY49gaJpZM4JPPq9>
.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1333 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQc2fVKuleCBeYRJ1d0hJoWz4SIphzeaks5qfY7OgaJpZM4JPPq9
.

@rbnpi
Copy link
Contributor

rbnpi commented Aug 15, 2016

I tried again with my phat dac on a fresh install and it worked with Sonic-Pi. (you need to add the dtoverlay=i2s-mmap to the config.txt file in the boot partition as well as the two changed in the phat dac install instructions giving changes :

#dtparam=audio=on
dtoverlay=hifiberry-dac
dtoverlay=i2s-mmap

Note commenting out the dtparam=audio=on makes sure that the phatdac is in card slot 0 where Sonic Pi will find it despite ther being no entry in the audio device preferences.
There is no volume adjustment available for the card, but this can be done on the external amp it is feeding.

Not also I upgraded the kernel to get rid of crackling on the sound as per this (see the end of the discussion for solution):
raspberrypi/linux#1497

@shawaj
Copy link
Author

shawaj commented Aug 15, 2016

You can't do hardware volume control with pHAT DAC but you should be able
to do software volume control?

On 15 Aug 2016 5:58 p.m., "Robin Newman" notifications@github.com wrote:

I tried again with my phat dac on a fresh install and it worked with
Sonic-Pi. (you need to add the dtoverlay=i2s-mmap to the config.txt file in
the boot partition as well as the two changed in the phat dac install
instructions giving changes :

#dtparam=audio=on
dtoverlay=hifiberry-dac
dtoverlay=i2s-mmap

Note commenting out the dtparam=audio=on makes sure that the phatdac is in
card slot 0 where Sonic Pi will find it despite ther being no entry in the
audio device preferences.
There is no volume adjustment available for the card, but this can be done
on the external amp it is feeding.

Not also I upgraded the kernel to get rid of crackling on the sound as per
this (see the end of the discussion for solution):
raspberrypi/linux#1497 raspberrypi/linux#1497


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1333 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADNCugjsQTxpa5pqDKt2yGGrIN2C-Kzxks5qgJrMgaJpZM4JPPq9
.

@MichaelZP
Copy link

but you should be able to do software volume control?
exactly, how to in the link: https://volumio.org/forum/
volume-control-issues-volumio1-rpi-zero-dac-phat-t4319.html

MZP

2016-08-15 22:10 GMT+02:00 Aaron Shaw notifications@github.com:

You can't do hardware volume control with pHAT DAC

On 15 Aug 2016 5:58 p.m., "Robin Newman" notifications@github.com wrote:

I tried again with my phat dac on a fresh install and it worked with
Sonic-Pi. (you need to add the dtoverlay=i2s-mmap to the config.txt file
in
the boot partition as well as the two changed in the phat dac install
instructions giving changes :

#dtparam=audio=on
dtoverlay=hifiberry-dac
dtoverlay=i2s-mmap

Note commenting out the dtparam=audio=on makes sure that the phatdac is
in
card slot 0 where Sonic Pi will find it despite ther being no entry in
the
audio device preferences.
There is no volume adjustment available for the card, but this can be
done
on the external amp it is feeding.

Not also I upgraded the kernel to get rid of crackling on the sound as
per
this (see the end of the discussion for solution):
raspberrypi/linux#1497 <raspberrypi/linux#1497


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1333 (comment)
,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/
ADNCugjsQTxpa5pqDKt2yGGrIN2C-Kzxks5qgJrMgaJpZM4JPPq9>
.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1333 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQc2fTeBE9whHM4l91t9hgZ6j5wPuAfrks5qgMeagaJpZM4JPPq9
.

@samaaron
Copy link
Collaborator

Closing this for now.

The general solution for i2s DACs is to first ensure the device is configured correctly w.r.t. device tree overlay in /boot/config.txt. You then need to start jack manually configuring it to connect to your audio device either using the command line with the correct args or a GUI such as qjackctl. Once you've booted jack correctly you can then start Sonic Pi which will use your existing jack server rather than attempt to boot its own.

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

5 participants