2011-11-14, 14:21
Hi!
I'm using XBMC almost latest git version on gentoo.
There is a known issue and a solution for a receiver connected via HDMI to start playing sound a second or two after a song starts playing in XBMC. This leads to a "cut-off" a second of the song while listening.
The solution is to play silence all the time to make reciever be ready to play sound at any time.
I personally do this via
This solution is not the ideal since it uses dmixer to output sound which resamples audio.
Since
shows this:
I made such alsa configuration in /etc/asound.conf
BTW does anyone know what are period_size and buffer_size here?
And this solves the audio "cut-off" problem when playing any song (I have normal 44100Hz flacs and 98000Hz ones).I also want equalizer to process my audio so I use alsaequal.
Since dmixer is set up to use 6 channels playing 5.1 audio signal is also ok.
But when playing video with sound - sound does not play! ("Failed to initialize audio device" is displayed)
XBMC log starts being filled with messages like
Sound in video is mp3 48000Hz 2 channels (stereo)
I have disabled DTS and Ac3 audio passthrough since I want to be able regulate volume while playing video as well.
Video starts playing if I change dmix settings to use 48000 hz instead of 192000. I also tried 98000 but with no luck.
Setting 48000 Hz in dmixer is not an option as with this being set 98000Hz flacs do not play and cause XBMC to hang.
In advancedsettings.xml I have an option for audio since the default music player remaps 5.1 sound channels and this remap is different than in video player (which is strange!)
Can anyone help with this? How can I make video files to play audio signal with current settings in alsa conf?
Maybe I can somehow avoid using dmixer as it definitely leads to loss in sound quality and still make a receiver to be ready? (Windows somehow does this!) This would even be a better solution.
Thanks!
I'm using XBMC almost latest git version on gentoo.
There is a known issue and a solution for a receiver connected via HDMI to start playing sound a second or two after a song starts playing in XBMC. This leads to a "cut-off" a second of the song while listening.
The solution is to play silence all the time to make reciever be ready to play sound at any time.
I personally do this via
Code:
/usr/bin/aplay -c6 -r192000 -fS24_LE < /dev/zero > /dev/null 2>&1 &
Since
Code:
cat /proc/asound/NVidia/eld#3.0
shows this:
Code:
monitor_present 1
eld_valid 1
monitor_name DENON-AVAMP
connection_type HDMI
eld_version [0x2] CEA-861D or below
edid_version [0x3] CEA-861-B, C or D
manufacture_id 0xee11
product_id 0x1d
port_id 0x20000
support_hdcp 0
support_ai 0
audio_sync_delay 0
speakers [0x5f] FL/FR LFE FC RL/RR RC RLC/RRC
sad_count 7
sad0_coding_type [0x1] LPCM
sad0_channels 8
sad0_rates [0x1ee0] 44100 48000 88200 176400 192000 384000
sad0_bits [0xe0000] 16 20 24
sad1_coding_type [0x7] DTS
sad1_channels 6
sad1_rates [0x6c0] 48000 88200 176400 192000
sad1_max_bitrate 1536000
sad2_coding_type [0x2] AC-3
sad2_channels 6
sad2_rates [0xe0] 44100 48000 88200
sad2_max_bitrate 640000
sad3_coding_type [0xb] DTS-HD
sad3_channels 8
sad3_rates [0x1ec0] 48000 88200 176400 192000 384000
sad4_coding_type [0xa] E-AC-3/DD+ (Dolby Digital Plus)
sad4_channels 8
sad4_rates [0xc0] 48000 88200
sad5_coding_type [0xc] MLP (Dolby TrueHD)
sad5_channels 6
sad5_rates [0x1ec0] 48000 88200 176400 192000 384000
sad6_coding_type [0xc] MLP (Dolby TrueHD)
sad6_channels 8
sad6_rates [0x6c0] 48000 88200 176400 192000
I made such alsa configuration in /etc/asound.conf
Code:
pcm.dmixer {
type dmix;
ipc_key 2048;
ipc_key_add_uid 0;
ipc_perm 0660 # IPC permissions (octal, default 0600)
slave {
pcm "hw:0,9"; # Always use pure hw. dmix will reformat/resample audio.
channels 6;
#period_time 0;
period_size 512;
#buffer_time 0;
buffer_size 8192;
#buffer_size 4096;
#rate 96000;
rate 192000;
format S24_LE;
}
}
pcm.plugequal {
type equal;
# slave.pcm "plughw:0,9";
slave.pcm "plug:dmixer";
# channels 6;
}
pcm.!surround51 {
type asym;
# type plug;
# slave.pcm "hw:0,9";
# slave.pcm plugequal;
playback.pcm "dmixer";
# slave.pcm "plug:dmixer";
# slave.channels 6;
}
pcm.!default {
type plug;
# slave.pcm "hw:0,9";
slave.pcm plugequal;
# slave.pcm "plug:dmixer";
# slave.channels 6;
}
ctl.equal {
type equal;
}
#defaults.pcm.rate_converter "samplerate_best"
BTW does anyone know what are period_size and buffer_size here?
And this solves the audio "cut-off" problem when playing any song (I have normal 44100Hz flacs and 98000Hz ones).I also want equalizer to process my audio so I use alsaequal.
Since dmixer is set up to use 6 channels playing 5.1 audio signal is also ok.
But when playing video with sound - sound does not play! ("Failed to initialize audio device" is displayed)
XBMC log starts being filled with messages like
Code:
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 7798, consumed: 2707
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 2867, consumed: 7798
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 7144, consumed: 2867
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 2663, consumed: 7144
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 7650, consumed: 2663
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 2635, consumed: 7650
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 2631, consumed: 2635
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 7105, consumed: 2631
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 2472, consumed: 7105
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 2476, consumed: 2472
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 6240, consumed: 2476
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 2459, consumed: 6240
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 2406, consumed: 2459
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 7278, consumed: 2406
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 2291, consumed: 7278
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 3320, consumed: 2291
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 7024, consumed: 3320
12:08:38 T:139749569369856 WARNING: Decode - avcodec_decode_video didn't consume the full packet. size: 2368, consumed: 7024
Sound in video is mp3 48000Hz 2 channels (stereo)
I have disabled DTS and Ac3 audio passthrough since I want to be able regulate volume while playing video as well.
Video starts playing if I change dmix settings to use 48000 hz instead of 192000. I also tried 98000 but with no luck.
Setting 48000 Hz in dmixer is not an option as with this being set 98000Hz flacs do not play and cause XBMC to hang.
In advancedsettings.xml I have an option for audio since the default music player remaps 5.1 sound channels and this remap is different than in video player (which is strange!)
Code:
<advancedsettings>
<audio>
<!-- Default audio player: paplayer or dvdplayer (or mplayer on Xbox) -->
<defaultplayer>dvdplayer</defaultplayer>
</audio>
</advancedsettings>
Can anyone help with this? How can I make video files to play audio signal with current settings in alsa conf?
Maybe I can somehow avoid using dmixer as it definitely leads to loss in sound quality and still make a receiver to be ready? (Windows somehow does this!) This would even be a better solution.
Thanks!