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?
]]>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?
]]>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
tc-fi said
The Airplay name change was just an extra I threw in. It has no effect whatsoever on audio
That explains it
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
What model DAC are you using?
]]>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?
]]>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"
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