RaspyFi - Topic: How to change the Shairport sample rate? http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/ Simple:Press Version 5.2.6 ENSen on How to change the Shairport sample rate? http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1726 RaspyFi install and troubleshooting http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1726 I am playing Spotify on Windows 7 and use AirFoil to send it to Shairport.

]]>
Wed, 06 Nov 2013 10:32:27 +0100
tc-fi on How to change the Shairport sample rate? http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1725 RaspyFi install and troubleshooting http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1725 If dmix and alsa are like Windows audio engine, then as long as all DSP effects (bass boost, eq, preamp, etc) are off and source sample rate = mix output sample rate, then no DSP will occur on the samples other than volume and a final dithering that the mixer will perform.

Low volume when playing through Shairport may be due to how the player app volume and system (Master) volume are, or are not working together. What player app and OS are you using?

]]>
Wed, 06 Nov 2013 09:27:14 +0100
ENSen on How to change the Shairport sample rate? http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1724 RaspyFi install and troubleshooting http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1724

tc-fi said

Possibly when disabling dmix the sound was distorted because no conversion to S32_LE was happening. Maybe its dmix that does the conversion to the byte format your DAC needs?
I think in my case, since HRT MSII supports both S16_LE and S24_3LE I can safely bypass dmix for 16/44 and 24/96 files. Just guessing.

That makes sense. So I will have to live with dmix I guess. DO you know what else dmix may be doing? Something that may have impact on teh sound quality?

I also noticed that the volume is much lower from shairport compared to mpd. I wonder if dmix does that or if it has something to do with the Airplay protocol?

]]>
Wed, 06 Nov 2013 06:28:48 +0100
tc-fi on How to change the Shairport sample rate? http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1717 RaspyFi install and troubleshooting http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1717 Possibly when disabling dmix the sound was distorted because no conversion to S32_LE was happening. Maybe its dmix that does the conversion to the byte format your DAC needs?

I think in my case, since HRT MSII supports both S16_LE and S24_3LE I can safely bypass dmix for 16/44 and 24/96 files. Just guessing.

Dump for HRT MSII DAC.
pi@rp1:~$ cat /proc/asound/card0/stream0
http://www.hirestech.com 2013 REV 2.3 Music Streamer II at usb-bcm2708_usb-1.3, full s : USB Audio

Playback:
Status: Stop
Interface 1
Altset 1
Format: S24_3LE
Channels: 2
Endpoint: 1 OUT (ASYNC)
Rates: 96000, 88200, 48000, 44100, 32000
Interface 1
Altset 2
Format: S16_LE
Channels: 2
Endpoint: 1 OUT (ASYNC)
Rates: 96000, 88200, 48000, 44100, 32000

]]>
Tue, 05 Nov 2013 13:19:59 +0100
ENSen on How to change the Shairport sample rate? http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1716 RaspyFi install and troubleshooting http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1716

tc-fi said

The Airplay name change was just an extra I threw in. It has no effect whatsoever on audio :)

That explains it Laugh

tc-fi said
What model DAC are you using?

I am using a DIY dac. The USB input is handled by WaveIO usb to i2s interface. It is based on XMOS USB 2.0 reference design which is used in many commercial DACs. The output from "cat /proc/asound/card0/stream0" looks like this;

Luckit Luckit USB Audio 2.0 at usb-bcm2708_usb-1.3.1, high speed : USB Audio

Playback:
Status: Stop
Interface 1
Altset 1
Format: S32_LE
Channels: 2
Endpoint: 1 OUT (ASYNC)
Rates: 44100, 48000, 88200, 96000, 176400, 192000
Data packet interval: 125 us

]]>
Tue, 05 Nov 2013 11:24:34 +0100
tc-fi on How to change the Shairport sample rate? http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1714 RaspyFi install and troubleshooting http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1714 The Airplay name change was just an extra I threw in. It has no effect whatsoever on audio :)

What model DAC are you using?

]]>
Tue, 05 Nov 2013 09:51:50 +0100
ENSen on How to change the Shairport sample rate? http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1713 RaspyFi install and troubleshooting http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1713 Thank you very much for your answer.

Disabling dmix in asound.conf gave me a very distorted sound.

Changing the default sample rate to 44100 solved my problem.

I have not tried changing the Airplay name yet but how could that affect the sample rate?

]]>
Tue, 05 Nov 2013 09:20:34 +0100
tc-fi on How to change the Shairport sample rate? http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1711 RaspyFi install and troubleshooting http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1711 Hi,

For Airplay, it is the client player that typically enforces resample to 16/44100, but also an Airplay receiver (Apple TV, RaspyFi) may perform a second resampling to 16/48000

For example, lets use a 24/96 music file as our source and iTunes as our player. iTunes will first resample the file to 16/44100 prior to streaming to the Airplay receiver. Then here is what happens at the receiver end:

1. Apple Airport Express 16/44100 output (no resample)
2. Apple TV resample to 16/48000 output
3. RaspyFi resample to 16/48000 output

The worst cases are 2 and 3 where 24/96 resample to 16/44 in the player then resampled again to 16/48 in the receiver. This is not good! Thankfully there are some simple changes you can make in RaspyFi that prevent resampling when using Airplay.

Disabling alsa automatic sample rate conversion i.e., use hw instead of dmix

- sudo nano /etc/asound.conf
- pcm.!default {
type hw
card 0
device 0
}

- OR -

Changing the rate if using dmix automatic sample rate conversion

- sudo nano /usr/share/alsa/alsa.conf
- defaults.pcm.dmix.rate 44100 (default is 48000)

And for those who might want to change the Airplay name that shows up in your player.

- sudo nano /etc/init.d/shairport
- NAME="Airfi - Test"

]]>
Tue, 05 Nov 2013 07:13:59 +0100
ENSen on How to change the Shairport sample rate? http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1693 RaspyFi install and troubleshooting http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1693 I checked the Shairport source code and from what I understand it can only output 44.1 kHz so a resampling must be done outside of Shairport.
What audio backend is used for Shairport in Raspify?

]]>
Sun, 03 Nov 2013 01:24:36 +0100
ENSen on How to change the Shairport sample rate? http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1666 RaspyFi install and troubleshooting http://www.raspyfi.com/forum/raspyfi-install-and-troubleshooting/how-to-change-the-shairport-sample-rate/#p1666 Just installed Raspyfi yesterday and it worked like a charm right out of the box. I can play 24bit/192kHz files from my USB drive to the USB dac without any glitches.

I do have a problem with Shairport though. It outputs everything in 48kHz which is not correct, it should be 44.1kHz for my music files. Is there any way to change this?

Regards
Jonas

]]>
Thu, 31 Oct 2013 13:12:17 +0100