How to stream IOS audio app (spotify/pandora) via USB on older CX5 (2012-2014)

poshea

Member
:
Mazda CX-5 GT 2013
I've done some searching on this one, but yet to find a solution that works.

I don't use the stock Music app that comes with iPhone. In the car I generally stream either Pandora or Spotify. This works fine over Bluetooth. But I'm trying to see if there is a way to use USB instead as I usually have my phone charging as I drive anyway, and other benifits would be slightly better audio quality compared to Bluetooth and USB audio can start playing sooner, rather than waiting for Bluetooth to startup/contacts sync etc.

What happens at the moment is, when the phone is connected to USB, it sees it as an iPOD and directly accesses and starts playing from my local "MUSIC APP" library. If I then start Pandora or Spotify, it attempts to start streaming the song (infact I hear it for just a second) before it force switches back to the MUSIC APP.

Even if I close the MUSIC app (which stops playback), as soon as I hit play in Pandora/Spotify I only hear for a second before it switches to audio from MUSIC App.

Anyone found a workaround?
 
I've done some searching on this one, but yet to find a solution that works.

Anyone found a workaround?

I was bothered by this also. I just got a 2014 CX-5, wit hthe Bose system. I used my iPH6S with BT and found it lacking. My previous car had a USB-iPhone connection that worked flawlwessly.
I'm going to try a iPhone dock that has audio out, ue the auio-in jack that way.
apple-lightning-dock-4.jpg


Also, Mazda announced that Car Play will be coming for all Mazda connect head units. You could wait for that to see if your iPhone will connect that way.
 
Last edited:
I think this is a phone issue.

EDIT: If you google this issue you'll find it occurring in many vehicles, and possibly some workarounds to try.
 
Last edited:
Here is what I've discovered so far...

Yes this is indeed an issue that affects many makes and models. It seems to me that the core problem is how the head unit handles the control messages. (Play/Pause/skip)

We know on Bluetooth, generic Play, Pause and skip messages sent from the head unit will control whatever the currently active or last used app is. So if the stock music app is running, it will control that. If it's spotify or pandora it will control that. It could even be YouTube or Facebook. Just last night I'd watched a video on Facebook, jumped in the car shortly after, and when Bluetooth audio connected I heard the audio from that video through the cars system.

USB does not handle these control signals in the same way. The Play, Pause, Skip controls are sent specifically to the stock Music App. Even if you send a play signal from the phone in another app, the head unit relays back a specific play signal to the stock Music App. This would explain why when you press play in Spotify or Pandora you hear that music for a second before the stock music app receives its play signal and takes over.

So, the key is to stop these control signals from the head unit from getting to the phone.

I see 3 possible solutions.

1. The ideal would be fixing the source, the head unit. If the firmware of the head unit could be altered to handle USB control in the same way it does Bluetooth - that would be ideal. I think this is the least likely, as I've found nothing on even upgrading this head units firmware - let alone modifying it!

2. Modifying the USB-lightning cable. In theory, if you disabled one way data communication on the lightning cable, so data could travel from the phone to the head unit, but not from the head unit to the phone... Then those specific control signals the head unit is force feeding the stock music app would never arrive, and my guess is, whatever app you play from will continue to play. Downside would be that you would not be able to control the phone from the head unit or steering wheel.

3. Final option would be alter how the phone handles these control messages. Basically filtering or rerouteing them. This would require a jailbroken phone.

There are two tweaks that claim to do these functions. "StopPlayin9'" is a tweak that stops auto-play of the stock music app. "DefaultPlayer Pro" is a more advanced tweak that claims to do the following...

DefaultPlayer Pro enables you to choose your default music player on the iOS platform. DefaultPlayer Pro will intercept and replace player launching behaviour under all of the below conditions:

- When beginning playback from remote control and MFi accessories (e.g. bluetooth devices, wired or wireless docks, car stereos). This includes overriding third-party behaviour exhibited by some devices that may otherwise force automatic playback from the Music app, amongst other things;

