Fun with the Cambridge Audio CXN-v2

Buckle up, this is a ride.

First off, I have to say that I do love the Cambridge Audio kit, I’ve not got anything fancy, just a CXA-60, a CXN(v2), a CXN and a pair of SX-60s. I’ve been after some Cambridge Audio separates for ages since I originally saw them in Richer Sounds many years ago. When my small Panasonic network player died it was more costly to get it fixed than to buy a new one and, since it was cheaper to buy a new one, I just went for the CXA-60 and the CXN(v2) and kept the speakers I had. The Cambridge Audio stuff does sound truly fabulous and properly love it.

There’s just one (smallish) problem.

I use iTunes to rip all my media and Meta to keep the data tidy. The back end storage is a WD My Cloud Mirror Gen 2 running Twonky 8.1. Twonky isn’t perfect and sometimes it needs a helping hand to properly recognise all album tracks but I really like the sort order it uses and it’s pretty useful for media management.

Most discs tend to have data something like:

The Title, Track Number and Disc Number are the important fields.

With most albums the tracks play in the order they’re expected to, track 1, track2 track 3 etc.

However, there is a bit of a problem with multi-disc albums. For some reason the play order is not set. Sometimes track 1, disc 1 plays first and sometimes track 1 disc 2 plays first. The play order is always alphabetic. So, really, the sort order for multi-disc albums is track number followed by alphabetic sorting of the resultant list. For albums that have two discs this is irritating because the play order is completely out of sequence, for compilations that have around five discs this is a nightmare.

Because I’d given feedback on the Cambridge Audio app I was given the opportunity to do some beta testing with the new app. Naturally, I gave that a go.

One of the things I noticed was that the app displayed a different sort order to the CXN for multi-disc albums (the proper order) but when the album was played via the app the actual play order was different from the displayed play order. That was kind of annoying really.

Investigating things further I used my LG TV do navigate the album structure to see if the same problem occurred there too. The LG TV doesn’t play AIFF files though so, as far as the TV was concerned, there was no content in any of the directories I was looking at. I had to convert all the AIFF files to MP4 files and then the TV could see the files. Not only could the TV see the files but they were displayed and played in the correct order too. To my mind, this meant that the CXN was not asking for the disc number when generating a list of assets to play.

After much back-and-forth with Cambridge Audio support I managed to get the developers to take a look at the problem. The upshot there is that as the albums play correctly when played through a USB stick and other NAS (Synology in this case) there must be a problem with the WD NAS and the way it presents its data. I’m completely not convinced that is the case because the LG TV plays everything correctly and if there was a problem with the NAS that could not happen.

At this point I was thinking I should just buy a new NAS, especially as a disk has died in the WD one, but I’m just too stubborn to give up like that and, although I can’t seem to generate DLNA traffic, I wondered whether it would be possible to snoop the traffic between the CXN and the NAS. Turns out it totally is. I mirrored the NAS port and used my Mac to read all the traffic. Using a packet capture of:

tcpdump -i en5 port 9000 host wdmycloudmirror.local -XAvvv -w cxn.cap --print

Using Wireshark I managed to filter out the HTTP traffic and I could see that when the request came for the album details it looked like this:

<?xml version="1.0" ?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
	<s:Body>
		<u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
			<ObjectID>0$1$12$18640</ObjectID>
			<BrowseFlag>BrowseDirectChildren</BrowseFlag>
			<Filter>dc:title,upnp:class,upnp:album,upnp:originalTrackNumber,id,res,res@protection,res@duration,upnp:searchClass,upnp:artist,upnp:genre,upnp:albumArtURI</Filter>
			<StartingIndex>0</StartingIndex>
			<RequestedCount>100</RequestedCount>
			<SortCriteria>+upnp:originalTrackNumber,+dc:title</SortCriteria>
		</u:Browse>
	</s:Body>
</s:Envelope>


Here it’s pretty easy to see that the sorting requested by the CXN is:

+upnp:originalTrackNumber,+dc:title

So it’s not asking for the disc number at all. The same request from the app looks like this:

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
	<s:Body>
		<u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
			<ObjectID>0$1$12$18640</ObjectID>
			<BrowseFlag>BrowseDirectChildren</BrowseFlag>
			<Filter>*</Filter>
			<StartingIndex>0</StartingIndex>
			<RequestedCount>100</RequestedCount>
			<SortCriteria/>
		</u:Browse>
	</s:Body>
</s:Envelope>

Again, here it’s pretty easy to see that no sorting has been applied to the results. Also, no filtering has been applied to the original request either.

