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

Add USB audio support #708

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/minidexed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <circle/sound/pwmsoundbasedevice.h>
#include <circle/sound/i2ssoundbasedevice.h>
#include <circle/sound/hdmisoundbasedevice.h>
#include <circle/sound/usbsoundbasedevice.h>
#include <circle/gpiopin.h>
#include <string.h>
#include <stdio.h>
Expand Down Expand Up @@ -200,6 +201,16 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt,
// The channels are swapped by default in the HDMI sound driver.
// TODO: Remove this line, when this has been fixed in the driver.
m_bChannelsSwapped = !m_bChannelsSwapped;
#endif
}
else if (strcmp (pDeviceName, "usb") == 0)
{
#if RASPPI<=3
LOGNOTE ("USB mode NOT supported on RPI 1-3.");
#else
LOGNOTE ("USB mode");

m_pSoundDevice = new CUSBSoundBaseDevice (pConfig->GetSampleRate ());
#endif
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/minidexed.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
SoundDevice=pwm
#SoundDevice=hdmi
SampleRate=48000
#ChunkSize=256
#ChunkSize=384
DACI2CAddress=0
ChannelsSwapped=0
# Engine Type ( 1=Modern ; 2=Mark I ; 3=OPL )
Expand Down
Loading