So this app would in theory take these control signals the head unit is trying to send to the stock music app and reroute them on to the music app of your choosing. Sounds promising!!

Think I'm getting closer. Let me know if anyone has success.
 
Last edited:
Here is what I've discovered so far...

Yes this is indeed an issue that affects many makes and models. It seems to me that the core problem is how the head unit handles the control messages. (Play/Pause/skip)

We know on Bluetooth, generic Play, Pause and skip messages sent from the head unit will control whatever the currently active or last used app is. So if the stock music app is running, it will control that. If it's spotify or pandora it will control that. It could even be YouTube or Facebook. Just last night I'd watched a video on Facebook, jumped in the car shortly after, and when Bluetooth audio connected I heard the audio from that video through the cars system.

USB does not handle these control signals in the same way. The Play, Pause, Skip controls are sent specifically to the stock Music App. Even if you send a play signal from the phone in another app, the head unit relays back a specific play signal to the stock Music App. This would explain why when you press play in Spotify or Pandora you hear that music for a second before the stock music app receives its play signal and takes over.

So, the key is to stop these control signals from the head unit from getting to the phone.

I see 3 possible solutions.

1. The ideal would be fixing the source, the head unit. If the firmware of the head unit could be altered to handle USB control in the same way it does Bluetooth - that would be ideal. I think this is the least likely, as I've found nothing on even upgrading this head units firmware - let alone modifying it!

2. Modifying the USB-lightning cable. In theory, if you disabled one way data communication on the lightning cable, so data could travel from the phone to the head unit, but not from the head unit to the phone... Then those specific control signals the head unit is force feeding the stock music app would never arrive, and my guess is, whatever app you play from will continue to play. Downside would be that you would not be able to control the phone from the head unit or steering wheel.

3. Final option would be alter how the phone handles these control messages. Basically filtering or rerouteing them. This would require a jailbroken phone.

There are two tweaks that claim to do these functions. "StopPlayin9'" is a tweak that stops auto-play of the stock music app. "DefaultPlayer Pro" is a more advanced tweak that claims to do the following...

DefaultPlayer Pro enables you to choose your default music player on the iOS platform. DefaultPlayer Pro will intercept and replace player launching behaviour under all of the below conditions:

- When beginning playback from remote control and MFi accessories (e.g. bluetooth devices, wired or wireless docks, car stereos). This includes overriding third-party behaviour exhibited by some devices that may otherwise force automatic playback from the Music app, amongst other things;

So this app would in theory take these control signals the head unit is trying to send to the stock music app and reroute them on to the music app of your choosing. Sounds promising!!

Think I'm getting closer. Let me know if anyone has success.

I find OEM head units in vehicles tend to follow specifications very exactly. It's why the USB ports don't deliver much power - they're firmly set to the USB 2 spec, even though delivering extra power is common in other venues... So I'm thinking this behavior is probably "to spec" somewhere. Sounds like altering phone default behavior is a good try.
 
I've had semi-success. I installed a Flex patch called "Disable Music.app Autoplay - iOS 9.x" This worked at stopping the Mazda head unit from playing my Music.app.

So you turn the car on with phone connected to USB and screen sais "Preparing for connection. Please wait". Once system is initialised, the message changes to "iPod Reading" with a spinning wheel. Before installing the flex patch, at this point it would play my Music.app library. After patch, it just keeps spinning. So at this point, I switch to FM/AM or Bluetooth page and then back to iPod page. The "iPod Reading" message and spinning wheel are gone, and I'm left with blank page.