Now, not being a software developer I’m only making a suggestion here but I reckon that adding +pv:numberOfThisDisc to the filtering and sorting of the CXN requests would completely fix the problem with multi-disc albums. I’ve suggested that but it’s out of my hands and I just have to hope that my proposal is accepted…

Plex Database

For a while I’ve been bugged over the location of the Plex database. For me, Plex runs on a WD PR4100 so none of the usual locations ever worked. However, I stumbled across a post that gave a good location for the back-up of the database.

In the “Scheduled Tasks” section of the Plex settings there is the option to set the database backup location. Obviously, I’m not going to change it (I’m not looking for trouble) but it does let me see where the backups are located. In my case they’re stored in:

/mnt/HD/HD_a2/Nas_Prog/plex_conf/Plex Media Server/Plug-in Support/Databases

Now, all I have to do is create a plex directory on my desktop and copy the backup files into the local directory:

scp "sshd@mycloudpr4100.local:/mnt/HD/HD_a2/Nas_Prog/plex_conf/Plex\ Media\ Server/Plug-in\ Support/Databases/*" ~/Desktop/plex

From here it’s a pretty trivial task to start poking around with the data. I like to use TablePlus because it’s just so nice to use. Use com.plexapp.plugins.library.db as the database and you’re good to go.

There are a few interesting tables that let me link the asset data together:

media_items - metadata_item_id
media_parts - media_item_id
media_streams - media_item_id
metadata_items - id

What I’m really interested in though is finding out what codecs are associated with various films. Using Manhunter for example, using a query of:

select metadata_items.title, media_items.video_codec, media_items.audio_codec
from media_items
join metadata_items
on media_items.metadata_item_id = metadata_items.id
where media_items.library_section_id = 1
and metadata_items.title = "Manhunter";

Returns values of:

Whereas a similar query for 2001:

select metadata_items.title, media_items.video_codec, media_items.audio_codec
from media_items
join metadata_items
on media_items.metadata_item_id = metadata_items.id
where media_items.library_section_id = 1
and metadata_items.title = "2001: A Space Odyssey";

returns:

If changing the audio from DTS 5.1 to PCM fixed the buffering issue on Manhunter maybe, just maybe, that’s an issue with other films too. A quick query to find films with dcd audio:

select metadata_items.title, media_items.video_codec, media_items.audio_codec
from media_items
join metadata_items
on media_items.metadata_item_id = metadata_items.id
where media_items.library_section_id = 1
and media_items.audio_codec = "dca";

Shows a lot of films that I’ve watched without issue. Maybe it’s both the audio and video codecs that matter? Trying a query of:

select metadata_items.title, media_items.video_codec, media_items.audio_codec
from media_items
join metadata_items
on media_items.metadata_item_id = metadata_items.id
where media_items.library_section_id = 1
and media_items.audio_codec = "dca"
and media_items.video_codec = "vc1";

Also returns a lot of films I’ve successfully watched, however, “The Big Lebowski” is in this list and that never seems to work using the MKV version. I always end up using the MP4 version of the film. So, it’s possible that the films I think I’ve watched I have but only the MP4 version and not the MKV version. Maybe, if I try the MKV version they’d all fail? Time to find out.

Plex Problems

I use Plex as my back-end video serving platform. I’d love to switch to Jellyfin but not everything in the house has a Jellyfin client and I don’t want to use a mish-mash of multiple platforms because that just makes support a nightmare.

Anyhow, the other day I was watching Manhunter and it kept buffering. The TV in the back room is an old LG TV (LG 60UF850V-ZB). I know from past experience LG don’t seem to support DTS-HD MA 5.1 audio streams but, generally, I’ve not found any issues with DTS 5.1 streams. In the case of Manhunter though the stream kept buffering for no obviously good reason.

Looking at the activity in Plex I could see it was transcoding but it wasn’t making any sense as to why:

Taking a wild punt on the path of least effort, changing the audio to PCM seemed to fix the problem. and Manhunter played out just fine afterwards, no buffering or anything.

Tiring

I find it really annoying that every single time I plug my iPhone into my Mac to sync my music it ask me to trust the computer. I only ever use the one computer, just stop asking me, alright? I mean, sure it isn’t that hard, is it?

Apparently it is. Fortunately, somebody appears to have figured it out: https://www.fireebok.com/resource/fix-iphone-constantly-asking-to-trust-computer-and-enter-password.html

I haven’t tried it yet because I hate resetting things on my phone and given that it’s been working fine for ages (aside from the whole trust issue) I’m slightly reticent to try the proposed solution.

I guess I’ll just have to wait and see how annoying I start to find it…