At this stage I have had 3 different things happen.
1) Pandora and Spotify music streamed over USB smoothly. Song/artist/album info was not displayed and I was unable to pause/play or skip from the head unit or steering wheel. I could do those things from the phone though. I was able to replicate this a few times.
2) On other attempts the same thing happened except Pandora or Spotify would get stuck in an endless loop of playing and pausing. It would play for a second... Then pause... Then play etc Switching from FM or AM then back to IPod would stop this behaviour and audio would stream smoothly, but any play, pause or skip pressed on the phone would resume the play-pause loop and I'd have to flick to FM and back to stop it.
3) On another attempt I got no audio at all, even though Pandora said it was playing.

At the moment, it's pretty flakey. Haven't worked out yet why these 3 different states. Perhaps the timing of interrupting the iPod Reading process??

I'll keep testing...
 
Last edited:
Here is what I've discovered so far...

"DefaultPlayer Pro" is a more advanced tweak that claims to do the following...

DefaultPlayer Pro enables you to choose your default music player on the iOS platform. DefaultPlayer Pro will intercept and replace player launching behaviour under all of the below conditions:

- When beginning playback from remote control and MFi accessories (e.g. bluetooth devices, wired or wireless docks, car stereos). This includes overriding third-party behaviour exhibited by some devices that may otherwise force automatic playback from the Music app, amongst other things;

So this app would in theory take these control signals the head unit is trying to send to the stock music app and reroute them on to the music app of your choosing. Sounds promising!!

Think I'm getting closer. Let me know if anyone has success.

I'm jailbroken and purchased DefaultPlayer Pro for 0.99. It sorta works. You set your default player to a radio app for example and when the USB connection automatically plays 'iPod' your default selected source will play. But it's intermittent. After one song played, it stopped and I could not get it working again. I tried a 'respricng' of the iPhone, didn't help.
I'll keep trying this, maybe chat with the developer.
 
I'm jailbroken and purchased DefaultPlayer Pro for 0.99. It sorta works. You set your default player to a radio app for example and when the USB connection automatically plays 'iPod' your default selected source will play. But it's intermittent. After one song played, it stopped and I could not get it working again. I tried a 'respricng' of the iPhone, didn't help.
I'll keep trying this, maybe chat with the developer.

Thanks ClemClone for trying out DefaultPlayer Pro. Looking forward to hearing your results after you play with the settings a bit more. I'm curious if the song/artist/album info from your DefaultPlayer app showed up on the iPod page of the head unit, and if you still had transport control on the head unit. Or if like me with the StopPlayin tweak, you just had a blank screen and had to control the app from the phone.

Perhaps try a combination of both DefaultPlayer and StopPlayin to see how that goes. (The Cydia tweak had no affect for me, but the flex patch worked). Also note that switching to FM or AM and then back to iPod seems to reset the head unit if it gets confused. Better to go FM or AM rather than Bluetooth, as Bluetooth connection will send out its own play command to your phone which can confuse things.
 
Thanks ClemClone for trying out DefaultPlayer Pro. Looking forward to hearing your results after you play with the settings a bit more. I'm curious if the song/artist/album info from your DefaultPlayer app showed up on the iPod page of the head unit, and if you still had transport control on the head unit. Or if like me with the StopPlayin tweak, you just had a blank screen and had to control the app from the phone.

This app DefaultPlayer Pro doesn't work. It worked for maybe 4 minutes, now not at all. I looked at all the options settings and I cannot get it to work again.
The USB connection is made, shows 'iPod' in the audio menu setting, but all the display does now is to spin. I tried a lot of different things.
I may try to other app, but I'm not hoepfull.
I'm expecting when Mazda finally supports CarPlay, some time this year, it will fix this, otherwise I'm opting for new H/U
 
Last edited:
This app DefaultPlayer Pro doesn't work. It worked for maybe 4 minutes, now not at all. I looked at all the options settings and I cannot get it to work again.
The USB connection is made, shows 'iPod' in the audio menu setting, but all the display does now is to spin. I tried a lot of different things.
I may try to other app, but I'm not hoepfull.
I'm expecting when Mazda finally supports CarPlay, some time this year, it will fix this, otherwise I'm opting for new H/U

Hey ClemClone. If it's spinning, it means it's still trying to access your stock Music.app. Did you install the "Disable Music.app Autoplay" flex patch I mentioned?

Also, it's probably worth mentioning that we could experience slightly different results depending on the variables in the software versions of our systems. I recently had my Bluetooth module replaced, so it is running Firmware 07.02.000. My SH is version KJ01-4C-A11 and R32 is KJ01-4SRA11-AD. You can find these out by pressing and holding the Power/volume knob quick followed by the seek forward button. Then code 38 will show you your Bluetooth module firmware, or code 10 will show you the head units.

In any case, I ended up purchasing DefaultPlayer Pro also, and while it does open my player of choice when the head unit connects, it doesn't really help with the other problem, which is the system freaking out either the end of/start of a new song, or when you skip to next song. In my system, it goes into an endless play/pause loop.

I did a full trip last night and could consistently play a full song over USB, as soon as the next song started it would pause-play-pause-play... Flicking to the FM page and then back to iPod would stop the pause-play loop and the next song would either continue to play (if I happened to flick back while it was on play) or it would hold on pause and I could hit play and the next track would play fine until it gets to the end, at which time it play-pause loops again and I have to flick to FM page and back to continue. Interestingly, I can manually pause and play the songs mid song with no problem, the issue is something in the signal specifically sent at the start of a new song.

I have posted on a forum for iOS programmers and developers in the hope someone might be able to help me pinpoint what the problematic signal is, and can it be filtered using a similar method to the flex patch that is stopping the Music.app from playing.

I still believe a custom flex patch that addresses both the stock music.app (which is already working) and these system wide playback commands that are freaking the system out - then we could have a working solution.

I also had another idea approaching this problem from another direction. We know the USB port can either work in iPod mode when a phone or iPod is connected OR USB mode when a USB memory stick is used. There are a few tweaks that allow you to use your phone as if it were a USB drive. I wonder if we could fool the head unit into thinking the phone was a USB drive, how the head unit would respond to streaming audio in USB mode... Hmm
 
A step closer today. I started sifting through some of the audio classes in flex. Started with the Pandora executable, and found a class called PMRemoteControlMangager. I enabled -(void) remoteControlPause and -(void) remoteControlPlay.

This did effectively stop the head unit from being able to play and pause the app. Before the patch, Pandora would play for about 2 secs, the pause for 2 seconds and then play etc You would see the transport button change from play icon to pause icon.

After the patch, Pandora would not switch to pause, it would continue to play BUT there is still something coming from the head unit cause an interruption in the audio stream. It now plays for 2secs, and then a short maybe quarter second interruption followed by 2 more seconds and then another 1/4 sec break in the stream. Pandora icon stays on play now though. So still something weird happening. Ill keep playing with flex...
 
A step closer today. I started sifting through some of the audio classes in flex. Started with the Pandora executable, and found a class called PMRemoteControlMangager. I enabled -(void) remoteControlPause and -(void) remoteControlPlay.

Are you then modifying the Flex app directly? Can you give me more details about this. Ar you using a jailbroken iPhone?
TIA
 
I've done some searching on this one, but yet to find a solution that works.

Anyone found a workaround?

My work-around for now, is to use the Apple Lightning Dock with audio-out.
I ran a 3.5 mm male-male cable from the arm rest console, Aux-input jack to the open area behind the shift lever. It's pretty easy to lift the bezel around the shift lever and feed the cable under the center console.
i used a USB power adapter in the outlet, which is switched with the ignition, thankfully. Then added the 3.5mm plug into the back of the dock. Using the 'Aux' input of the H/, I can then use any music app on my phone. I'm hoping for a more eleagnt solution here, but this will work on longer trips.

wigN0zCl.jpg

vz9dBekl.jpg

wnOod3Hl.jpg
 
Back